浏览代码

质量月报 - 评价查询、新增、修改、word下载

wangggziwen 2 年之前
父节点
当前提交
a601baffbe

+ 122 - 0
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyQualityCommentController.java

@@ -0,0 +1,122 @@
+package com.ruoyi.project.production.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.production.domain.TMonthlyQualityComment;
+import com.ruoyi.project.production.service.ITMonthlyQualityCommentService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 质量月报评价Controller
+ *
+ * @author ssy
+ * @date 2023-12-14
+ */
+@RestController
+@RequestMapping("/production/comment")
+public class TMonthlyQualityCommentController extends BaseController
+{
+    @Autowired
+    private ITMonthlyQualityCommentService tMonthlyQualityCommentService;
+
+    /**
+     * 提交质量月报评价
+     */
+    @PutMapping("/submitComment")
+    public AjaxResult submitComment(@RequestBody TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        TMonthlyQualityComment result = tMonthlyQualityCommentService.selectTMonthlyQualityCommentByTypeAndDate(tMonthlyQualityComment);
+        if (result != null) {
+            result.setQualityComment(tMonthlyQualityComment.getQualityComment());
+            tMonthlyQualityCommentService.updateTMonthlyQualityComment(result);
+        } else {
+            tMonthlyQualityCommentService.insertTMonthlyQualityComment(tMonthlyQualityComment);
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 获取质量月报评价详细信息
+     */
+    @GetMapping("/getComment")
+    public AjaxResult getComment(TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        return AjaxResult.success(tMonthlyQualityCommentService.selectTMonthlyQualityCommentByTypeAndDate(tMonthlyQualityComment));
+    }
+
+    /**
+     * 查询质量月报评价列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        startPage();
+        List<TMonthlyQualityComment> list = tMonthlyQualityCommentService.selectTMonthlyQualityCommentList(tMonthlyQualityComment);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出质量月报评价列表
+     */
+    @Log(title = "质量月报评价", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        List<TMonthlyQualityComment> list = tMonthlyQualityCommentService.selectTMonthlyQualityCommentList(tMonthlyQualityComment);
+        ExcelUtil<TMonthlyQualityComment> util = new ExcelUtil<TMonthlyQualityComment>(TMonthlyQualityComment.class);
+        return util.exportExcel(list, "comment");
+    }
+
+    /**
+     * 获取质量月报评价详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tMonthlyQualityCommentService.selectTMonthlyQualityCommentById(id));
+    }
+
+    /**
+     * 新增质量月报评价
+     */
+    @Log(title = "质量月报评价", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        return toAjax(tMonthlyQualityCommentService.insertTMonthlyQualityComment(tMonthlyQualityComment));
+    }
+
+    /**
+     * 修改质量月报评价
+     */
+    @Log(title = "质量月报评价", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        return toAjax(tMonthlyQualityCommentService.updateTMonthlyQualityComment(tMonthlyQualityComment));
+    }
+
+    /**
+     * 删除质量月报评价
+     */
+    @Log(title = "质量月报评价", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tMonthlyQualityCommentService.deleteTMonthlyQualityCommentByIds(ids));
+    }
+}

+ 22 - 29
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyQualityReportController.java

@@ -113,6 +113,9 @@ public class TMonthlyQualityReportController extends BaseController
     @Autowired
     private ITMonthlyQualityReportZ404Service tMonthlyQualityReportZ404Service;
 
+    @Autowired
+    private ITMonthlyQualityCommentService tMonthlyQualityCommentService;
+
     /**
      * 碳二反应器性能指标趋势图
      */
@@ -2478,30 +2481,14 @@ public class TMonthlyQualityReportController extends BaseController
         for (int i = 0; i < 15; i++) {
             // 创建一个段落
             XWPFParagraph paragraph = document.createParagraph();
+            // 左对齐
+            paragraph.setAlignment(ParagraphAlignment.LEFT);
             XWPFRun run = paragraph.createRun();
             // base64解码
             byte[] decode = Base64.getDecoder().decode(base64Image[i]);
             // 在段落中添加图片
             run.addPicture(new ByteArrayInputStream(decode), XWPFDocument.PICTURE_TYPE_PNG, "chart"+ (i + 1) +".png", Units.toEMU(400), Units.toEMU(200));
-            if (i == 0) {
-
-            } else if (i == 1) {
-
-            } else if (i == 2) {
-
-            } else if (i == 3) {
-
-            } else if (i == 4) {
-
-            } else if (i == 5) {
-
-            } else if (i == 6) {
-
-            } else if (i == 7) {
-
-            } else if (i == 8) {
-
-            } else if (i == 9) {
+            if (i == 9) {
                 // 创建一个新的表格
                 XWPFTable table = document.createTable();
 
@@ -2649,17 +2636,11 @@ public class TMonthlyQualityReportController extends BaseController
                 dataRow7.getCell(0).setText("Propylene Selectivity");
                 dataRow7.getCell(1).setText(c3ReactorTableVO.getPropyleneSelectivity().toString() + "%");
                 dataRow7.getCell(2).setText("");
-            } else if (i == 11) {
-
-            } else if (i == 12) {
-
-            } else if (i == 13) {
-
-            } else if (i == 14) {
-
             }
-            // 换行
-//            run.addBreak();
+            run.addCarriageReturn();
+            String comment = this.getComment(Long.valueOf(i + 1), startDate, endDate);
+            run.setText(comment);
+            run.addCarriageReturn();
         }
         // 保存文档
         String fileName = UUID.randomUUID().toString() + "_" + "质量月报.docx";
@@ -2674,4 +2655,16 @@ public class TMonthlyQualityReportController extends BaseController
         out.close();
         return AjaxResult.success(fileName);
     }
+    private String getComment(Long CommentType, Date startDate, Date endDate) {
+        TMonthlyQualityComment comment = new TMonthlyQualityComment();
+        comment.setStartDate(startDate);
+        comment.setEndDate(endDate);
+        comment.setCommentType(CommentType);
+        TMonthlyQualityComment result = tMonthlyQualityCommentService.selectTMonthlyQualityCommentByTypeAndDate(comment);
+        if (result != null) {
+            return result.getQualityComment();
+        } else {
+            return "";
+        }
+    }
 }

