| | |
| | | import com.by4cloud.platformx.admin.api.vo.DeptExcelVO; |
| | | import com.by4cloud.platformx.business.dto.ProductAddDTO; |
| | | import com.by4cloud.platformx.business.dto.ProductQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.SyncProductDTO; |
| | | import com.by4cloud.platformx.business.vo.ProductExcelVO; |
| | | import com.by4cloud.platformx.business.vo.ProductTreeVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | |
| | | @PostMapping |
| | | @PreAuthorize("@pms.hasPermission('business_product_add')" ) |
| | | public R save(@RequestBody Product product) { |
| | | if (ArrayUtil.isNotEmpty(productService.listByScope(Wrappers.lambdaQuery(product).eq(Product::getErpCode,product.getErpCode())).toArray())){ |
| | | if (CollUtil.isNotEmpty(productService.listByScope(Wrappers.lambdaQuery(product).eq(Product::getErpCode,product.getErpCode())))){ |
| | | return R.failed("产品Erp编码已存在"); |
| | | } |
| | | return R.ok(productService.save(product)); |
| | |
| | | public R importProduct(@RequestExcel List<ProductExcelVO> excelVOList, BindingResult bindingResult) { |
| | | return productService.importProduct(excelVOList, bindingResult); |
| | | } |
| | | |
| | | /** |
| | | * 石煤机产品同步 |
| | | * @return |
| | | */ |
| | | @Inner(value = false) |
| | | @GetMapping("/syncSMJByDate") |
| | | public R syncSMJByDate(@ParameterObject SyncProductDTO dto) { |
| | | return productService.syncSMJByDate(dto); |
| | | } |
| | | } |