erp内部订单、仓库、采购、销售代码生成
This commit is contained in:
@@ -15,4 +15,8 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode ERP_FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
ErrorCode ERP_FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
ErrorCode ERP_COSTCENTER_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
ErrorCode ERP_COSTCENTER_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
ErrorCode ERP_PRODUCTIVE_VERSION_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
ErrorCode ERP_PRODUCTIVE_VERSION_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
|
ErrorCode ERP_PURCHASE_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
|
ErrorCode ERP_INTERNAL_ORDER_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
|
ErrorCode ERP_SALES_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
|
ErrorCode ERP_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpInternalOrderDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.erp.ErpInternalOrderService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP内部订单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sply/erp-internal-order")
|
||||||
|
@Validated
|
||||||
|
public class ErpInternalOrderController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpInternalOrderService erpInternalOrderService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建ERP内部订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:create')")
|
||||||
|
public CommonResult<ErpInternalOrderRespVO> createErpInternalOrder(@Valid @RequestBody ErpInternalOrderSaveReqVO createReqVO) {
|
||||||
|
return success(erpInternalOrderService.createErpInternalOrder(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新ERP内部订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:update')")
|
||||||
|
public CommonResult<Boolean> updateErpInternalOrder(@Valid @RequestBody ErpInternalOrderSaveReqVO updateReqVO) {
|
||||||
|
erpInternalOrderService.updateErpInternalOrder(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除ERP内部订单")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpInternalOrder(@RequestParam("id") Long id) {
|
||||||
|
erpInternalOrderService.deleteErpInternalOrder(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除ERP内部订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpInternalOrderList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
erpInternalOrderService.deleteErpInternalOrderListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得ERP内部订单")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:query')")
|
||||||
|
public CommonResult<ErpInternalOrderRespVO> getErpInternalOrder(@RequestParam("id") Long id) {
|
||||||
|
ErpInternalOrderDO erpInternalOrder = erpInternalOrderService.getErpInternalOrder(id);
|
||||||
|
return success(BeanUtils.toBean(erpInternalOrder, ErpInternalOrderRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得ERP内部订单分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:query')")
|
||||||
|
public CommonResult<PageResult<ErpInternalOrderRespVO>> getErpInternalOrderPage(@Valid ErpInternalOrderPageReqVO pageReqVO) {
|
||||||
|
PageResult<ErpInternalOrderDO> pageResult = erpInternalOrderService.getErpInternalOrderPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ErpInternalOrderRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出ERP内部订单 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportErpInternalOrderExcel(@Valid ErpInternalOrderPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ErpInternalOrderDO> list = erpInternalOrderService.getErpInternalOrderPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "ERP内部订单.xls", "数据", ErpInternalOrderRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ErpInternalOrderRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpPurchaseOrganizationDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.erp.ErpPurchaseOrganizationService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP采购组织")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sply/erp-purchase-organization")
|
||||||
|
@Validated
|
||||||
|
public class ErpPurchaseOrganizationController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpPurchaseOrganizationService erpPurchaseOrganizationService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建ERP采购组织")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:create')")
|
||||||
|
public CommonResult<ErpPurchaseOrganizationRespVO> createErpPurchaseOrganization(@Valid @RequestBody ErpPurchaseOrganizationSaveReqVO createReqVO) {
|
||||||
|
return success(erpPurchaseOrganizationService.createErpPurchaseOrganization(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新ERP采购组织")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:update')")
|
||||||
|
public CommonResult<Boolean> updateErpPurchaseOrganization(@Valid @RequestBody ErpPurchaseOrganizationSaveReqVO updateReqVO) {
|
||||||
|
erpPurchaseOrganizationService.updateErpPurchaseOrganization(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除ERP采购组织")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpPurchaseOrganization(@RequestParam("id") Long id) {
|
||||||
|
erpPurchaseOrganizationService.deleteErpPurchaseOrganization(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除ERP采购组织")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpPurchaseOrganizationList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
erpPurchaseOrganizationService.deleteErpPurchaseOrganizationListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得ERP采购组织")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:query')")
|
||||||
|
public CommonResult<ErpPurchaseOrganizationRespVO> getErpPurchaseOrganization(@RequestParam("id") Long id) {
|
||||||
|
ErpPurchaseOrganizationDO erpPurchaseOrganization = erpPurchaseOrganizationService.getErpPurchaseOrganization(id);
|
||||||
|
return success(BeanUtils.toBean(erpPurchaseOrganization, ErpPurchaseOrganizationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得ERP采购组织分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:query')")
|
||||||
|
public CommonResult<PageResult<ErpPurchaseOrganizationRespVO>> getErpPurchaseOrganizationPage(@Valid ErpPurchaseOrganizationPageReqVO pageReqVO) {
|
||||||
|
PageResult<ErpPurchaseOrganizationDO> pageResult = erpPurchaseOrganizationService.getErpPurchaseOrganizationPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ErpPurchaseOrganizationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出ERP采购组织 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportErpPurchaseOrganizationExcel(@Valid ErpPurchaseOrganizationPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ErpPurchaseOrganizationDO> list = erpPurchaseOrganizationService.getErpPurchaseOrganizationPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "ERP采购组织.xls", "数据", ErpPurchaseOrganizationRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ErpPurchaseOrganizationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpSalesOrganizationDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.erp.ErpSalesOrganizationService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP销售组织")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sply/erp-sales-organization")
|
||||||
|
@Validated
|
||||||
|
public class ErpSalesOrganizationController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpSalesOrganizationService erpSalesOrganizationService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建ERP销售组织")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:create')")
|
||||||
|
public CommonResult<ErpSalesOrganizationRespVO> createErpSalesOrganization(@Valid @RequestBody ErpSalesOrganizationSaveReqVO createReqVO) {
|
||||||
|
return success(erpSalesOrganizationService.createErpSalesOrganization(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新ERP销售组织")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:update')")
|
||||||
|
public CommonResult<Boolean> updateErpSalesOrganization(@Valid @RequestBody ErpSalesOrganizationSaveReqVO updateReqVO) {
|
||||||
|
erpSalesOrganizationService.updateErpSalesOrganization(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除ERP销售组织")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpSalesOrganization(@RequestParam("id") Long id) {
|
||||||
|
erpSalesOrganizationService.deleteErpSalesOrganization(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除ERP销售组织")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpSalesOrganizationList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
erpSalesOrganizationService.deleteErpSalesOrganizationListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得ERP销售组织")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:query')")
|
||||||
|
public CommonResult<ErpSalesOrganizationRespVO> getErpSalesOrganization(@RequestParam("id") Long id) {
|
||||||
|
ErpSalesOrganizationDO erpSalesOrganization = erpSalesOrganizationService.getErpSalesOrganization(id);
|
||||||
|
return success(BeanUtils.toBean(erpSalesOrganization, ErpSalesOrganizationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得ERP销售组织分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:query')")
|
||||||
|
public CommonResult<PageResult<ErpSalesOrganizationRespVO>> getErpSalesOrganizationPage(@Valid ErpSalesOrganizationPageReqVO pageReqVO) {
|
||||||
|
PageResult<ErpSalesOrganizationDO> pageResult = erpSalesOrganizationService.getErpSalesOrganizationPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ErpSalesOrganizationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出ERP销售组织 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportErpSalesOrganizationExcel(@Valid ErpSalesOrganizationPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ErpSalesOrganizationDO> list = erpSalesOrganizationService.getErpSalesOrganizationPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "ERP销售组织.xls", "数据", ErpSalesOrganizationRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ErpSalesOrganizationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpWarehouseDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.erp.ErpWarehouseService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP库位")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sply/erp-warehouse")
|
||||||
|
@Validated
|
||||||
|
public class ErpWarehouseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpWarehouseService erpWarehouseService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建ERP库位")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")
|
||||||
|
public CommonResult<ErpWarehouseRespVO> createErpWarehouse(@Valid @RequestBody ErpWarehouseSaveReqVO createReqVO) {
|
||||||
|
return success(erpWarehouseService.createErpWarehouse(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新ERP库位")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:update')")
|
||||||
|
public CommonResult<Boolean> updateErpWarehouse(@Valid @RequestBody ErpWarehouseSaveReqVO updateReqVO) {
|
||||||
|
erpWarehouseService.updateErpWarehouse(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除ERP库位")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpWarehouse(@RequestParam("id") Long id) {
|
||||||
|
erpWarehouseService.deleteErpWarehouse(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除ERP库位")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:delete')")
|
||||||
|
public CommonResult<Boolean> deleteErpWarehouseList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
erpWarehouseService.deleteErpWarehouseListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得ERP库位")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:query')")
|
||||||
|
public CommonResult<ErpWarehouseRespVO> getErpWarehouse(@RequestParam("id") Long id) {
|
||||||
|
ErpWarehouseDO erpWarehouse = erpWarehouseService.getErpWarehouse(id);
|
||||||
|
return success(BeanUtils.toBean(erpWarehouse, ErpWarehouseRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得ERP库位分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:query')")
|
||||||
|
public CommonResult<PageResult<ErpWarehouseRespVO>> getErpWarehousePage(@Valid ErpWarehousePageReqVO pageReqVO) {
|
||||||
|
PageResult<ErpWarehouseDO> pageResult = erpWarehouseService.getErpWarehousePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ErpWarehouseRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出ERP库位 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportErpWarehouseExcel(@Valid ErpWarehousePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ErpWarehouseDO> list = erpWarehouseService.getErpWarehousePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "ERP库位.xls", "数据", ErpWarehouseRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ErpWarehouseRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP内部订单分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpInternalOrderPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "内部订单编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单描述", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单类型", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "是否已关闭;使用这个基础数据是,如果为X时必须和工区使用")
|
||||||
|
private String isOff;
|
||||||
|
|
||||||
|
@Schema(description = "是否已完成")
|
||||||
|
private String isFinish;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP内部订单 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ErpInternalOrderRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19327")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("内部订单编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("内部订单描述")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("内部订单类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "是否已关闭;使用这个基础数据是,如果为X时必须和工区使用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否已关闭;使用这个基础数据是,如果为X时必须和工区使用")
|
||||||
|
private String isOff;
|
||||||
|
|
||||||
|
@Schema(description = "是否已完成")
|
||||||
|
@ExcelProperty("是否已完成")
|
||||||
|
private String isFinish;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP内部订单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpInternalOrderSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19327")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "内部订单编号不能为空")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "内部订单描述不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "内部订单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotEmpty(message = "内部订单类型不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "是否已关闭;使用这个基础数据是,如果为X时必须和工区使用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "是否已关闭;使用这个基础数据是,如果为X时必须和工区使用不能为空")
|
||||||
|
private String isOff;
|
||||||
|
|
||||||
|
@Schema(description = "是否已完成")
|
||||||
|
private String isFinish;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP采购组织分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpPurchaseOrganizationPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "采购组织编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织描述", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;存入ERP公司编码")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP采购组织 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ErpPurchaseOrganizationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17344")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("采购组织编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@ExcelProperty("采购组织描述")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;存入ERP公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("公司编码;存入ERP公司编码")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP采购组织新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpPurchaseOrganizationSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17344")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "采购组织编号不能为空")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@NotEmpty(message = "采购组织描述不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;存入ERP公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "公司编码;存入ERP公司编码不能为空")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP销售组织分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpSalesOrganizationPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "销售组织编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "销售组织描述", example = "李四")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;存入ERP公司编码")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP销售组织 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ErpSalesOrganizationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22623")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "销售组织编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("销售组织编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "销售组织描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||||
|
@ExcelProperty("销售组织描述")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;存入ERP公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("公司编码;存入ERP公司编码")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP销售组织新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpSalesOrganizationSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22623")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "销售组织编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "销售组织编号不能为空")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@Schema(description = "销售组织描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||||
|
@NotEmpty(message = "销售组织描述不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;存入ERP公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "公司编码;存入ERP公司编码不能为空")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP库位分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpWarehousePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码;将查询参数存入")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位描述", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP库位 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ErpWarehouseRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16847")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码;将查询参数存入")
|
||||||
|
@ExcelProperty("工厂编码;将查询参数存入")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||||
|
@ExcelProperty("库位描述")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("库位编码")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP库位新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpWarehouseSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16847")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码;将查询参数存入")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||||
|
@NotEmpty(message = "库位描述不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "库位编码不能为空")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
/**
|
||||||
|
* ERP内部订单 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("sply_erp_intl_ord")
|
||||||
|
@KeySequence("sply_erp_intl_ord_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class ErpInternalOrderDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 内部订单编号
|
||||||
|
*/
|
||||||
|
@TableField("NUM")
|
||||||
|
private String number;
|
||||||
|
/**
|
||||||
|
* 内部订单描述
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 内部订单类型
|
||||||
|
*/
|
||||||
|
@TableField("TP")
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 是否已关闭;使用这个基础数据是,如果为X时必须和工区使用
|
||||||
|
*/
|
||||||
|
@TableField("IS_OFF")
|
||||||
|
private String isOff;
|
||||||
|
/**
|
||||||
|
* 是否已完成
|
||||||
|
*/
|
||||||
|
@TableField("IS_FIN")
|
||||||
|
private String isFinish;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
/**
|
||||||
|
* ERP采购组织 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("sply_erp_prch_orgz")
|
||||||
|
@KeySequence("sply_erp_prch_orgz_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class ErpPurchaseOrganizationDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 采购组织编号
|
||||||
|
*/
|
||||||
|
@TableField("NUM")
|
||||||
|
private String number;
|
||||||
|
/**
|
||||||
|
* 采购组织描述
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 公司编码;存入ERP公司编码
|
||||||
|
*/
|
||||||
|
@TableField("CPN_NUM")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
/**
|
||||||
|
* ERP销售组织 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("sply_erp_sale_orgz")
|
||||||
|
@KeySequence("sply_erp_sale_orgz_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class ErpSalesOrganizationDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 销售组织编号
|
||||||
|
*/
|
||||||
|
@TableField("NUM")
|
||||||
|
private String number;
|
||||||
|
/**
|
||||||
|
* 销售组织描述
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 公司编码;存入ERP公司编码
|
||||||
|
*/
|
||||||
|
@TableField("CPN_NUM")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
/**
|
||||||
|
* ERP库位 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("sply_erp_wrh")
|
||||||
|
@KeySequence("sply_erp_wrh_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class ErpWarehouseDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 工厂编码;将查询参数存入
|
||||||
|
*/
|
||||||
|
@TableField("FACT_NUM")
|
||||||
|
private String factoryNumber;
|
||||||
|
/**
|
||||||
|
* 库位描述
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 公司编号
|
||||||
|
*/
|
||||||
|
@TableField("COMPANY_ID")
|
||||||
|
private Long companyId;
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
@TableField("COMPANY_NAME")
|
||||||
|
private String companyName;
|
||||||
|
/**
|
||||||
|
* 部门编号
|
||||||
|
*/
|
||||||
|
@TableField("DEPT_ID")
|
||||||
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
@TableField("DEPT_NAME")
|
||||||
|
private String deptName;
|
||||||
|
/**
|
||||||
|
* 岗位编号
|
||||||
|
*/
|
||||||
|
@TableField("POST_ID")
|
||||||
|
private Long postId;
|
||||||
|
/**
|
||||||
|
* 库位编码
|
||||||
|
*/
|
||||||
|
@TableField("NUM")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpInternalOrderDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP内部订单 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ErpInternalOrderMapper extends BaseMapperX<ErpInternalOrderDO> {
|
||||||
|
|
||||||
|
default PageResult<ErpInternalOrderDO> selectPage(ErpInternalOrderPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpInternalOrderDO>()
|
||||||
|
.eqIfPresent(ErpInternalOrderDO::getNumber, reqVO.getNumber())
|
||||||
|
.likeIfPresent(ErpInternalOrderDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ErpInternalOrderDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ErpInternalOrderDO::getIsOff, reqVO.getIsOff())
|
||||||
|
.eqIfPresent(ErpInternalOrderDO::getIsFinish, reqVO.getIsFinish())
|
||||||
|
.orderByDesc(ErpInternalOrderDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpPurchaseOrganizationDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP采购组织 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ErpPurchaseOrganizationMapper extends BaseMapperX<ErpPurchaseOrganizationDO> {
|
||||||
|
|
||||||
|
default PageResult<ErpPurchaseOrganizationDO> selectPage(ErpPurchaseOrganizationPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpPurchaseOrganizationDO>()
|
||||||
|
.eqIfPresent(ErpPurchaseOrganizationDO::getNumber, reqVO.getNumber())
|
||||||
|
.likeIfPresent(ErpPurchaseOrganizationDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ErpPurchaseOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
|
.orderByDesc(ErpPurchaseOrganizationDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpSalesOrganizationDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP销售组织 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ErpSalesOrganizationMapper extends BaseMapperX<ErpSalesOrganizationDO> {
|
||||||
|
|
||||||
|
default PageResult<ErpSalesOrganizationDO> selectPage(ErpSalesOrganizationPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpSalesOrganizationDO>()
|
||||||
|
.eqIfPresent(ErpSalesOrganizationDO::getNumber, reqVO.getNumber())
|
||||||
|
.likeIfPresent(ErpSalesOrganizationDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ErpSalesOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
|
.orderByDesc(ErpSalesOrganizationDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpWarehouseDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP库位 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ErpWarehouseMapper extends BaseMapperX<ErpWarehouseDO> {
|
||||||
|
|
||||||
|
default PageResult<ErpWarehouseDO> selectPage(ErpWarehousePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpWarehouseDO>()
|
||||||
|
.eqIfPresent(ErpWarehouseDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
|
.likeIfPresent(ErpWarehouseDO::getName, reqVO.getName())
|
||||||
|
.betweenIfPresent(ErpWarehouseDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(ErpWarehouseDO::getNumber, reqVO.getNumber())
|
||||||
|
.orderByDesc(ErpWarehouseDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpInternalOrderDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP内部订单 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface ErpInternalOrderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP内部订单
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
ErpInternalOrderRespVO createErpInternalOrder(@Valid ErpInternalOrderSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP内部订单
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateErpInternalOrder(@Valid ErpInternalOrderSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP内部订单
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteErpInternalOrder(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除ERP内部订单
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteErpInternalOrderListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP内部订单
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP内部订单
|
||||||
|
*/
|
||||||
|
ErpInternalOrderDO getErpInternalOrder(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP内部订单分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP内部订单分页
|
||||||
|
*/
|
||||||
|
PageResult<ErpInternalOrderDO> getErpInternalOrderPage(ErpInternalOrderPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpInternalOrderDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpInternalOrderMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP内部订单 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ErpInternalOrderServiceImpl implements ErpInternalOrderService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpInternalOrderMapper erpInternalOrderMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpInternalOrderRespVO createErpInternalOrder(ErpInternalOrderSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ErpInternalOrderDO erpInternalOrder = BeanUtils.toBean(createReqVO, ErpInternalOrderDO.class);
|
||||||
|
erpInternalOrderMapper.insert(erpInternalOrder);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(erpInternalOrder, ErpInternalOrderRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateErpInternalOrder(ErpInternalOrderSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpInternalOrderExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ErpInternalOrderDO updateObj = BeanUtils.toBean(updateReqVO, ErpInternalOrderDO.class);
|
||||||
|
erpInternalOrderMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpInternalOrder(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpInternalOrderExists(id);
|
||||||
|
// 删除
|
||||||
|
erpInternalOrderMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpInternalOrderListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpInternalOrderExists(ids);
|
||||||
|
// 删除
|
||||||
|
erpInternalOrderMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpInternalOrderExists(List<Long> ids) {
|
||||||
|
List<ErpInternalOrderDO> list = erpInternalOrderMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(ERP_INTERNAL_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpInternalOrderExists(Long id) {
|
||||||
|
if (erpInternalOrderMapper.selectById(id) == null) {
|
||||||
|
throw exception(ERP_INTERNAL_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpInternalOrderDO getErpInternalOrder(Long id) {
|
||||||
|
return erpInternalOrderMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ErpInternalOrderDO> getErpInternalOrderPage(ErpInternalOrderPageReqVO pageReqVO) {
|
||||||
|
return erpInternalOrderMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpPurchaseOrganizationDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP采购组织 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface ErpPurchaseOrganizationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP采购组织
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
ErpPurchaseOrganizationRespVO createErpPurchaseOrganization(@Valid ErpPurchaseOrganizationSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP采购组织
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateErpPurchaseOrganization(@Valid ErpPurchaseOrganizationSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP采购组织
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteErpPurchaseOrganization(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除ERP采购组织
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteErpPurchaseOrganizationListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP采购组织
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP采购组织
|
||||||
|
*/
|
||||||
|
ErpPurchaseOrganizationDO getErpPurchaseOrganization(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP采购组织分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP采购组织分页
|
||||||
|
*/
|
||||||
|
PageResult<ErpPurchaseOrganizationDO> getErpPurchaseOrganizationPage(ErpPurchaseOrganizationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpPurchaseOrganizationDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpPurchaseOrganizationMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP采购组织 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ErpPurchaseOrganizationServiceImpl implements ErpPurchaseOrganizationService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpPurchaseOrganizationMapper erpPurchaseOrganizationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpPurchaseOrganizationRespVO createErpPurchaseOrganization(ErpPurchaseOrganizationSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ErpPurchaseOrganizationDO erpPurchaseOrganization = BeanUtils.toBean(createReqVO, ErpPurchaseOrganizationDO.class);
|
||||||
|
erpPurchaseOrganizationMapper.insert(erpPurchaseOrganization);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(erpPurchaseOrganization, ErpPurchaseOrganizationRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateErpPurchaseOrganization(ErpPurchaseOrganizationSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpPurchaseOrganizationExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ErpPurchaseOrganizationDO updateObj = BeanUtils.toBean(updateReqVO, ErpPurchaseOrganizationDO.class);
|
||||||
|
erpPurchaseOrganizationMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpPurchaseOrganization(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpPurchaseOrganizationExists(id);
|
||||||
|
// 删除
|
||||||
|
erpPurchaseOrganizationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpPurchaseOrganizationListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpPurchaseOrganizationExists(ids);
|
||||||
|
// 删除
|
||||||
|
erpPurchaseOrganizationMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpPurchaseOrganizationExists(List<Long> ids) {
|
||||||
|
List<ErpPurchaseOrganizationDO> list = erpPurchaseOrganizationMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(ERP_PURCHASE_ORGANIZATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpPurchaseOrganizationExists(Long id) {
|
||||||
|
if (erpPurchaseOrganizationMapper.selectById(id) == null) {
|
||||||
|
throw exception(ERP_PURCHASE_ORGANIZATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpPurchaseOrganizationDO getErpPurchaseOrganization(Long id) {
|
||||||
|
return erpPurchaseOrganizationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ErpPurchaseOrganizationDO> getErpPurchaseOrganizationPage(ErpPurchaseOrganizationPageReqVO pageReqVO) {
|
||||||
|
return erpPurchaseOrganizationMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpSalesOrganizationDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP销售组织 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface ErpSalesOrganizationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP销售组织
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
ErpSalesOrganizationRespVO createErpSalesOrganization(@Valid ErpSalesOrganizationSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP销售组织
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateErpSalesOrganization(@Valid ErpSalesOrganizationSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP销售组织
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteErpSalesOrganization(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除ERP销售组织
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteErpSalesOrganizationListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP销售组织
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP销售组织
|
||||||
|
*/
|
||||||
|
ErpSalesOrganizationDO getErpSalesOrganization(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP销售组织分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP销售组织分页
|
||||||
|
*/
|
||||||
|
PageResult<ErpSalesOrganizationDO> getErpSalesOrganizationPage(ErpSalesOrganizationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpSalesOrganizationDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpSalesOrganizationMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP销售组织 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ErpSalesOrganizationServiceImpl implements ErpSalesOrganizationService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpSalesOrganizationMapper erpSalesOrganizationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpSalesOrganizationRespVO createErpSalesOrganization(ErpSalesOrganizationSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ErpSalesOrganizationDO erpSalesOrganization = BeanUtils.toBean(createReqVO, ErpSalesOrganizationDO.class);
|
||||||
|
erpSalesOrganizationMapper.insert(erpSalesOrganization);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(erpSalesOrganization, ErpSalesOrganizationRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateErpSalesOrganization(ErpSalesOrganizationSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpSalesOrganizationExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ErpSalesOrganizationDO updateObj = BeanUtils.toBean(updateReqVO, ErpSalesOrganizationDO.class);
|
||||||
|
erpSalesOrganizationMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpSalesOrganization(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpSalesOrganizationExists(id);
|
||||||
|
// 删除
|
||||||
|
erpSalesOrganizationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpSalesOrganizationListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpSalesOrganizationExists(ids);
|
||||||
|
// 删除
|
||||||
|
erpSalesOrganizationMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpSalesOrganizationExists(List<Long> ids) {
|
||||||
|
List<ErpSalesOrganizationDO> list = erpSalesOrganizationMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(ERP_SALES_ORGANIZATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpSalesOrganizationExists(Long id) {
|
||||||
|
if (erpSalesOrganizationMapper.selectById(id) == null) {
|
||||||
|
throw exception(ERP_SALES_ORGANIZATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpSalesOrganizationDO getErpSalesOrganization(Long id) {
|
||||||
|
return erpSalesOrganizationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ErpSalesOrganizationDO> getErpSalesOrganizationPage(ErpSalesOrganizationPageReqVO pageReqVO) {
|
||||||
|
return erpSalesOrganizationMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpWarehouseDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP库位 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface ErpWarehouseService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP库位
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
ErpWarehouseRespVO createErpWarehouse(@Valid ErpWarehouseSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP库位
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateErpWarehouse(@Valid ErpWarehouseSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP库位
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteErpWarehouse(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除ERP库位
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteErpWarehouseListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP库位
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP库位
|
||||||
|
*/
|
||||||
|
ErpWarehouseDO getErpWarehouse(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP库位分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP库位分页
|
||||||
|
*/
|
||||||
|
PageResult<ErpWarehouseDO> getErpWarehousePage(ErpWarehousePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.erp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpWarehouseDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpWarehouseMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP库位 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ErpWarehouseServiceImpl implements ErpWarehouseService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpWarehouseMapper erpWarehouseMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpWarehouseRespVO createErpWarehouse(ErpWarehouseSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ErpWarehouseDO erpWarehouse = BeanUtils.toBean(createReqVO, ErpWarehouseDO.class);
|
||||||
|
erpWarehouseMapper.insert(erpWarehouse);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(erpWarehouse, ErpWarehouseRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateErpWarehouse(ErpWarehouseSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpWarehouseExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ErpWarehouseDO updateObj = BeanUtils.toBean(updateReqVO, ErpWarehouseDO.class);
|
||||||
|
erpWarehouseMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpWarehouse(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpWarehouseExists(id);
|
||||||
|
// 删除
|
||||||
|
erpWarehouseMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteErpWarehouseListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateErpWarehouseExists(ids);
|
||||||
|
// 删除
|
||||||
|
erpWarehouseMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpWarehouseExists(List<Long> ids) {
|
||||||
|
List<ErpWarehouseDO> list = erpWarehouseMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(ERP_WAREHOUSE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateErpWarehouseExists(Long id) {
|
||||||
|
if (erpWarehouseMapper.selectById(id) == null) {
|
||||||
|
throw exception(ERP_WAREHOUSE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ErpWarehouseDO getErpWarehouse(Long id) {
|
||||||
|
return erpWarehouseMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ErpWarehouseDO> getErpWarehousePage(ErpWarehousePageReqVO pageReqVO) {
|
||||||
|
return erpWarehouseMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpInternalOrderMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpPurchaseOrganizationMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpSalesOrganizationMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpWarehouseMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user