+ 137 - 0
master/src/main/java/com/ruoyi/project/production/domain/TMonthlyQualityComment.java

@@ -0,0 +1,137 @@
+package com.ruoyi.project.production.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 质量月报评价对象 t_monthly_quality_comment
+ *
+ * @author ssy
+ * @date 2023-12-14
+ */
+public class TMonthlyQualityComment extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    private Long id;
+
+    /** 评价类型 */
+    @Excel(name = "评价类型")
+    private Long commentType;
+
+    /** 评价 */
+    @Excel(name = "评价")
+    private String qualityComment;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    /** 质量月报标题 */
+    @Excel(name = "质量月报标题")
+    private String title;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startDate;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endDate;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setQualityComment(String qualityComment)
+    {
+        this.qualityComment = qualityComment;
+    }
+
+    public String getQualityComment()
+    {
+        return qualityComment;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setTitle(String title)
+    {
+        this.title = title;
+    }
+
+    public String getTitle()
+    {
+        return title;
+    }
+    public void setStartDate(Date startDate)
+    {
+        this.startDate = startDate;
+    }
+
+    public Date getStartDate()
+    {
+        return startDate;
+    }
+    public void setEndDate(Date endDate)
+    {
+        this.endDate = endDate;
+    }
+
+    public Date getEndDate()
+    {
+        return endDate;
+    }
+
+    public Long getCommentType() {
+        return commentType;
+    }
+
+    public void setCommentType(Long commentType) {
+        this.commentType = commentType;
+    }
+
+    @Override
+    public String toString() {
+        return "TMonthlyQualityComment{" +
+                "id=" + id +
+                ", commentType='" + commentType + '\'' +
+                ", qualityComment='" + qualityComment + '\'' +
+                ", deptId=" + deptId +
+                ", delFlag='" + delFlag + '\'' +
+                ", title='" + title + '\'' +
+                ", startDate=" + startDate +
+                ", endDate=" + endDate +
+                '}';
+    }
+}

+ 68 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TMonthlyQualityCommentMapper.java

