From 3d400cfcc41df9bc35678751f6f5afb5cf6c1ae5 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期三, 03 十二月 2025 14:52:54 +0800
Subject: [PATCH] 产品服务实现过程
---
/dev/null | 20 ----
multi-system/src/main/java/com/gkhy/exam/system/domain/ProductService.java | 60 ++++++++++++
multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java | 29 +++++
multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/ProductServiceController.java | 60 ++++++++++++
multi-system/src/main/java/com/gkhy/exam/system/service/ProductServiceService.java | 25 +++++
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ProductServiceServiceImpl.java | 68 +++++++++++++
multi-system/src/main/resources/mapper/system/ProductServiceMapper.xml | 13 ++
multi-system/src/main/java/com/gkhy/exam/system/mapper/ProductServiceMapper.java | 22 ++++
8 files changed, 273 insertions(+), 24 deletions(-)
diff --git a/multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/ProductServiceController.java b/multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/ProductServiceController.java
new file mode 100644
index 0000000..6b44a03
--- /dev/null
+++ b/multi-admin/src/main/java/com/gkhy/exam/admin/controller/web/ProductServiceController.java
@@ -0,0 +1,60 @@
+package com.gkhy.exam.admin.controller.web;
+
+
+import com.gkhy.exam.common.annotation.RepeatSubmit;
+import com.gkhy.exam.common.api.CommonResult;
+import com.gkhy.exam.system.domain.ProductService;
+import com.gkhy.exam.system.service.ProductServiceService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 产品服务实现过程 前端控制器
+ * </p>
+ *
+ * @author hh
+ * @since 2025-12-02 16:59:08
+ */
+@Api(tags = "产品服务实现过程")
+@RestController
+@RequestMapping("/system/productService")
+public class ProductServiceController {
+
+ @Autowired
+ private ProductServiceService productServiceService;
+
+ @ApiOperation(value = "产品服务实现过程列表(分页)")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
+ @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
+ @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id"),
+ @ApiImplicitParam(paramType = "query", name = "year", dataType = "String", required = false, value = "年份"),
+
+ })
+ @GetMapping("/selectProductServiceList")
+ public CommonResult selectProductServiceList(ProductService service){
+ return CommonResult.success(productServiceService.selectProductServiceList(service));
+ }
+ @RepeatSubmit
+ @ApiOperation(value = "新增编辑产品服务实现过程")
+ @PostMapping("/saveProductService")
+ public CommonResult saveProductService(@RequestBody @Validated ProductService service){
+ return productServiceService.saveProductService(service);
+ }
+
+ @ApiOperation(value = "删除产品服务实现过程")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", name = "id", dataType = "int", required = true, value = "id"),
+ })
+ @GetMapping("/delProductService")
+ public CommonResult delProductService(@RequestParam Long id){
+ return productServiceService.delProductService(id);
+ }
+
+}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/controller/MaterialController.java b/multi-system/src/main/java/com/gkhy/exam/system/controller/MaterialController.java
deleted file mode 100644
index a56c813..0000000
--- a/multi-system/src/main/java/com/gkhy/exam/system/controller/MaterialController.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.gkhy.exam.system.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author hh
- * @since 2025-10-11 14:20:49
- */
-@RestController
-@RequestMapping("/system/material")
-public class MaterialController {
-
-}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/domain/ProductService.java b/multi-system/src/main/java/com/gkhy/exam/system/domain/ProductService.java
new file mode 100644
index 0000000..590b164
--- /dev/null
+++ b/multi-system/src/main/java/com/gkhy/exam/system/domain/ProductService.java
@@ -0,0 +1,60 @@
+package com.gkhy.exam.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * <p>
+ * 产品服务实现过程
+ * </p>
+ *
+ * @author hh
+ * @since 2025-12-02 16:59:08
+ */
+@Getter
+@Setter
+@TableName("product_service")
+@ApiModel(value = "ProductService对象", description = "产品服务实现过程")
+public class ProductService implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId("id")
+ private Long id;
+
+ @ApiModelProperty("企业id")
+ @TableField("company_id")
+ @NotNull(message = "companyId不能为空")
+ private Integer companyId;
+
+ @TableField("file_url")
+ @NotNull(message = "图片不能为空")
+ @ApiModelProperty("文件路径")
+ private String fileUrl;
+
+ @TableField("del_flag")
+ private Integer delFlag;
+
+ @TableField("create_by")
+ private String createBy;
+
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ @TableField("update_by")
+ private String updateBy;
+
+ @TableField("update_time")
+ private LocalDateTime updateTime;
+
+
+}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/mapper/ProductServiceMapper.java b/multi-system/src/main/java/com/gkhy/exam/system/mapper/ProductServiceMapper.java
new file mode 100644
index 0000000..e9112e7
--- /dev/null
+++ b/multi-system/src/main/java/com/gkhy/exam/system/mapper/ProductServiceMapper.java
@@ -0,0 +1,22 @@
+package com.gkhy.exam.system.mapper;
+
+import com.gkhy.exam.system.domain.ProductService;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 产品服务实现过程 Mapper 接口
+ * </p>
+ *
+ * @author hh
+ * @since 2025-12-02 16:59:08
+ */
+@Mapper
+public interface ProductServiceMapper extends BaseMapper<ProductService> {
+
+ List<ProductService> selectProductServiceList(ProductService productService);
+
+}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/ProductServiceService.java b/multi-system/src/main/java/com/gkhy/exam/system/service/ProductServiceService.java
new file mode 100644
index 0000000..86de6cd
--- /dev/null
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/ProductServiceService.java
@@ -0,0 +1,25 @@
+package com.gkhy.exam.system.service;
+
+import com.gkhy.exam.common.api.CommonPage;
+import com.gkhy.exam.common.api.CommonResult;
+import com.gkhy.exam.system.domain.ProductService;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 产品服务实现过程 服务类
+ * </p>
+ *
+ * @author hh
+ * @since 2025-12-02 16:59:08
+ */
+public interface ProductServiceService extends IService<ProductService> {
+
+
+ CommonPage selectProductServiceList(ProductService productService);
+
+ CommonResult saveProductService(ProductService productService);
+
+ CommonResult delProductService(Long id);
+
+}
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();
+ }
+}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java
index 809322f..afcf9fb 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/StandardizedTemplateServiceImpl.java
@@ -1,5 +1,6 @@
package com.gkhy.exam.system.service.impl;
+import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -19,10 +20,8 @@
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
@Service
public class StandardizedTemplateServiceImpl extends ServiceImpl<StandardizedTemplateMapper, StandardizedTemplate> implements StandardizedTemplateService {
@@ -48,6 +47,9 @@
@Autowired
private CustomerService customerService;
+
+ @Autowired
+ private ProductServiceMapper productServiceMapper;
@Override
public CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate) {
boolean admin = SecurityUtils.adminUser();
@@ -214,6 +216,25 @@
map.put("sysFunctionalDistributions", sysFunctionalDistributions);
//程序文件
map.put("companyIndustryTemplates", companyIndustryTemplates);
+ //产品和服务实现过程
+
+ LambdaQueryWrapper<ProductService> lambdaQueryWrapper = Wrappers.<ProductService>lambdaQuery()
+ .eq(ProductService::getCompanyId, companyId)
+ .eq(ProductService::getDelFlag, 0);
+ List<ProductService> productServices = productServiceMapper.selectList(lambdaQueryWrapper);
+ if (ObjectUtil.isNotEmpty(productServices)){
+ List<String> fileUrls = productServices.stream().map(ProductService::getFileUrl).collect(Collectors.toList());
+ List< String> fileUrlsData = fileUrls.stream().map(fileUrl -> {
+ List<String> collect = Arrays.stream(fileUrl.split(",")).collect(Collectors.toList());
+ return collect;
+ }).flatMap(Collection::stream).collect(Collectors.toList());
+// for (String fileUrl : fileUrls) {
+// List<String> collect = Arrays.stream(fileUrl.split(",")).collect(Collectors.toList());
+// }
+ map.put("productServiceDatas", fileUrlsData);
+ }else {
+ map.put("productServiceDatas", new ArrayList<>());
+ }
return CommonResult.success(map);
}
}
diff --git a/multi-system/src/main/resources/mapper/system/ProductServiceMapper.xml b/multi-system/src/main/resources/mapper/system/ProductServiceMapper.xml
new file mode 100644
index 0000000..d2a2d1a
--- /dev/null
+++ b/multi-system/src/main/resources/mapper/system/ProductServiceMapper.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gkhy.exam.system.mapper.ProductServiceMapper">
+
+ <select id="selectProductServiceList" resultType="com.gkhy.exam.system.domain.ProductService" parameterType="com.gkhy.exam.system.domain.ProductService">
+
+ select * from product_service where del_flag = 0
+ <if test="companyId != null">
+ and company_id = #{companyId}
+ </if>
+ order by create_time desc
+ </select>
+</mapper>
--
Gitblit v1.9.2