From 430477c7e0777531f22fc18dc8906ea75cdc21d9 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期三, 03 十二月 2025 16:53:53 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ProductServiceServiceImpl.java | 68 ++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ProductServiceServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ProductServiceServiceImpl.java
new file mode 100644
index 0000000..1ee2dd0
--- /dev/null
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ProductServiceServiceImpl.java
@@ -0,0 +1,68 @@
+package com.gkhy.exam.system.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.gkhy.exam.common.api.CommonPage;
+import com.gkhy.exam.common.api.CommonResult;
+import com.gkhy.exam.common.constant.UserConstant;
+import com.gkhy.exam.common.utils.PageUtils;
+import com.gkhy.exam.common.utils.SecurityUtils;
+import com.gkhy.exam.system.domain.InternalKnowledge;
+import com.gkhy.exam.system.domain.ProductService;
+import com.gkhy.exam.system.mapper.ProductServiceMapper;
+import com.gkhy.exam.system.service.ProductServiceService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * <p>
+ * 产品服务实现过程 服务实现类
+ * </p>
+ *
+ * @author hh
+ * @since 2025-12-02 16:59:08
+ */
+@Service
+public class ProductServiceServiceImpl extends ServiceImpl<ProductServiceMapper, ProductService> implements ProductServiceService {
+
+ @Autowired
+ private ProductServiceMapper productServiceMapper;
+
+ @Override
+ public CommonPage selectProductServiceList(ProductService productService) {
+ PageUtils.startPage();
+ List<ProductService> productServices = productServiceMapper.selectProductServiceList(productService);
+ return CommonPage.restPage(productServices);
+ }
+
+ @Override
+ public CommonResult saveProductService(ProductService productService) {
+ String[] split = productService.getFileUrl().split(",");
+ if (split.length > 3){
+ return CommonResult.failed("最多上传3张图片");
+ }
+ if (productService.getId() == null){
+ productService.setCreateTime(LocalDateTime.now());
+ productService.setCreateBy(SecurityUtils.getUsername());
+ productServiceMapper.insert(productService);
+ }else {
+ productService.setUpdateTime(LocalDateTime.now());
+ productService.setUpdateBy(SecurityUtils.getUsername());
+ productServiceMapper.updateById(productService);
+ }
+ return CommonResult.success();
+ }
+
+ @Override
+ public CommonResult delProductService(Long id) {
+ productServiceMapper.update(new ProductService(),
+ new LambdaUpdateWrapper<ProductService>().eq(ProductService::getId, id)
+ .set(ProductService::getDelFlag, UserConstant.DISENABLE)
+ .set(ProductService::getUpdateTime, LocalDateTime.now())
+ .set(ProductService::getUpdateBy, SecurityUtils.getUsername()));
+ return CommonResult.success();
+ }
+}
--
Gitblit v1.9.2