@@ -0,0 +1,68 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TMonthlyQualityComment;
+
+/**
+ * 质量月报评价Mapper接口
+ * 
+ * @author ssy
+ * @date 2023-12-14
+ */
+public interface TMonthlyQualityCommentMapper
+{
+    /**
+     * 获取质量月报评价详细信息
+     */
+    public TMonthlyQualityComment selectTMonthlyQualityCommentByTypeAndDate(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 查询质量月报评价
+     * 
+     * @param id 质量月报评价ID
+     * @return 质量月报评价
+     */
+    public TMonthlyQualityComment selectTMonthlyQualityCommentById(Long id);
+
+    /**
+     * 查询质量月报评价列表
+     * 
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 质量月报评价集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TMonthlyQualityComment> selectTMonthlyQualityCommentList(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 新增质量月报评价
+     * 
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 结果
+     */
+    public int insertTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 修改质量月报评价
+     * 
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 结果
+     */
+    public int updateTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 删除质量月报评价
+     * 
+     * @param id 质量月报评价ID
+     * @return 结果
+     */
+    public int deleteTMonthlyQualityCommentById(Long id);
+
+    /**
+     * 批量删除质量月报评价
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTMonthlyQualityCommentByIds(Long[] ids);
+}

+ 66 - 0
master/src/main/java/com/ruoyi/project/production/service/ITMonthlyQualityCommentService.java

@@ -0,0 +1,66 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TMonthlyQualityComment;
+
+/**
+ * 质量月报评价Service接口
+ * 
+ * @author ssy
+ * @date 2023-12-14
+ */
+public interface ITMonthlyQualityCommentService 
+{
+    /**
+     * 查询质量月报评价
+     * 
+     * @param id 质量月报评价ID
+     * @return 质量月报评价
+     */
+    public TMonthlyQualityComment selectTMonthlyQualityCommentById(Long id);
+
+    /**
+     * 查询质量月报评价列表
+     * 
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 质量月报评价集合
+     */
+    public List<TMonthlyQualityComment> selectTMonthlyQualityCommentList(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 新增质量月报评价
+     * 
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 结果
+     */
+    public int insertTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 修改质量月报评价
+     * 
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 结果
+     */
+    public int updateTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment);
+
+    /**
+     * 批量删除质量月报评价
+     * 
+     * @param ids 需要删除的质量月报评价ID
+     * @return 结果
+     */
+    public int deleteTMonthlyQualityCommentByIds(Long[] ids);
+
+    /**
+     * 删除质量月报评价信息
+     * 
+     * @param id 质量月报评价ID
+     * @return 结果
+     */
+    public int deleteTMonthlyQualityCommentById(Long id);
+
+    /**
+     * 获取质量月报评价详细信息
+     */
+    public TMonthlyQualityComment selectTMonthlyQualityCommentByTypeAndDate(TMonthlyQualityComment tMonthlyQualityComment);
+}

+ 104 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TMonthlyQualityCommentServiceImpl.java

@@ -0,0 +1,104 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TMonthlyQualityCommentMapper;
+import com.ruoyi.project.production.domain.TMonthlyQualityComment;
+import com.ruoyi.project.production.service.ITMonthlyQualityCommentService;
+
+/**
+ * 质量月报评价Service业务层处理
+ *
+ * @author ssy
+ * @date 2023-12-14
+ */
+@Service
+public class TMonthlyQualityCommentServiceImpl implements ITMonthlyQualityCommentService
+{
+    @Autowired
+    private TMonthlyQualityCommentMapper tMonthlyQualityCommentMapper;
+
+    /**
+     * 查询质量月报评价
+     *
+     * @param id 质量月报评价ID
+     * @return 质量月报评价
+     */
+    @Override
+    public TMonthlyQualityComment selectTMonthlyQualityCommentById(Long id)
+    {
+        return tMonthlyQualityCommentMapper.selectTMonthlyQualityCommentById(id);
+    }
+
+    /**
+     * 查询质量月报评价列表
+     *
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 质量月报评价
+     */
+    @Override
+    public List<TMonthlyQualityComment> selectTMonthlyQualityCommentList(TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        return tMonthlyQualityCommentMapper.selectTMonthlyQualityCommentList(tMonthlyQualityComment);
+    }
+
+    /**
+     * 新增质量月报评价
+     *
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 结果
+     */
+    @Override
+    public int insertTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        tMonthlyQualityComment.setCreateTime(DateUtils.getNowDate());
+        return tMonthlyQualityCommentMapper.insertTMonthlyQualityComment(tMonthlyQualityComment);
+    }
+
+    /**
+     * 修改质量月报评价
+     *
+     * @param tMonthlyQualityComment 质量月报评价
+     * @return 结果
+     */
+    @Override
+    public int updateTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment)
+    {
+        tMonthlyQualityComment.setUpdateTime(DateUtils.getNowDate());
+        return tMonthlyQualityCommentMapper.updateTMonthlyQualityComment(tMonthlyQualityComment);
+    }
+
+    /**
+     * 批量删除质量月报评价
+     *
+     * @param ids 需要删除的质量月报评价ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonthlyQualityCommentByIds(Long[] ids)
+    {
+        return tMonthlyQualityCommentMapper.deleteTMonthlyQualityCommentByIds(ids);
+    }
+
+    /**
+     * 删除质量月报评价信息
+     *
+     * @param id 质量月报评价ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonthlyQualityCommentById(Long id)
+    {
+        return tMonthlyQualityCommentMapper.deleteTMonthlyQualityCommentById(id);
+    }
+
+    /**
+     * 获取质量月报评价详细信息
+     */
+    @Override
+    public TMonthlyQualityComment selectTMonthlyQualityCommentByTypeAndDate(TMonthlyQualityComment tMonthlyQualityComment) {
+        return tMonthlyQualityCommentMapper.selectTMonthlyQualityCommentByTypeAndDate(tMonthlyQualityComment);
+    }
+}

