Selaa lähdekoodia

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

zhouyy 5 kuukautta sitten
vanhempi
commit
6834bac60c
19 muutettua tiedostoa jossa 436 lisäystä ja 42 poistoa
  1. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  2. 13 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/AlertTimeController.java
  3. 21 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanExtraInfoController.java
  4. 60 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanExtraInfo.java
  5. 16 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/PlanExtraInfoMapper.java
  6. 16 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanExtraInfoService.java
  7. 20 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanExtraInfoServiceImpl.java
  8. 10 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  9. 75 11
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java
  10. 19 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanExtraInfoMapper.xml
  11. 2 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml
  12. 151 0
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/java/com/firerock/webttkuaiban/demos/controller/ArticleTemplateNewController.java
  13. 6 2
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/js/iframe.js
  14. 6 6
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledge.ftl
  15. 5 5
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledgeDetails.ftl
  16. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/moduleView/header.html
  17. 7 7
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledge.ftl
  18. 6 5
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledgeDetails.ftl
  19. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/moduleView/header.html

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -1343,7 +1343,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     ct.setOutdoorTime(0.0);
                     if (isCrossDay) {
                         //直接用cardTime作为工作时长
-                        ct.setWorkHours(ct.getCardTime());
+                        ct.setWorkHours(DateTimeUtil.getHoursFromDouble(ct.getCardTime()));
                     }
                     //工作日或者非工作日有打卡,需要校正请假,外出的时长数据
                     else if (timeTypeService.isWorkDay(corpInfo.getCompanyId(), localDate, timeType) || sTime > 0 || eTime > 0) {

+ 13 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/AlertTimeController.java

@@ -1,9 +1,13 @@
 package com.management.platform.controller;
 
 
+import com.management.platform.task.TimingTask;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
 
 /**
  * <p>
@@ -17,5 +21,14 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/alert-time")
 public class AlertTimeController {
 
+    @Autowired
+    private TimingTask timingTask;
+
+    @RequestMapping("/test")
+    public HttpRespMsg test() throws Exception {
+        timingTask.getTemporaryJobApplicationNew();
+        return new HttpRespMsg();
+    }
+
 }
 

+ 21 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanExtraInfoController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-12-11
+ */
+@RestController
+@RequestMapping("/plan-extra-info")
+public class PlanExtraInfoController {
+
+}
+

+ 60 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanExtraInfo.java

@@ -0,0 +1,60 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class PlanExtraInfo extends Model<PlanExtraInfo> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 计划id
+     */
+    @TableField("plan_id")
+    private Integer planId;
+
+    /**
+     * 日报id
+     */
+    @TableField("report_id")
+    private Integer reportId;
+
+    /**
+     * 零件名称
+     */
+    @TableField("part_name")
+    private String partName;
+
+    /**
+     * 工序名称
+     */
+    @TableField("operation_name")
+    private String operationName;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/PlanExtraInfoMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.PlanExtraInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-12-11
+ */
+public interface PlanExtraInfoMapper extends BaseMapper<PlanExtraInfo> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanExtraInfoService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.PlanExtraInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-12-11
+ */
+public interface PlanExtraInfoService extends IService<PlanExtraInfo> {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanExtraInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.PlanExtraInfo;
+import com.management.platform.mapper.PlanExtraInfoMapper;
+import com.management.platform.service.PlanExtraInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-12-11
+ */
+@Service
+public class PlanExtraInfoServiceImpl extends ServiceImpl<PlanExtraInfoMapper, PlanExtraInfo> implements PlanExtraInfoService {
+
+}

+ 10 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -5036,12 +5036,20 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 item.add(map.get("taskChangeNoticeNum")==null?"":String.valueOf(map.get("taskChangeNoticeNum")));
             }
             if(planType==0){
-                item.add(map.get("procedureName")==null?"":String.valueOf(map.get("procedureName")));
+                if (map.get("operationName")!=null){
+                    item.add(String.valueOf(map.get("operationName")));
+                }else {
+                    item.add(map.get("procedureName") == null ? "" : String.valueOf(map.get("procedureName")));
+                }
             }else {
                 item.add("临时报工");
             }
             item.add(map.get("steelNumArray")==null?"":String.valueOf(map.get("steelNumArray")));
-            item.add(map.get("productName")==null?"":String.valueOf(map.get("productName")));
+            if (map.get("partName")!=null){
+                item.add(String.valueOf(map.get("partName")));
+            }else {
+                item.add(map.get("productName")==null?"":String.valueOf(map.get("productName")));
+            }
             item.add("");
 //            item.add(String.valueOf(map.get("progress"))+"%");
             item.add(String.valueOf(map.get("finishNum")));

+ 75 - 11
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java

@@ -108,6 +108,8 @@ public class TimingTask {
     private PlanService planService;
     @Resource
     private ReportService reportService;
+    @Resource
+    private PlanExtraInfoService extraInfoService;
 
     private static final List<Integer> VALID_TOKEN_CHARS = new ArrayList<>();
     static {
@@ -645,6 +647,11 @@ public class TimingTask {
                 }
                 //初始化工位
                 Integer deptId=0;
+                long startTime=0;
+                long endTime=0;
+                String steelNumArray="";
+                String operationName="";
+                String partName="";
                 for (int i1 = 0; i1 < contents.size(); i1++) {
                     JSONObject map = contents.getJSONObject(i1);
                     JSONArray title = map.getJSONArray("title");
@@ -671,12 +678,36 @@ public class TimingTask {
                             plan.setProjectName(text);
                         }
                     }
+                    if(title.getJSONObject(0).getString("text").contains("包名称")){
+                        if(control.equals("Text")||control.equals("Textarea")){
+                            String text = value.getString("text");
+                            plan.setProductSchedulingNum(text);
+                        }
+                    }
                     if(title.getJSONObject(0).getString("text").equals("生产订单号")){
                         if(control.equals("Text")||control.equals("Textarea")){
                             String text = value.getString("text");
                             plan.setProductOrderNum(text);
                         }
                     }
+                    if(title.getJSONObject(0).getString("text").equals("工序名称")){
+                        if(control.equals("Text")||control.equals("Textarea")){
+                            String text = value.getString("text");
+                            operationName=text;//工序名称
+                        }
+                    }
+                    if(title.getJSONObject(0).getString("text").equals("零件编码")){
+                        if(control.equals("Text")||control.equals("Textarea")){
+                            String text = value.getString("text");
+                            steelNumArray=text;//零件编码
+                        }
+                    }
+                    if(title.getJSONObject(0).getString("text").equals("零件名称")){
+                        if(control.equals("Text")||control.equals("Textarea")){
+                            String text = value.getString("text");
+                            partName=text;//零件名称
+                        }
+                    }
                     if(title.getJSONObject(0).getString("text").equals("生产数量")){
                         if(control.equals("Number")){
                             int new_number= value.get("new_number")!=null?value.getIntValue("new_number"):0;
@@ -737,8 +768,7 @@ public class TimingTask {
                         }
                     }
 
-                    long startTime=0;
-                    long endTime=0;
+
                     if(title.getJSONObject(0).getString("text").equals("作业开始日期")){
                         if(control.equals("Date")){
                             JSONObject date = value.getJSONObject("date");
@@ -750,19 +780,41 @@ public class TimingTask {
                     }
                     if(title.getJSONObject(0).getString("text").equals("作业结束日期")){
                         if(control.equals("Date")){
+                            long s_timestamp=0;
                             JSONObject date = value.getJSONObject("date");
-                            long s_timestamp = date.getLongValue("s_timestamp");
+                            if (!StringUtils.isEmpty(date.getString("s_timestamp"))){
+                                s_timestamp= date.getLongValue("s_timestamp");
+                                LocalDate localDateFromUnix = DateTimeUtil.getLocalDateFromUnix(s_timestamp);
+                                plan.setEndDate(localDateFromUnix);
+                            }
                             if (s_timestamp!=0){
                                 endTime=s_timestamp;
                             }
-                            LocalDate localDateFromUnix = DateTimeUtil.getLocalDateFromUnix(s_timestamp);
-                            plan.setEndDate(localDateFromUnix);
                         }
                     }
                     if (endTime>0){
                         long l = endTime - startTime;//工作时长
-                        workTime=l/60000.0;
-                        plan.setPlanWorkHour(workTime);//分钟
+                        workTime=l/3600.0;
+                        plan.setPlanWorkHour(workTime);//小时
+
+                        startTime=0;
+                        endTime=0;
+                    }
+                    if(title.getJSONObject(0).getString("text").equals("所属工位长")){
+                        if(control.equals("Contact")){
+                            JSONArray members = value.getJSONArray("members");
+                            String userid2 = members.getJSONObject(0).getString("userid");
+                            User user = userMapper.selectOne(new QueryWrapper<User>().eq("corpwx_real_userid", userid2));
+                            Department department = departmentService.getById(user.getDepartmentId());
+                            if (user != null) {
+                                plan.setForemanId(user.getId());
+                                plan.setForemanName(user.getName());
+                                if (department != null) {
+                                    plan.setStationId(department.getDepartmentId());
+                                    plan.setStationName(department.getDepartmentName());
+                                }
+                            }
+                        }
                     }
                     if(title.getJSONObject(0).getString("text").equals("备注")){
                         if(control.equals("Text")||control.equals("Textarea")){
@@ -773,6 +825,8 @@ public class TimingTask {
                 }
                 planService.save(plan);
                 List<Report> reportList=new ArrayList<>();
+                List<PlanExtraInfo> planExtraInfoList=new ArrayList<>();
+
                 //处理人员日报数据
                 for (String userTeam : userTeams) {
                     Optional<User> user = userList.stream().filter(u -> u.getCorpwxRealUserid() != null && u.getCorpwxRealUserid().equals(userTeam)).findFirst();
@@ -782,19 +836,29 @@ public class TimingTask {
                         report.setCreatorId(user.get().getId());
                         report.setCreateTime(LocalDateTime.now());
                         BigDecimal bigDecimal = new BigDecimal(workTime);
-                        bigDecimal=bigDecimal.divide(new BigDecimal(plan.getPlanManNum()==null?0:plan.getPlanManNum()),1,RoundingMode.HALF_UP);
                         report.setWorkingTime(bigDecimal.doubleValue());
-                        bigDecimal=bigDecimal.multiply(price);
-                        report.setCost(bigDecimal);
+                        report.setCost(plan.getSettlementAmount().divide(BigDecimal.valueOf(userTeams.size())).setScale(2, RoundingMode.HALF_UP));
                         report.setStatus(2);
                         report.setPlanId(plan.getId());
                         report.setCompanyId(7);
-                        report.setDeptId(deptId);
+                        report.setDeptId(user.get().getDepartmentId());
+                        report.setSteelNumArray(steelNumArray);
                         reportList.add(report);
                     }
                 }
                 if(reportList.size()>0){
                     reportService.saveBatch(reportList);
+                    for (Report report : reportList) {
+                        PlanExtraInfo planExtraInfo = new PlanExtraInfo();
+                        planExtraInfo.setPlanId(plan.getId());
+                        planExtraInfo.setReportId(report.getId());
+                        planExtraInfo.setOperationName(operationName);
+                        planExtraInfo.setPartName(partName);
+                        planExtraInfoList.add(planExtraInfo);
+                    }
+                    if(planExtraInfoList.size()>0){
+                        extraInfoService.saveBatch(planExtraInfoList);
+                    }
                 }
             }
         }

+ 19 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanExtraInfoMapper.xml

@@ -0,0 +1,19 @@
+<?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.management.platform.mapper.PlanExtraInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.PlanExtraInfo">
+        <id column="id" property="id" />
+        <result column="plan_id" property="planId" />
+        <result column="report_id" property="reportId" />
+        <result column="part_name" property="partName" />
+        <result column="operation_name" property="operationName" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, plan_id, report_id, part_name, operation_name
+    </sql>
+
+</mapper>

+ 2 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -574,9 +574,10 @@
     <select id="getReportList" resultType="java.util.Map">
         select p.project_name as projectName,p.product_order_num as productOrderNum, p.plan_type as planType,u.name as userName,u.job_number as jobNumber,d.department_id as departmentId,p.product_scheduling_num as productSchedulingNum,
         p.task_change_notice_num as taskChangeNoticeNum,r.steel_num_array as steelNumArray,r.working_time as workingTime,p.product_name as productName,r.finish_num as finishNum,
-        pp.name as procedureName,r.progress as progress,(CASE r.check_type WHEN 0 THEN '自检' WHEN 1 THEN '互检' ELSE '专检' END ) as checkType ,uu.name as checkerName,
+        pp.name as procedureName,r.progress as progress,(CASE r.check_type WHEN 0 THEN '自检' WHEN 1 THEN '互检' ELSE '专检' END ) as checkType ,uu.name as checkerName,pei.part_name partName,pei.operation_name operationName,
         date_format(r.create_date,'%Y-%m-%d') as createDate,date_format(r.create_time,'%Y-%m-%d %T') as reportTime,(CASE WHEN p.plan_type=0 THEN pp.unit_price ELSE p.money_of_job END) as unitPrice,r.cost  from report r
         left join plan p on p.id=r.plan_id
+        left join plan_extra_info pei on r.id=pei.report_id
         left join department d on d.department_id=p.station_id
         left join user u on r.creator_id=u.id
         left join prod_procedure pp on pp.id=r.prod_procedure_id

+ 151 - 0
fhKeeper/formulahousekeeper/webttkuaiban/src/main/java/com/firerock/webttkuaiban/demos/controller/ArticleTemplateNewController.java

@@ -0,0 +1,151 @@
+package com.firerock.webttkuaiban.demos.controller;
+
+import com.firerock.webttkuaiban.demos.pojo.Article;
+import com.firerock.webttkuaiban.demos.service.ArticleService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+
+@Controller
+public class ArticleTemplateNewController {
+
+    private static final Logger log = LoggerFactory.getLogger(ArticleTemplateNewController.class);
+    @Autowired
+    ArticleService articleService;
+
+    @GetMapping("/page-list-{pageIndex}.html")  // 这里的 PageBean 是事先定义好的实体类
+    public Object PageList(Model model, @PathVariable("pageIndex") Integer pageIndex, @RequestParam(required = false) String info) {
+        Integer pageSize = 10;
+        // 定义格式化器
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        List<Article> articleList = articleService.PageList(pageIndex, pageSize, info);
+        Integer total = articleService.getTotal(info);
+        if (!articleList.isEmpty()) {
+            for (Article article : articleList) {
+                byte[] imageData = article.getCoverImg();
+                if (imageData != null) {
+                    String base64Image = Base64.getEncoder().encodeToString(imageData);
+                    article.setBaseImage(base64Image);
+                } else {
+                    article.setBaseImage("");
+                }
+                article.setCreateTimeStr(article.getCreateTime().format(formatter));
+            }
+        }
+        model.addAttribute("knowledgeFieldTableList", articleList);
+        model.addAttribute("total", total);
+        return "knowledge";
+    }
+
+    @RequestMapping(value = "/articleList", method = RequestMethod.GET)
+    public String articleList(Model model) {
+        List<HashMap> articles = new ArrayList<>();
+        for (int i = 0; i < 10; i++) {
+            HashMap<String, String> article = new HashMap<>();
+            article.put("id", "" + (i + 1));
+            article.put("title", "Article Title " + i);
+            article.put("content", "Article Content " + i);
+            articles.add(article);
+        }
+        model.addAttribute("articles", articles);
+        return "articleList";
+    }
+
+    @GetMapping("/article-{id}.html")  // 这里的 PageBean 是事先定义好的实体类
+    public Object articleDetail(Model model, @PathVariable("id") Integer id) {
+        // 定义格式化器
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        long l = System.currentTimeMillis();
+        List<Article> latestList = articleService.latestList();
+        if (!latestList.isEmpty()) {
+            for (Article article : latestList) {
+                byte[] imageData = article.getCoverImg();
+                if (imageData != null) {
+                    String base64Image = Base64.getEncoder().encodeToString(imageData);
+                    article.setBaseImage(base64Image);
+                } else {
+                    article.setBaseImage("");
+                }
+                article.setCreateTimeStr(article.getCreateTime().format(formatter));
+            }
+        }
+        List<Article> relatedList = articleService.relatedList(id);
+        if (!relatedList.isEmpty()) {
+            for (Article article : relatedList) {
+                byte[] imageData = article.getCoverImg();
+                if (imageData != null) {
+                    String base64Image = Base64.getEncoder().encodeToString(imageData);
+                    article.setBaseImage(base64Image);
+                } else {
+                    article.setBaseImage("");
+                }
+                article.setCreateTimeStr(article.getCreateTime().format(formatter));
+            }
+        }
+        Article article = articleService.getArticleById(id);
+        article.setCreateTimeStr(article.getCreateTime().format(formatter));
+
+        articleService.updateViewCountById(id);
+
+        model.addAttribute("latestList", latestList);
+        model.addAttribute("relatedList", relatedList);
+        model.addAttribute("article", article);
+        model.addAttribute("categoryNameList", article.getCategoryNameList() == null ? new ArrayList<String>() : article.getCategoryNameList());
+        return "knowledgeDetails";
+    }
+
+
+    @GetMapping("/articleDetail")  // 这里的 PageBean 是事先定义好的实体类
+    public Object articleDetailById(Model model, @RequestParam Integer id) {
+        // 定义格式化器
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        long l = System.currentTimeMillis();
+        List<Article> latestList = articleService.latestList();
+        if (!latestList.isEmpty()) {
+            for (Article article : latestList) {
+                byte[] imageData = article.getCoverImg();
+                if (imageData != null) {
+                    String base64Image = Base64.getEncoder().encodeToString(imageData);
+                    article.setBaseImage(base64Image);
+                } else {
+                    article.setBaseImage("");
+                }
+                article.setCreateTimeStr(article.getCreateTime().format(formatter));
+            }
+        }
+        List<Article> relatedList = articleService.relatedList(id);
+        if (!relatedList.isEmpty()) {
+            for (Article article : relatedList) {
+                byte[] imageData = article.getCoverImg();
+                if (imageData != null) {
+                    String base64Image = Base64.getEncoder().encodeToString(imageData);
+                    article.setBaseImage(base64Image);
+                } else {
+                    article.setBaseImage("");
+                }
+                article.setCreateTimeStr(article.getCreateTime().format(formatter));
+            }
+        }
+        Article article = articleService.getArticleById(id);
+        article.setCreateTimeStr(article.getCreateTime().format(formatter));
+
+        articleService.updateViewCountById(id);
+
+        model.addAttribute("latestList", latestList);
+        model.addAttribute("relatedList", relatedList);
+        model.addAttribute("article", article);
+        model.addAttribute("categoryNameList", article.getCategoryNameList() == null ? new ArrayList<String>() : article.getCategoryNameList());
+        return "knowledgeDetails";
+    }
+}

+ 6 - 2
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/js/iframe.js

@@ -8,7 +8,8 @@ const backcolor = {
   dynamic: { background: 'none', color: '#000', logo: './image/logos.jpg' },
   customerNew: { background: '#fff', color: '#000', logo: './image/logos.jpg' },
   knowledgeField: { background: '#fff', color: '#000', logo: './image/logos.jpg' },
-  noLinkAvailable: { background: '#fff', color: '#000', logo: './image/logos.jpg' }
+  noLinkAvailable: { background: '#fff', color: '#000', logo: './image/logos.jpg' },
+  'pageList': { background: '#fff', color: '#000', logo: './image/logos.jpg' }
 }
 
 function removeListener() {
@@ -36,7 +37,10 @@ function handleScroll() {
   let headerItems = iframeDocument.querySelectorAll('.header-item')
   let headerView = iframeDocument.querySelector('.headerView')
   const urls = window.location.href
-  const filed = urls.match(/\/([^\/]+)\.html$/) && urls.match(/\/([^\/]+)\.html$/)[1] || 'noLinkAvailable';
+  let filed = urls.match(/\/([^\/]+)\.html$/) && urls.match(/\/([^\/]+)\.html$/)[1] || 'noLinkAvailable';
+  if(filed.indexOf('page-list') > -1) {
+    filed = 'pageList'
+  }
   console.log(filed, '<==== filed')
   if(scrollYnma > 1) {
     headerView.style.background = '#fff'

+ 6 - 6
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledge.ftl

@@ -46,7 +46,7 @@
             <div>
               <!-- <div class="knowledgeField-content-item" onclick="triggerButtonClick(${item.id})"> -->
               <div class="knowledgeField-content-item">
-              <a href="/articleTemplate/articleDetail/${item.id}.html">
+              <a href="/article-${item.id}.html">
                 <div class="image"><img src="${item.coverImgUrl}" class="wh100" class="wh100"></img>
                   </div>
                   <div class="textContent">
@@ -58,7 +58,7 @@
                         ${item.viewCount}
                       </div>
                       <!-- <button class="linkButtonss" onclick="learnMore(${item.id})">了解详情></button> -->
-                      <a class="linkButtonss" href="/articleTemplate/articleDetail/${item.id}.html">查看详情></a>
+                      <a class="linkButtonss" href="/article-${item.id}.html">查看详情></a>
                     </div>
                   </div>
               </a>
@@ -114,11 +114,11 @@
   let currentPage = pageIndex; // 当前页
   const knowledgeUrl = '/articleTemplate/pageList'
   const knowledgeDetails = '/articleTemplate/articleDetail'
-  const fixedParameters = '/' + currentPage
+  const fixedParameters = '/page-list-' + currentPage
 
   function search() {
     const inputVal = document.getElementById("knowledgeInput").value;
-    window.location.href = knowledgeUrl + fixedParameters + '?&info=' + inputVal
+    window.location.href = fixedParameters + '?&info=' + inputVal
   }
   function learnMore(id) {
     window.location.href = knowledgeDetails + `/` + id
@@ -141,7 +141,7 @@
     if(!inputVal) {
       return
     }
-    window.location.href = knowledgeUrl + '/' + inputVal
+    window.location.href ='/page-list-' + inputVal
   }
 
   // 初始化分页组件
@@ -164,7 +164,7 @@
 
   // 跳转到指定页面
   function goToPage(page) {
-    window.location.href = knowledgeUrl + '/' + page
+    window.location.href = '/page-list-' + page
   }
 
   // 初始化分页

+ 5 - 5
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledgeDetails.ftl

@@ -86,12 +86,12 @@
         <div class="latestArticles">
           <div class="knowledgeDetails-right-title">
             <div>最新文章</div>
-            <a href="/articleTemplate/pageList/1" class="linkButton">查看更多></a>
+            <a href="/page-list-${1}" class="linkButton">查看更多></a>
           </div>
           <div class="line"></div>
           <div class="latestList">
             <#list latestList as item>
-              <a href="/articleTemplate/articleDetail/${item.id}.html">
+              <a href="/article-${item.id}.html">
                 <div class="latestList-item" data-item='${item.id}'>
                   <div class="latestList-item-image">
                     <img src="${item.coverImgUrl}" class="wh100"></img>
@@ -108,12 +108,12 @@
         <div class="relatedRecommendations">
           <div class="knowledgeDetails-right-title">
             <div>相关推荐</div>
-            <a href="/articleTemplate/pageList/1" class="linkButton">查看更多></a>
+            <a href="/page-list-${1}" class="linkButton">查看更多></a>
           </div>
           <div class="line"></div>
           <div class="latestList">
             <#list relatedList as item>
-              <a href="/articleTemplate/articleDetail/${item.id}.html">
+              <a href="/article-${item.id}.html">
                 <div class="latestList-item" data-item='${item.id}'>
                   <div class="latestList-item-image">
                     <img src="${item.coverImgUrl}" class="wh100"></img>
@@ -197,7 +197,7 @@
   
   const knowledgeDetails = '/articleTemplate/articleDetail'
   function toKnowledge() {
-    window.location.href = `/articleTemplate/pageList/1`
+    window.location.href = `/page-list-${1}`
   }
   
   $('#returnIcon').click(function () {

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/moduleView/header.html

@@ -68,7 +68,7 @@
             { label: '产品定价', value: '../index.html#pricing', class: 'header-item' },
             { label: '关于我们', value: '../about.html', class: 'header-item' },
             { label: '企业动态', value: '../dynamic.html', class: 'header-item' },
-            { label: '知识园地', value: '/articleTemplate/pageList/1.html', class: 'header-item' },
+            { label: '知识园地', value: '/page-list-1.html', class: 'header-item' },
           ],
           otherList: [
             { label: '工时管家', path: '../index.html', icon: './image/icon/workHour.png', hoverIcon: './image/icon/workHourHover.png' },

+ 7 - 7
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledge.ftl

@@ -46,7 +46,7 @@
             <div>
               <!-- <div class="knowledgeField-content-item" onclick="triggerButtonClick(${item.id})"> -->
               <div class="knowledgeField-content-item">
-              <a href="/articleTemplate/articleDetail/${item.id}.html">
+              <a href="/article-${item.id}.html">
                 <div class="image"><img src="${item.coverImgUrl}" class="wh100" class="wh100"></img>
                   </div>
                   <div class="textContent">
@@ -58,7 +58,7 @@
                         ${item.viewCount}
                       </div>
                       <!-- <button class="linkButtonss" onclick="learnMore(${item.id})">了解详情></button> -->
-                      <a class="linkButtonss" href="/articleTemplate/articleDetail/${item.id}.html">查看详情></a>
+                      <a class="linkButtonss" href="/article-${item.id}.html">查看详情></a>
                     </div>
                   </div>
               </a>
@@ -114,14 +114,14 @@
   let currentPage = pageIndex; // 当前页
   const knowledgeUrl = '/articleTemplate/pageList'
   const knowledgeDetails = '/articleTemplate/articleDetail'
-  const fixedParameters = '/' + currentPage
+  const fixedParameters = '/page-list-' + currentPage
 
   function search() {
     const inputVal = document.getElementById("knowledgeInput").value;
-    window.location.href = knowledgeUrl + fixedParameters + '.html?&info=' + inputVal
+    window.location.href = fixedParameters + '.html?&info=' + inputVal
   }
   function learnMore(id) {
-    window.location.href = knowledgeDetails + `/` + id + '.html';
+    window.location.href = `/article-` + id + '.html';
   }
   function triggerButtonClick(itemId) {
     // 找到该 item 对应的按钮并触发点击事件
@@ -141,7 +141,7 @@
     if(!inputVal) {
       return
     }
-    window.location.href = knowledgeUrl + '/' + inputVal + '.html';
+    window.location.href = '/page-list-' + inputVal + '.html';
   }
 
   // 初始化分页组件
@@ -164,7 +164,7 @@
 
   // 跳转到指定页面
   function goToPage(page) {
-    window.location.href = knowledgeUrl + '/' + page + '.html';
+    window.location.href = '/page-list-' + page + '.html';
   }
 
   // 初始化分页

+ 6 - 5
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledgeDetails.ftl

@@ -86,12 +86,12 @@
         <div class="latestArticles">
           <div class="knowledgeDetails-right-title">
             <div>最新文章</div>
-            <a href="/articleTemplate/pageList/1.html" class="linkButton">查看更多></a>
+            <a href="/page-list-${1}.html" class="linkButton">查看更多></a>
           </div>
           <div class="line"></div>
           <div class="latestList">
             <#list latestList as item>
-              <a href="/articleTemplate/articleDetail/${item.id}.html">
+              <a href="/article-${item.id}.html">
                 <div class="latestList-item" data-item='${item.id}'>
                   <div class="latestList-item-image">
                     <img src="${item.coverImgUrl}" class="wh100"></img>
@@ -108,12 +108,13 @@
         <div class="relatedRecommendations">
           <div class="knowledgeDetails-right-title">
             <div>相关推荐</div>
-            <a href="/articleTemplate/pageList/1.html" class="linkButton">查看更多></a>
+
+            <a href="/page-list-${1}.html" class="linkButton">查看更多></a>
           </div>
           <div class="line"></div>
           <div class="latestList">
             <#list relatedList as item>
-              <a href="/articleTemplate/articleDetail/${item.id}.html">
+              <a href="/article-${item.id}.html">
                 <div class="latestList-item" data-item='${item.id}'>
                   <div class="latestList-item-image">
                     <img src="${item.coverImgUrl}" class="wh100"></img>
@@ -197,7 +198,7 @@
   
   const knowledgeDetails = '/articleTemplate/articleDetail'
   function toKnowledge() {
-    window.location.href = `/articleTemplate/pageList/1.html`
+    window.location.href = `/page-list-${1}.html`
   }
   
   $('#returnIcon').click(function () {

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/moduleView/header.html

@@ -68,7 +68,7 @@
             { label: '产品定价', value: '../index.html#pricing', class: 'header-item' },
             { label: '关于我们', value: '../about.html', class: 'header-item' },
             { label: '企业动态', value: '../dynamic.html', class: 'header-item' },
-            { label: '知识园地', value: '/articleTemplate/pageList/1.html', class: 'header-item' },
+            { label: '知识园地', value: '/page-list-1.html', class: 'header-item' },
           ],
           otherList: [
             { label: '工时管家', path: '../index.html', icon: './image/icon/workHour.png', hoverIcon: './image/icon/workHourHover.png' },