新增采购

This commit is contained in:
2026-06-27 10:40:54 +08:00
parent ce3998db74
commit 66d2b33db5
25 changed files with 1261 additions and 227 deletions

View File

@@ -13,6 +13,7 @@ import com.klp.common.utils.poi.ExcelUtil;
import com.klp.erp.domain.bo.ErpPurchasePlanAuditBo;
import com.klp.erp.domain.bo.ErpPurchasePlanBo;
import com.klp.erp.domain.vo.ErpContractOptionVo;
import com.klp.erp.domain.vo.ErpPurchasePlanDeliveryBatchVo;
import com.klp.erp.domain.vo.ErpPurchasePlanDeliveryVo;
import com.klp.erp.domain.vo.ErpPurchasePlanItemVo;
import com.klp.erp.domain.vo.ErpPurchasePlanVo;
@@ -131,7 +132,7 @@ public class ErpPurchasePlanController extends BaseController {
@PostMapping(value = "/{planId}/importDelivery", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Map<String, Object>> importDelivery(@PathVariable Long planId,
@RequestPart("file") MultipartFile file) throws Exception {
Map<String, Object> result = iErpPurchasePlanService.importDelivery(planId, file.getInputStream(), getUsername());
Map<String, Object> result = iErpPurchasePlanService.importDelivery(planId, file.getInputStream(), file.getOriginalFilename(), getUsername());
return R.ok(String.valueOf(result.get("message")), result);
}
@@ -141,6 +142,25 @@ public class ErpPurchasePlanController extends BaseController {
return R.ok(iErpPurchasePlanService.queryDeliveryList(planId));
}
/** 某计划的到货上传批次(每次上传一条,可回看) */
@GetMapping("/{planId}/deliveryBatches")
public R<List<ErpPurchasePlanDeliveryBatchVo>> deliveryBatches(@PathVariable Long planId) {
return R.ok(iErpPurchasePlanService.queryDeliveryBatches(planId));
}
/** 某批次的到货明细 */
@GetMapping("/deliveryBatch/{batchId}")
public R<List<ErpPurchasePlanDeliveryVo>> deliveryByBatch(@PathVariable Long batchId) {
return R.ok(iErpPurchasePlanService.queryDeliveryListByBatch(batchId));
}
/** 到货记录页左侧:审核通过的计划分页 */
@GetMapping("/deliveryPlans")
public TableDataInfo<ErpPurchasePlanVo> deliveryPlans(@RequestParam(value = "keyword", required = false) String keyword,
PageQuery pageQuery) {
return iErpPurchasePlanService.queryDeliveryPlanPage(keyword, pageQuery);
}
/** 删除到货明细 */
@Log(title = "采购计划-到货", businessType = BusinessType.DELETE)
@DeleteMapping("/delivery/{deliveryId}")

View File

@@ -0,0 +1,67 @@
package com.klp.erp.controller;
import com.klp.common.annotation.Log;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.erp.domain.bo.ErpSupplierTransactionBo;
import com.klp.erp.domain.vo.ErpSupplierTransactionVo;
import com.klp.erp.service.IErpSupplierTransactionService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 供应商往来流水
*
* @author klp
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/erp/supplierTxn")
public class ErpSupplierTransactionController extends BaseController {
private final IErpSupplierTransactionService txnService;
/** 某供应商的往来流水(含逐笔余额) */
@GetMapping("/list")
public R<List<ErpSupplierTransactionVo>> list(@RequestParam("supplierId") Long supplierId) {
return R.ok(txnService.queryBySupplier(supplierId));
}
/** 某供应商的往来汇总 */
@GetMapping("/summary")
public R<Map<String, Object>> summary(@RequestParam("supplierId") Long supplierId) {
return R.ok(txnService.summary(supplierId));
}
@Log(title = "供应商往来", businessType = BusinessType.INSERT)
@RepeatSubmit
@PostMapping
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpSupplierTransactionBo bo) {
return toAjax(txnService.insertByBo(bo));
}
@Log(title = "供应商往来", businessType = BusinessType.UPDATE)
@RepeatSubmit
@PutMapping
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpSupplierTransactionBo bo) {
return toAjax(txnService.updateByBo(bo));
}
@Log(title = "供应商往来", businessType = BusinessType.DELETE)
@DeleteMapping("/{txnIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] txnIds) {
return toAjax(txnService.deleteByIds(Arrays.asList(txnIds)));
}
}