+ 117 - 0
master/src/main/resources/mybatis/production/TMonthlyQualityCommentMapper.xml

@@ -0,0 +1,117 @@
+<?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.ruoyi.project.production.mapper.TMonthlyQualityCommentMapper">
+    
+    <resultMap type="TMonthlyQualityComment" id="TMonthlyQualityCommentResult">
+        <result property="id"    column="id"    />
+        <result property="commentType"    column="comment_type"    />
+        <result property="qualityComment"    column="quality_comment"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="title"    column="title"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="startDate"    column="start_date"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="endDate"    column="end_date"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTMonthlyQualityCommentVo">
+        select d.id, d.comment_type, d.quality_comment, d.dept_id, d.del_flag, d.create_by, d.title, d.create_time, d.update_by, d.start_date, d.update_time, d.end_date from t_monthly_quality_comment d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTMonthlyQualityCommentList" parameterType="TMonthlyQualityComment" resultMap="TMonthlyQualityCommentResult">
+        <include refid="selectTMonthlyQualityCommentVo"/>
+        <where>  
+            <if test="commentType != null  and commentType != ''"> and comment_type = #{commentType}</if>
+            <if test="qualityComment != null  and qualityComment != ''"> and quality_comment = #{qualityComment}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="startDate != null "> and start_date = #{startDate}</if>
+            <if test="endDate != null "> and end_date = #{endDate}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
+    <select id="selectTMonthlyQualityCommentByTypeAndDate" parameterType="TMonthlyQualityComment" resultMap="TMonthlyQualityCommentResult">
+        <include refid="selectTMonthlyQualityCommentVo"/>
+        where d.comment_type = #{commentType} and d.start_date = #{startDate} and d.end_date = #{endDate} and d.del_flag = 0
+    </select>
+    
+    <select id="selectTMonthlyQualityCommentById" parameterType="Long" resultMap="TMonthlyQualityCommentResult">
+        <include refid="selectTMonthlyQualityCommentVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTMonthlyQualityComment" parameterType="TMonthlyQualityComment">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_monthly_quality_comment.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_monthly_quality_comment
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="commentType != null">comment_type,</if>
+            <if test="qualityComment != null">quality_comment,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="title != null">title,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="startDate != null">start_date,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="endDate != null">end_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="commentType != null">#{commentType},</if>
+            <if test="qualityComment != null">#{qualityComment},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="title != null">#{title},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="startDate != null">#{startDate},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="endDate != null">#{endDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTMonthlyQualityComment" parameterType="TMonthlyQualityComment">
+        update t_monthly_quality_comment
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="commentType != null">comment_type = #{commentType},</if>
+            <if test="qualityComment != null">quality_comment = #{qualityComment},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="startDate != null">start_date = #{startDate},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="endDate != null">end_date = #{endDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTMonthlyQualityCommentById" parameterType="Long">
+        update t_monthly_quality_comment set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTMonthlyQualityCommentByIds" parameterType="String">
+        update t_monthly_quality_comment set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

