diff --git a/pom.xml b/pom.xml
index 13a6a9e..9d0f048 100644
--- a/pom.xml
+++ b/pom.xml
@@ -244,14 +244,19 @@
-
-
-
-
-
+
+ com.hankcs
+ hanlp
+ portable-1.8.4
+
+
+ com.squareup.okhttp3
+ okhttp
+ 4.9.3
+
diff --git a/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java b/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java
new file mode 100644
index 0000000..2213df2
--- /dev/null
+++ b/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java
@@ -0,0 +1,175 @@
+package com.sztzjy.linkCommerce.controller.stu;
+
+import cn.hutool.core.util.IdUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.fastjson.JSONObject;
+import com.nimbusds.jose.shaded.gson.Gson;
+import com.sztzjy.linkCommerce.annotation.AnonymousAccess;
+import com.sztzjy.linkCommerce.entity.*;
+import com.sztzjy.linkCommerce.entity.dto.MonthlyCakeIndex;
+import com.sztzjy.linkCommerce.entity.dto.StuIndustryAnalysisDTO;
+import com.sztzjy.linkCommerce.entity.dto.YearCakeIndexDto;
+import com.sztzjy.linkCommerce.mapper.HyxqfxAnswerMapper;
+import com.sztzjy.linkCommerce.mapper.HyxqfxDataMapper;
+import com.sztzjy.linkCommerce.mapper.HyxqfxStuAnswerMapper;
+import com.sztzjy.linkCommerce.service.IndustryDemandAnalysisService;
+import com.sztzjy.linkCommerce.util.ResultEntity;
+import com.sztzjy.linkCommerce.util.excel.DataListener;
+import com.sztzjy.linkCommerce.util.excel.DemoDataListener;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * @author 17803
+ * @date 2025-04-24 13:30
+ */
+@Api(tags = "行业需求分析")
+@RestController
+@RequestMapping("api/industryAnalysis")
+public class IndustryDemandAnalysisController {
+
+
+ @Autowired
+ private IndustryDemandAnalysisService service;
+
+ @Autowired
+ private HyxqfxDataMapper hyxqfxDataMapper;
+
+ @Autowired
+ private HyxqfxStuAnswerMapper hyxqfxStuAnswerMapper;
+
+
+
+
+ //数据查询
+ @ApiOperation("行业需求分析提交")
+ @PostMapping("/analysisSubmit")
+ @AnonymousAccess
+ @Transactional(rollbackFor = Exception.class)
+ public ResultEntity uploadExcel(@RequestBody StuIndustryAnalysisDTO analysisDTO) {
+
+ //查询数据
+ HyxqfxStuAnswerExample example = new HyxqfxStuAnswerExample();
+ example.createCriteria().andUserIdEqualTo(analysisDTO.getUserId());
+
+ List hyxqfxStuAnswerList = hyxqfxStuAnswerMapper.selectByExample(example);
+ if (!CollectionUtils.isEmpty(hyxqfxStuAnswerList)) {
+ return new ResultEntity<>(HttpStatus.OK);
+ }
+
+ //读取文件内容 批量导入excel中 以文件名区分\
+
+ Map yearMap = new HashMap<>();
+ yearMap.put("2018年",0.28);
+ yearMap.put("2019年",0.25);
+ yearMap.put("2020年",0.24);
+ yearMap.put("2021年",0.22);
+ yearMap.put("2022年",0.21);
+ yearMap.put("2023年",0.22);
+ yearMap.put("2024年",0.20);
+
+ Map monthMap = new HashMap<>();
+ monthMap.put("2024年4月",0.21);
+ monthMap.put("2024年5月",0.20);
+ monthMap.put("2024年6月",0.20);
+ monthMap.put("2024年7月",0.22);
+ monthMap.put("2024年8月",0.33);
+ monthMap.put("2024年9月",0.30);
+ monthMap.put("2024年10月",0.33);
+
+ monthMap.put("2024年11月",0.23);
+ monthMap.put("2024年12月",0.22);
+ monthMap.put("2025年1月",0.22);
+ monthMap.put("2025年2月",0.15);
+ monthMap.put("2025年3月",0.27);
+
+ int count = 0;
+
+ List yearCakeIndexDtoList = analysisDTO.getYearCakeIndexDtoList();
+
+ for (YearCakeIndexDto yearCakeIndexDto : yearCakeIndexDtoList) {
+ Double v = yearMap.get(yearCakeIndexDto.getYear());
+ if (yearCakeIndexDto.getYearAnswer() == null || v != yearCakeIndexDto.getYearAnswer()) {
+ count ++;
+ }
+ }
+
+ //分别将两个字段转为json格式
+ List monthlyCakeIndexList = analysisDTO.getMonthlyCakeIndexList();
+
+ for (MonthlyCakeIndex yearCakeIndexDto : monthlyCakeIndexList) {
+ Double v = monthMap.get(yearCakeIndexDto.getYear());
+ if (yearCakeIndexDto.getMonthAnswer() == null || v != yearCakeIndexDto.getMonthAnswer()) {
+ count ++;
+ }
+ }
+
+
+ String jsonString = JSONObject.toJSONString(analysisDTO);
+ HyxqfxStuAnswer hyxqfxStuAnswer = new HyxqfxStuAnswer();
+ hyxqfxStuAnswer.setId(IdUtil.randomUUID());
+ hyxqfxStuAnswer.setUserId(analysisDTO.getUserId());
+ hyxqfxStuAnswer.setAnswer(jsonString);
+ hyxqfxStuAnswer.setErrorNumber(count);
+
+ hyxqfxStuAnswerMapper.insertSelective(hyxqfxStuAnswer);
+
+ //插入主观题
+ SubjectiveQuestions subjectiveQuestions = new SubjectiveQuestions();
+ subjectiveQuestions.setId(IdUtil.randomUUID());
+ subjectiveQuestions.setUserId(analysisDTO.getUserId());
+ subjectiveQuestions.setModule("行业需求分析");
+ subjectiveQuestions.setProject("市场需求挖掘");
+ subjectiveQuestions.setCreateTime(new Date());
+ subjectiveQuestions.setSubjectiveContent(analysisDTO.getContext());
+ subjectiveQuestions.setSubjectiveContent(analysisDTO.getContext());
+
+ return new ResultEntity<>(HttpStatus.OK, "上传成功");
+
+ }
+
+ @ApiOperation("行业需求分析根据用户ID查询")
+ @GetMapping("/selectByUserId")
+ @AnonymousAccess
+ public ResultEntity selectByUserId(@ApiParam("用户ID") String userId) {
+ //读取文件内容 批量导入excel中 以文件名区分\
+
+ HyxqfxStuAnswerExample hyxqfxStuAnswer = new HyxqfxStuAnswerExample();
+ hyxqfxStuAnswer.createCriteria().andUserIdEqualTo(userId);
+
+ List hyxqfxStuAnswersList = hyxqfxStuAnswerMapper.selectByExampleWithBLOBs(hyxqfxStuAnswer);
+ if (CollectionUtils.isEmpty(hyxqfxStuAnswersList)) {
+ return new ResultEntity<>(HttpStatus.OK);
+ }else {
+ JSONObject jsonObject = JSONObject.parseObject(hyxqfxStuAnswersList.get(0).getAnswer());
+ return new ResultEntity<>(HttpStatus.OK,jsonObject);
+ }
+
+ }
+
+
+ public void jiaoYanCodeSize(String code){
+ String[] strings = code.split(",");
+ if (strings.length>=20)
+ {
+ //计分规则
+
+
+ }
+
+ }
+
+
+
+}
diff --git a/src/main/java/com/sztzjy/linkCommerce/controller/stu/StuDigitalMarketingModelController.java b/src/main/java/com/sztzjy/linkCommerce/controller/stu/StuDigitalMarketingModelController.java
new file mode 100644
index 0000000..3b871e3
--- /dev/null
+++ b/src/main/java/com/sztzjy/linkCommerce/controller/stu/StuDigitalMarketingModelController.java
@@ -0,0 +1,317 @@
+package com.sztzjy.linkCommerce.controller.stu;
+
+import com.sztzjy.linkCommerce.annotation.AnonymousAccess;
+import com.sztzjy.linkCommerce.entity.*;
+import com.sztzjy.linkCommerce.entity.dto.*;
+import com.sztzjy.linkCommerce.mapper.StuUserCommentMapper;
+import com.sztzjy.linkCommerce.service.StuDigitalMarketingModelService;
+import com.sztzjy.linkCommerce.util.BigDecimalUtils;
+import com.sztzjy.linkCommerce.util.ResultEntity;
+import com.sztzjy.linkCommerce.util.algorithm.Apriori;
+import com.sztzjy.linkCommerce.util.algorithm.KMeans;
+import com.sztzjy.linkCommerce.util.algorithm.LogisticRegression;
+import com.sztzjy.linkCommerce.util.excel.ImportExcelUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.*;
+
+import static com.sztzjy.linkCommerce.util.algorithm.KMeans.*;
+import static com.sztzjy.linkCommerce.util.algorithm.KMeansResult.*;
+
+/**
+ * @author tz
+ * @date 2024/6/13 10:43
+ */
+@Api(tags = "数字营销模型")
+@RequestMapping("api/model")
+@RestController
+public class StuDigitalMarketingModelController {
+
+ @Value("${file.path}")
+ private String filePath;
+
+ @Resource
+ StuDigitalMarketingModelService modelService;
+ @Resource
+ StuUserCommentMapper stuUserCommentMapper;
+
+ @ApiOperation("选择指标--下拉框")
+ @PostMapping("/dropdownBox")
+ @AnonymousAccess
+ public ResultEntity dropdownBox(String userId) {
+ List list=modelService.dropdownBox(userId);
+ return new ResultEntity(HttpStatus.OK,"成功",list);
+ }
+
+ @ApiOperation("选择指标--查看指标")
+ @PostMapping("/viewMetrics")
+ @AnonymousAccess
+ public ResultEntity viewMetrics(@ApiParam("用户ID") String userId,
+ @ApiParam("表格名") String tableName,
+ @ApiParam("算法名称") String algorithmName) {
+ List list=modelService.viewMetrics(userId,tableName,algorithmName);
+ return new ResultEntity(HttpStatus.OK,"成功",list);
+ }
+
+
+ @ApiOperation("选择指标--分析数据展示")
+ @PostMapping("/viewAnalyzeData")
+ @AnonymousAccess
+ public ResultEntity viewAnalyzeData(@RequestBody AnalyzeDataDTO analyzeDataDTO) {
+
+ return modelService.viewAnalyzeData(analyzeDataDTO);
+ }
+
+ @ApiOperation("数据预处理")
+ @PostMapping("/dataPreprocessing")
+ @AnonymousAccess
+ public ResultEntity dataPreprocessing(@RequestBody DataPreprocessingDTO dto) {
+
+ String userId = dto.getUserId();
+ String method = dto.getMethod();
+ List