zss
2026-04-23 5033c375a3ee6a63bcb600d5b9f4b8d549d089e2
src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerTemplateController.java
@@ -10,15 +10,13 @@
import com.ruoyi.purchase.mapper.SalesLedgerProductTemplateMapper;
import com.ruoyi.purchase.pojo.PurchaseLedgerTemplate;
import com.ruoyi.purchase.pojo.SalesLedgerProductTemplate;
import com.ruoyi.purchase.service.PurchaseLedgerTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
@@ -31,18 +29,16 @@
 */
@RestController
@RequestMapping("/purchaseLedgerTemplate")
@Api(tags = "采购台账模板")
@Tag(name = "采购台账模板")
@AllArgsConstructor
public class PurchaseLedgerTemplateController {
    @Autowired
    private PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper;
    @Autowired
    private SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper;
    @PostMapping("/add")
    @Log(title = "添加采购台账模板", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加采购台账模板")
    @Operation(summary = "添加采购台账模板")
    public AjaxResult add(@RequestBody PurchaseLedgerDto purchaseLedgerDto) {
        // 采购模板
        if(StringUtils.isNotEmpty(purchaseLedgerDto.getTemplateName())){
@@ -72,7 +68,7 @@
    @DeleteMapping("/delete")
    @Log(title = "采购台账模板", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除采购台账模板")
    @Operation(summary = "删除采购台账模板")
    public AjaxResult delete(@RequestBody List<Long> id) {
        if(CollectionUtils.isEmpty(id)) return AjaxResult.error("请选择要删除的采购台账模板");
        int result = purchaseLedgerTemplateMapper.deleteBatchIds(id);
@@ -83,7 +79,7 @@
    @PostMapping("/update")
    @Log(title = "修改采购台账模板", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "修改采购台账模板")
    @Operation(summary = "修改采购台账模板")
    public AjaxResult update(@RequestBody PurchaseLedgerDto purchaseLedgerDto) {
        // 模板名称不能重复,有重复就不需要新增了
        PurchaseLedgerTemplate purchaseLedgerTemplate = purchaseLedgerTemplateMapper