+ 71 - 0
ui/src/api/production/comment.js

@@ -0,0 +1,71 @@
+import request from '@/utils/request'
+
+// 提交质量月报评价
+export function submitComment(data) {
+  return request({
+    url: '/production/comment/submitComment',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询质量月报评价详细
+export function getCommentInfo(query) {
+  return request({
+    url: '/production/comment/getComment',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询质量月报评价列表
+export function listComment(query) {
+  return request({
+    url: '/production/comment/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询质量月报评价详细
+export function getComment(id) {
+  return request({
+    url: '/production/comment/' + id,
+    method: 'get'
+  })
+}
+
+// 新增质量月报评价
+export function addComment(data) {
+  return request({
+    url: '/production/comment',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改质量月报评价
+export function updateComment(data) {
+  return request({
+    url: '/production/comment',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除质量月报评价
+export function delComment(id) {
+  return request({
+    url: '/production/comment/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出质量月报评价
+export function exportComment(query) {
+  return request({
+    url: '/production/comment/export',
+    method: 'get',
+    params: query
+  })
+}

+ 28 - 2
ui/src/views/production/quality/index.vue

@@ -2216,7 +2216,6 @@
         </el-form-item>
       </el-form>
       <div id="chart" :style="{width:width,height:height}"></div>
-      <div style="white-space: pre-wrap; margin: 10px auto; text-align: center;">{{analysisDescription}}</div>
       <table id="tableC2" v-if="showC2Table">
         <tr>
           <td colspan="5" class="td-transparent">BYC performance of C2 reactor</td>
@@ -2354,6 +2353,11 @@
           <td class="td-transparent"></td>
         </tr>
       </table>
+      <div style="white-space: pre-wrap; margin: 0px auto; margin-top: 25px;text-align: center;">{{analysisDescription}}</div>
+      <el-input type="textarea" :rows="6" placeholder="请输入内容" v-model="comment" style="margin-top: 25px;"></el-input>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitComment">确 定</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -2384,6 +2388,7 @@ import { listS6107, getS6107, delS6107, addS6107, updateS6107, exportS6107 } fro
 import { listS6301, getS6301, delS6301, addS6301, updateS6301, exportS6301 } from "@/api/production/s6301";
 import { listZ404, getZ404, delZ404, addZ404, updateZ404, exportZ404 } from "@/api/production/z404";
 import { exportQuality, c3ReactorTable, c3ReactorAnalysis, c2ReactorAnalysis, c2ReactorTable } from "@/api/production/quality";
+import { submitComment, getCommentInfo } from "@/api/production/comment";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -2404,6 +2409,7 @@ export default {
   components: { Treeselect },
   data() {
     return {
+      comment: '',
       analysisDescription: null,
       c3ReactorTableData: {},
       c2ReactorTableData: {},
@@ -2578,6 +2584,17 @@ export default {
     });
   },
   methods: {
+    /** 处理评价提交 */
+    submitComment() {
+      submitComment({
+        "commentType": this.analysisValue,
+        "startDate": this.sampleDate[0],
+        "endDate": this.sampleDate[1],
+        "qualityComment": this.comment
+      }).then(response => {
+        this.msgSuccess("修改成功");
+      });
+    },
     /** 销毁趋势图 */
     disposeChart() {
       this.showC3Table = false;
@@ -3450,6 +3467,7 @@ export default {
     },
     handleAnalysisQuery() {
       this.analysisDescription = null;
+      this.comment = null;
       this.analysisQueryParams.startDate = this.analysisSampleDate[0];
       this.analysisQueryParams.endDate = this.analysisSampleDate[1];
       let dictLabel = "";
@@ -4785,6 +4803,13 @@ export default {
           });
           break;
       }
+      getCommentInfo({
+        "commentType": this.analysisValue,
+        "startDate": this.sampleDate[0],
+        "endDate": this.sampleDate[1]
+      }).then(response => {
+        this.comment = response.data.qualityComment;
+      });
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -5462,6 +5487,7 @@ export default {
    }
   #tableC2,#tableC3{
     width: 80%;
-    margin: 50px auto;
+    margin: 0px auto;
+    margin-top: 25px;
   }
 </style>