“djh”
15 hours ago 2d9bf42ce507096c3b73a782da3ad16f29d2ccdc
multi-system/src/main/java/com/gkhy/exam/system/service/impl/PurchaseApplyServiceImpl.java
@@ -13,6 +13,7 @@
import com.gkhy.exam.system.service.PurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
@@ -47,11 +48,13 @@
        purchaseApply.setCreateTime(LocalDateTime.now());
        purchaseApply.setCreateBy(SecurityUtils.getUsername());
        applyMapper.insert(purchaseApply);
        if (!CollectionUtils.isEmpty(purchaseApply.getPurchaseApplyPlans())){
        List<PurchaseApplyPlan> purchaseApplyPlans = purchaseApply.getPurchaseApplyPlans();
        for (PurchaseApplyPlan purchaseApplyPlan : purchaseApplyPlans) {
            purchaseApplyPlan.setApplyId(purchaseApply.getId());
        }
        applyPlanMapper.insertPlans(purchaseApplyPlans);
        }
        return CommonResult.success();
    }
@@ -60,9 +63,11 @@
        purchaseApply.setUpdateTime(LocalDateTime.now());
        purchaseApply.setUpdateBy(SecurityUtils.getUsername());
        applyMapper.updateById(purchaseApply);
        if (!CollectionUtils.isEmpty(purchaseApply.getPurchaseApplyPlans())){
        List<PurchaseApplyPlan> purchaseApplyPlans = purchaseApply.getPurchaseApplyPlans();
        applyPlanMapper.deletedByIds(purchaseApply.getId());
        applyPlanMapper.insertPlans(purchaseApplyPlans);
        }
        return CommonResult.success();
    }