Przeglądaj źródła

-添加:5s管理相关功能

jiangbiao 2 lat temu
rodzic
commit
797859d71b

+ 17 - 1
master/src/main/java/com/ruoyi/project/production/controller/TFivesChangeRecordController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.production.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -7,7 +8,9 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.production.domain.TFivesChangeRecord;
+import com.ruoyi.project.production.domain.TFivesRecordDetails;
 import com.ruoyi.project.production.service.ITFivesChangeRecordService;
+import com.ruoyi.project.production.service.ITFivesRecordDetailsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -27,6 +30,8 @@ public class TFivesChangeRecordController extends BaseController
 {
     @Autowired
     private ITFivesChangeRecordService tFivesChangeRecordService;
+    @Autowired
+    private ITFivesRecordDetailsService tFivesRecordDetailsService;
 
     /**
      * 查询区域检查整改记录列表
@@ -86,6 +91,17 @@ public class TFivesChangeRecordController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TFivesChangeRecord tFivesChangeRecord)
     {
+        if (StringUtils.isNotEmpty(tFivesChangeRecord.getchangeFile())) {
+            TFivesRecordDetails tFivesRecordDetails = new TFivesRecordDetails();
+            tFivesRecordDetails.setRecordId(tFivesChangeRecord.getId());
+            tFivesRecordDetails.setChangeContent(tFivesChangeRecord.getChangeContent());
+            tFivesRecordDetails.setChangeDate(tFivesChangeRecord.getChangeDate());
+            tFivesRecordDetails.setChangeResult(tFivesChangeRecord.getChangeResult());
+            tFivesRecordDetails.setFileId(tFivesChangeRecord.getchangeFile());
+            tFivesRecordDetails.setCreatedate(new Date());
+            tFivesRecordDetails.setCreaterCode(getUserId().toString());
+            tFivesRecordDetailsService.insertTFivesRecordDetails(tFivesRecordDetails);
+        }
         return toAjax(tFivesChangeRecordService.updateTFivesChangeRecord(tFivesChangeRecord));
     }
 
@@ -94,7 +110,7 @@ public class TFivesChangeRecordController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('production:record:remove')")
     @Log(title = "区域检查整改记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
+    @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
         return toAjax(tFivesChangeRecordService.deleteTFivesChangeRecordByIds(ids));

+ 103 - 0
master/src/main/java/com/ruoyi/project/production/controller/TFivesRecordDetailsController.java

@@ -0,0 +1,103 @@
+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.TFivesRecordDetails;
+import com.ruoyi.project.production.service.ITFivesRecordDetailsService;
+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 ruoyi
+ * @date 2023-04-04
+ */
+@RestController
+@RequestMapping("/production/details")
+public class TFivesRecordDetailsController extends BaseController
+{
+    @Autowired
+    private ITFivesRecordDetailsService tFivesRecordDetailsService;
+
+    /**
+     * 查询整改记录详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:details:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TFivesRecordDetails tFivesRecordDetails)
+    {
+        startPage();
+        List<TFivesRecordDetails> list = tFivesRecordDetailsService.selectTFivesRecordDetailsList(tFivesRecordDetails);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出整改记录详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:details:export')")
+    @Log(title = "整改记录详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TFivesRecordDetails tFivesRecordDetails)
+    {
+        List<TFivesRecordDetails> list = tFivesRecordDetailsService.selectTFivesRecordDetailsList(tFivesRecordDetails);
+        ExcelUtil<TFivesRecordDetails> util = new ExcelUtil<TFivesRecordDetails>(TFivesRecordDetails.class);
+        return util.exportExcel(list, "details");
+    }
+
+    /**
+     * 获取整改记录详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:details:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tFivesRecordDetailsService.selectTFivesRecordDetailsById(id));
+    }
+
+    /**
+     * 新增整改记录详情
+     */
+    @PreAuthorize("@ss.hasPermi('production:details:add')")
+    @Log(title = "整改记录详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TFivesRecordDetails tFivesRecordDetails)
+    {
+        return toAjax(tFivesRecordDetailsService.insertTFivesRecordDetails(tFivesRecordDetails));
+    }
+
+    /**
+     * 修改整改记录详情
+     */
+    @PreAuthorize("@ss.hasPermi('production:details:edit')")
+    @Log(title = "整改记录详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TFivesRecordDetails tFivesRecordDetails)
+    {
+        return toAjax(tFivesRecordDetailsService.updateTFivesRecordDetails(tFivesRecordDetails));
+    }
+
+    /**
+     * 删除整改记录详情
+     */
+    @PreAuthorize("@ss.hasPermi('production:details:remove')")
+    @Log(title = "整改记录详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tFivesRecordDetailsService.deleteTFivesRecordDetailsByIds(ids));
+    }
+}

+ 6 - 6
master/src/main/java/com/ruoyi/project/production/domain/TFivesChangeRecord.java

@@ -65,7 +65,7 @@ public class TFivesChangeRecord extends BaseEntity
 
     /** 整改后照片 */
     @Excel(name = "整改后照片")
-    private String chengeFile;
+    private String changeFile;
 
     /** 整改结果 */
     @Excel(name = "整改结果")
@@ -212,14 +212,14 @@ public class TFivesChangeRecord extends BaseEntity
     {
         return changeContent;
     }
-    public void setChengeFile(String chengeFile)
+    public void setchangeFile(String changeFile)
     {
-        this.chengeFile = chengeFile;
+        this.changeFile = changeFile;
     }
 
-    public String getChengeFile()
+    public String getchangeFile()
     {
-        return chengeFile;
+        return changeFile;
     }
     public void setChangeResult(String changeResult)
     {
@@ -308,7 +308,7 @@ public class TFivesChangeRecord extends BaseEntity
             .append("checkFile", getCheckFile())
             .append("changeDate", getChangeDate())
             .append("changeContent", getChangeContent())
-            .append("chengeFile", getChengeFile())
+            .append("changeFile", getchangeFile())
             .append("changeResult", getChangeResult())
             .append("delFlag", getDelFlag())
             .append("createrCode", getCreaterCode())

+ 224 - 0
master/src/main/java/com/ruoyi/project/production/domain/TFivesRecordDetails.java

@@ -0,0 +1,224 @@
+package com.ruoyi.project.production.domain;
+
+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;
+
+import java.util.Date;
+
+/**
+ * 整改记录详情对象 t_fives_record_details
+ *
+ * @author ruoyi
+ * @date 2023-04-04
+ */
+public class TFivesRecordDetails extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识ID */
+    private Long id;
+
+    /** 关联记录id */
+    @Excel(name = "关联记录id")
+    private Long recordId;
+
+    /** 关联文件id */
+    @Excel(name = "关联文件id")
+    private String fileId;
+
+    /** 状态 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private String updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 整改日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "整改日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date changeDate;
+
+    /** 整改内容 */
+    @Excel(name = "整改内容")
+    private String changeContent;
+
+    /** 整改结果 */
+    @Excel(name = "整改结果")
+    private String changeResult;
+
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setRecordId(Long recordId)
+    {
+        this.recordId = recordId;
+    }
+
+    public Long getRecordId()
+    {
+        return recordId;
+    }
+    public void setFileId(String fileId)
+    {
+        this.fileId = fileId;
+    }
+
+    public String getFileId()
+    {
+        return fileId;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setChangeDate(Date changeDate)
+    {
+        this.changeDate = changeDate;
+    }
+
+    public Date getChangeDate()
+    {
+        return changeDate;
+    }
+    public void setChangeContent(String changeContent)
+    {
+        this.changeContent = changeContent;
+    }
+
+    public String getChangeContent()
+    {
+        return changeContent;
+    }
+    public void setChangeResult(String changeResult)
+    {
+        this.changeResult = changeResult;
+    }
+
+    public String getChangeResult()
+    {
+        return changeResult;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("recordId", getRecordId())
+            .append("fileId", getFileId())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("remarks", getRemarks())
+            .append("deptId", getDeptId())
+            .append("changeDate", getChangeDate())
+            .append("changeContent", getChangeContent())
+            .append("changeResult", getChangeResult())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TFivesRecordDetailsMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TFivesRecordDetails;
+
+/**
+ * 整改记录详情Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-04-04
+ */
+public interface TFivesRecordDetailsMapper 
+{
+    /**
+     * 查询整改记录详情
+     * 
+     * @param id 整改记录详情ID
+     * @return 整改记录详情
+     */
+    public TFivesRecordDetails selectTFivesRecordDetailsById(Long id);
+
+    /**
+     * 查询整改记录详情列表
+     * 
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 整改记录详情集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TFivesRecordDetails> selectTFivesRecordDetailsList(TFivesRecordDetails tFivesRecordDetails);
+
+    /**
+     * 新增整改记录详情
+     * 
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 结果
+     */
+    public int insertTFivesRecordDetails(TFivesRecordDetails tFivesRecordDetails);
+
+    /**
+     * 修改整改记录详情
+     * 
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 结果
+     */
+    public int updateTFivesRecordDetails(TFivesRecordDetails tFivesRecordDetails);
+
+    /**
+     * 删除整改记录详情
+     * 
+     * @param id 整改记录详情ID
+     * @return 结果
+     */
+    public int deleteTFivesRecordDetailsById(Long id);
+
+    /**
+     * 批量删除整改记录详情
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTFivesRecordDetailsByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/production/service/ITFivesRecordDetailsService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TFivesRecordDetails;
+
+/**
+ * 整改记录详情Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-04-04
+ */
+public interface ITFivesRecordDetailsService 
+{
+    /**
+     * 查询整改记录详情
+     * 
+     * @param id 整改记录详情ID
+     * @return 整改记录详情
+     */
+    public TFivesRecordDetails selectTFivesRecordDetailsById(Long id);
+
+    /**
+     * 查询整改记录详情列表
+     * 
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 整改记录详情集合
+     */
+    public List<TFivesRecordDetails> selectTFivesRecordDetailsList(TFivesRecordDetails tFivesRecordDetails);
+
+    /**
+     * 新增整改记录详情
+     * 
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 结果
+     */
+    public int insertTFivesRecordDetails(TFivesRecordDetails tFivesRecordDetails);
+
+    /**
+     * 修改整改记录详情
+     * 
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 结果
+     */
+    public int updateTFivesRecordDetails(TFivesRecordDetails tFivesRecordDetails);
+
+    /**
+     * 批量删除整改记录详情
+     * 
+     * @param ids 需要删除的整改记录详情ID
+     * @return 结果
+     */
+    public int deleteTFivesRecordDetailsByIds(Long[] ids);
+
+    /**
+     * 删除整改记录详情信息
+     * 
+     * @param id 整改记录详情ID
+     * @return 结果
+     */
+    public int deleteTFivesRecordDetailsById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TFivesRecordDetailsServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TFivesRecordDetailsMapper;
+import com.ruoyi.project.production.domain.TFivesRecordDetails;
+import com.ruoyi.project.production.service.ITFivesRecordDetailsService;
+
+/**
+ * 整改记录详情Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-04-04
+ */
+@Service
+public class TFivesRecordDetailsServiceImpl implements ITFivesRecordDetailsService
+{
+    @Autowired
+    private TFivesRecordDetailsMapper tFivesRecordDetailsMapper;
+
+    /**
+     * 查询整改记录详情
+     *
+     * @param id 整改记录详情ID
+     * @return 整改记录详情
+     */
+    @Override
+    public TFivesRecordDetails selectTFivesRecordDetailsById(Long id)
+    {
+        return tFivesRecordDetailsMapper.selectTFivesRecordDetailsById(id);
+    }
+
+    /**
+     * 查询整改记录详情列表
+     *
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 整改记录详情
+     */
+    @Override
+    public List<TFivesRecordDetails> selectTFivesRecordDetailsList(TFivesRecordDetails tFivesRecordDetails)
+    {
+        return tFivesRecordDetailsMapper.selectTFivesRecordDetailsList(tFivesRecordDetails);
+    }
+
+    /**
+     * 新增整改记录详情
+     *
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 结果
+     */
+    @Override
+    public int insertTFivesRecordDetails(TFivesRecordDetails tFivesRecordDetails)
+    {
+        return tFivesRecordDetailsMapper.insertTFivesRecordDetails(tFivesRecordDetails);
+    }
+
+    /**
+     * 修改整改记录详情
+     *
+     * @param tFivesRecordDetails 整改记录详情
+     * @return 结果
+     */
+    @Override
+    public int updateTFivesRecordDetails(TFivesRecordDetails tFivesRecordDetails)
+    {
+        return tFivesRecordDetailsMapper.updateTFivesRecordDetails(tFivesRecordDetails);
+    }
+
+    /**
+     * 批量删除整改记录详情
+     *
+     * @param ids 需要删除的整改记录详情ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTFivesRecordDetailsByIds(Long[] ids)
+    {
+        return tFivesRecordDetailsMapper.deleteTFivesRecordDetailsByIds(ids);
+    }
+
+    /**
+     * 删除整改记录详情信息
+     *
+     * @param id 整改记录详情ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTFivesRecordDetailsById(Long id)
+    {
+        return tFivesRecordDetailsMapper.deleteTFivesRecordDetailsById(id);
+    }
+}

+ 9 - 9
master/src/main/resources/mybatis/production/TFivesChangeRecordMapper.xml

@@ -16,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="checkFile"    column="check_file"    />
         <result property="changeDate"    column="change_date"    />
         <result property="changeContent"    column="change_content"    />
-        <result property="chengeFile"    column="chenge_file"    />
+        <result property="changeFile"    column="change_file"    />
         <result property="changeResult"    column="change_result"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="createrCode"    column="creater_code"    />
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTFivesChangeRecordVo">
-        select d.id, d.region_order, d.position, d.owner, d.check_date, d.checker_id, d.checker_name, d.check_problem, d.check_file, d.change_date, d.change_content, d.chenge_file, d.change_result, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks,  d.dept_id ,s.dept_name from t_fives_change_record d
+        select d.id, d.region_order, d.position, d.owner, d.check_date, d.checker_id, d.checker_name, d.check_problem, d.check_file, d.change_date, d.change_content, d.change_file, d.change_result, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks,  d.dept_id ,s.dept_name from t_fives_change_record d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="checkFile != null  and checkFile != ''"> and check_file = #{checkFile}</if>
             <if test="changeDate != null "> and change_date = #{changeDate}</if>
             <if test="changeContent != null  and changeContent != ''"> and change_content = #{changeContent}</if>
-            <if test="chengeFile != null  and chengeFile != ''"> and chenge_file = #{chengeFile}</if>
+            <if test="changeFile != null  and changeFile != ''"> and change_file = #{changeFile}</if>
             <if test="changeResult != null  and changeResult != ''"> and change_result = #{changeResult}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
@@ -79,10 +79,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="checkerId != null">checker_id,</if>
             <if test="checkerName != null">checker_name,</if>
             <if test="checkProblem != null">check_problem,</if>
-            <if test="checkFile != null">check_file,</if>
+            <if test="checkFile != null  and checkFile != ''">check_file,</if>
             <if test="changeDate != null">change_date,</if>
             <if test="changeContent != null">change_content,</if>
-            <if test="chengeFile != null">chenge_file,</if>
+            <if test="changeFile != null and changeFile != ''">change_file,</if>
             <if test="changeResult != null">change_result,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createrCode != null">creater_code,</if>
@@ -101,10 +101,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="checkerId != null">#{checkerId},</if>
             <if test="checkerName != null">#{checkerName},</if>
             <if test="checkProblem != null">#{checkProblem},</if>
-            <if test="checkFile != null">#{checkFile},</if>
+            <if test="checkFile != null and checkFile != ''">#{checkFile},</if>
             <if test="changeDate != null">#{changeDate},</if>
             <if test="changeContent != null">#{changeContent},</if>
-            <if test="chengeFile != null">#{chengeFile},</if>
+            <if test="changeFile != null and changeFile != ''">#{changeFile},</if>
             <if test="changeResult != null">#{changeResult},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createrCode != null">#{createrCode},</if>
@@ -126,10 +126,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="checkerId != null">checker_id = #{checkerId},</if>
             <if test="checkerName != null">checker_name = #{checkerName},</if>
             <if test="checkProblem != null">check_problem = #{checkProblem},</if>
-            <if test="checkFile != null">check_file = #{checkFile},</if>
+            <if test="checkFile != null and checkFile != ''">check_file = #{checkFile},</if>
             <if test="changeDate != null">change_date = #{changeDate},</if>
             <if test="changeContent != null">change_content = #{changeContent},</if>
-            <if test="chengeFile != null">chenge_file = #{chengeFile},</if>
+            <if test="changeFile != null and changeFile != ''">change_file = #{changeFile},</if>
             <if test="changeResult != null">change_result = #{changeResult},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="createrCode != null">creater_code = #{createrCode},</if>

+ 121 - 0
master/src/main/resources/mybatis/production/TFivesRecordDetailsMapper.xml

@@ -0,0 +1,121 @@
+<?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.TFivesRecordDetailsMapper">
+    
+    <resultMap type="TFivesRecordDetails" id="TFivesRecordDetailsResult">
+        <result property="id"    column="id"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="fileId"    column="file_id"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="changeDate"    column="change_date"    />
+        <result property="changeContent"    column="change_content"    />
+        <result property="changeResult"    column="change_result"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTFivesRecordDetailsVo">
+        select d.id, d.record_id, d.file_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.change_date, d.change_content, d.change_result ,s.dept_name from t_fives_record_details d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTFivesRecordDetailsList" parameterType="TFivesRecordDetails" resultMap="TFivesRecordDetailsResult">
+        <include refid="selectTFivesRecordDetailsVo"/>
+        <where>  
+            <if test="recordId != null "> and record_id = #{recordId}</if>
+            <if test="fileId != null  and fileId != ''"> and file_id = #{fileId}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="changeDate != null "> and change_date = #{changeDate}</if>
+            <if test="changeContent != null  and changeContent != ''"> and change_content = #{changeContent}</if>
+            <if test="changeResult != null  and changeResult != ''"> and change_result = #{changeResult}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTFivesRecordDetailsById" parameterType="Long" resultMap="TFivesRecordDetailsResult">
+        <include refid="selectTFivesRecordDetailsVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTFivesRecordDetails" parameterType="TFivesRecordDetails">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_fives_record_details.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_fives_record_details
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="recordId != null">record_id,</if>
+            <if test="fileId != null">file_id,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="changeDate != null">change_date,</if>
+            <if test="changeContent != null">change_content,</if>
+            <if test="changeResult != null">change_result,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="recordId != null">#{recordId},</if>
+            <if test="fileId != null">#{fileId},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="changeDate != null">#{changeDate},</if>
+            <if test="changeContent != null">#{changeContent},</if>
+            <if test="changeResult != null">#{changeResult},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTFivesRecordDetails" parameterType="TFivesRecordDetails">
+        update t_fives_record_details
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="recordId != null">record_id = #{recordId},</if>
+            <if test="fileId != null">file_id = #{fileId},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="changeDate != null">change_date = #{changeDate},</if>
+            <if test="changeContent != null">change_content = #{changeContent},</if>
+            <if test="changeResult != null">change_result = #{changeResult},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTFivesRecordDetailsById" parameterType="Long">
+        update t_fives_record_details set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTFivesRecordDetailsByIds" parameterType="String">
+        update t_fives_record_details set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

+ 53 - 0
ui/src/api/production/details.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询整改记录详情列表
+export function listDetails(query) {
+  return request({
+    url: '/production/details/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询整改记录详情详细
+export function getDetails(id) {
+  return request({
+    url: '/production/details/' + id,
+    method: 'get'
+  })
+}
+
+// 新增整改记录详情
+export function addDetails(data) {
+  return request({
+    url: '/production/details',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改整改记录详情
+export function updateDetails(data) {
+  return request({
+    url: '/production/details',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除整改记录详情
+export function delDetails(id) {
+  return request({
+    url: '/production/details/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出整改记录详情
+export function exportDetails(query) {
+  return request({
+    url: '/production/details/export',
+    method: 'get',
+    params: query
+  })
+}

+ 10 - 10
ui/src/views/production/inspection/index.vue

@@ -76,16 +76,16 @@
         >删除
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['production:inspection:edit']"
-        >导入
-        </el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="info"-->
+<!--          icon="el-icon-upload2"-->
+<!--          size="mini"-->
+<!--          @click="handleImport"-->
+<!--          v-hasPermi="['production:inspection:edit']"-->
+<!--        >导入-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"

+ 163 - 54
ui/src/views/production/record/index.vue

@@ -93,16 +93,16 @@
         >删除
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['production:record:edit']"
-        >导入
-        </el-button>
-      </el-col>
+      <!--      <el-col :span="1.5">
+              <el-button
+                type="info"
+                icon="el-icon-upload2"
+                size="mini"
+                @click="handleImport"
+                v-hasPermi="['production:record:edit']"
+              >导入
+              </el-button>
+            </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -129,14 +129,36 @@
       </el-table-column>
       <el-table-column label="检查人" align="center" prop="checkerName" :show-overflow-tooltip="true"/>
       <el-table-column label="检查问题描述" align="center" prop="checkProblem" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查附件" align="center" prop="checkFile" :show-overflow-tooltip="true"/>
+      <el-table-column label="检查附件" align="center" prop="checkFile" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <div v-if="scope.row.checkFile">
+            <el-button type="text" @click="openFile(scope.row.checkFile,'检查附件')"><i
+              class="el-icon-picture-outline"/>查看
+            </el-button>
+          </div>
+          <div v-else>
+            NA
+          </div>
+        </template>
+      </el-table-column>
       <el-table-column label="整改日期" align="center" prop="changeDate" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.changeDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="整改内容" align="center" prop="changeContent" :show-overflow-tooltip="true"/>
-      <el-table-column label="整改后照片" align="center" prop="chengeFile" :show-overflow-tooltip="true"/>
+      <el-table-column label="整改后照片" align="center" prop="changeFile" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <div v-if="scope.row.changeFile">
+            <el-button type="text" @click="openFile(scope.row.changeFile,'整改后照片')"><i
+              class="el-icon-picture-outline"/>查看
+            </el-button>
+          </div>
+          <div v-else>
+            NA
+          </div>
+        </template>
+      </el-table-column>
       <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
@@ -144,26 +166,10 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleChange(scope.row)"
-            v-hasPermi="['production:record:edit']"
-          >整改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            icon="el-icon-tickets"
+            @click="openDetail(scope.row.id)"
             v-hasPermi="['production:record:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['production:record:remove']"
-          >删除
+          >整改记录
           </el-button>
         </template>
       </el-table-column>
@@ -177,6 +183,17 @@
       @pagination="getList"
     />
 
+    <el-dialog :title="file.title" :visible.sync="file.open">
+      <div>
+        <el-image
+          style="width: 30%; height: 30%;margin:10px;border-radius: 5%;vertical-align: middle;'"
+          v-for="url in srcList"
+          :src="url"
+          :preview-src-list="srcList">
+        </el-image>
+      </div>
+    </el-dialog>
+
     <!-- 添加或修改区域检查整改记录对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
@@ -204,22 +221,22 @@
           <el-input v-model="form.checkProblem" placeholder="请输入检查问题描述"/>
         </el-form-item>
         <el-form-item label="检查附件" prop="fileId">
-        <el-upload
-          ref="file"
-          :headers="file.headers"
-          :action="file.url"
-          :disabled="file.isUploading"
-          :on-progress="handleFileDocProgress"
-          :on-success="handleFileDocSuccess"
-          :auto-upload="true"
-          accept=".jpg,.png"
-          :multiple="true"
-          :file-list="fileList"
-          list-type="picture-card"
-        >
-          <i class="el-icon-plus"></i>
-        </el-upload>
-      </el-form-item>
+          <el-upload
+            ref="file"
+            :headers="file.headers"
+            :action="file.url"
+            :disabled="file.isUploading"
+            :on-progress="handleFileDocProgress"
+            :on-success="handleFileDocSuccess"
+            :auto-upload="true"
+            accept=".jpg,.png"
+            :multiple="true"
+            :file-list="fileList"
+            list-type="picture-card"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
         <el-form-item label="备注" prop="remarks">
           <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
@@ -243,6 +260,23 @@
         <el-form-item label="整改内容">
           <el-input type="textarea" v-model="form.changeContent" placeholder="请输入整改内容"/>
         </el-form-item>
+        <el-form-item label="整改后照片" prop="fileId">
+          <el-upload
+            ref="file"
+            :headers="file.headers"
+            :action="file.url"
+            :disabled="file.isUploading"
+            :on-progress="handleFileDocProgress"
+            :on-success="handleFileDocSuccess2"
+            :auto-upload="true"
+            accept=".jpg,.png"
+            :multiple="true"
+            :file-list="fileList"
+            list-type="picture-card"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
         <el-form-item label="整改结果" prop="changeResult">
           <el-input v-model="form.changeResult" placeholder="请输入整改结果"/>
         </el-form-item>
@@ -253,6 +287,42 @@
       </div>
     </el-dialog>
 
+    <el-dialog title="整改记录" :visible.sync="detail.open" width="60%" append-to-body>
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="mini"
+            @click="handleChange"
+            v-hasPermi="['production:details:add']"
+          >添加整改记录
+          </el-button>
+        </el-col>
+      </el-row>
+      <el-table v-loading="loading" :data="detailsList" border>
+        <el-table-column label="整改后照片" align="center" prop="fileId" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <div v-if="scope.row.fileId">
+              <el-button type="text" @click="openFile(scope.row.fileId,'整改后照片')"><i
+                class="el-icon-picture-outline"/>查看
+              </el-button>
+            </div>
+            <div v-else>
+              NA
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="整改日期" align="center" prop="changeDate" width="100">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.changeDate, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="整改内容" align="center" prop="changeContent" :show-overflow-tooltip="true"/>
+        <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>
+      </el-table>
+    </el-dialog>
+
     <!-- 用户导入对话框 -->
     <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
@@ -303,6 +373,7 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Editor from '@/components/Editor';
 import {getFile} from "@/api/production/file";
+import {listDetails} from "@/api/production/details";
 
 export default {
   name: "Record",
@@ -310,7 +381,12 @@ export default {
   // components: { Editor },
   data() {
     return {
+      detail: {
+        open: false,
+        recordId: null,
+      },
       file: {
+        title: "",
         file: "",
         open: false,
         // 是否禁用上传
@@ -326,6 +402,9 @@ export default {
       ids: [],
       fileList: [],
       fileIds: [],
+      changeFileIds: [],
+      detailsList: [],
+      srcList: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -373,7 +452,7 @@ export default {
         checkFile: null,
         changeDate: null,
         changeContent: null,
-        chengeFile: null,
+        changeFile: null,
         changeResult: null,
         createrCode: null,
         createdate: null,
@@ -407,8 +486,19 @@ export default {
     this.getTreeselect();
   },
   methods: {
-    openFile(fileIds) {
-      console.log(fileIds)
+    openDetail(id) {
+      this.detail.recordId = id;
+      this.detail.open = true;
+      this.getDetailList(id);
+    },
+    getDetailList(id){
+      listDetails({recordId: id}).then(response => {
+        this.detailsList = response.rows;
+      });
+    },
+    openFile(fileIds, title) {
+      this.file.title = title;
+      this.file.file=null;
       this.file.open = true;
       this.srcList = [];
       let ids = fileIds.split(',');
@@ -428,6 +518,10 @@ export default {
     handleFileDocSuccess(response, file, fileList) {
       this.fileIds.push(response.data);
     },
+    //附件上传成功处理
+    handleFileDocSuccess2(response, file, fileList) {
+      this.changeFileIds.push(response.data);
+    },
     /** 查询区域检查整改记录列表 */
     getList() {
       this.loading = true;
@@ -463,7 +557,7 @@ export default {
         checkFile: null,
         changeDate: null,
         changeContent: null,
-        chengeFile: null,
+        changeFile: null,
         changeResult: null,
         delFlag: null,
         createrCode: null,
@@ -493,12 +587,18 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
+      this.fileIds = [];
+      this.changeFileIds = [];
+      this.fileList = [];
       this.reset();
       this.open = true;
       this.title = "添加区域检查整改记录";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.fileIds = [];
+      this.changeFileIds = [];
+      this.fileList = [];
       this.reset();
       const id = row.id || this.ids
       getRecord(id).then(response => {
@@ -507,10 +607,12 @@ export default {
         this.title = "修改区域检查整改记录";
       });
     },
-    handleChange(row) {
+    handleChange() {
+      this.fileIds = [];
+      this.fileList = [];
+      this.changeFileIds = [];
       this.reset();
-      const id = row.id || this.ids
-      getRecord(id).then(response => {
+      getRecord(this.detail.recordId).then(response => {
         this.form = response.data;
         this.changeOpen = true;
         this.title = "添加区域检查整改记录";
@@ -520,12 +622,19 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          if (this.fileIds != []) {
+            this.form.checkFile = this.fileIds.join(',');
+          }
+          if (this.changeFileIds != []) {
+            this.form.changeFile = this.changeFileIds.join(',');
+          }
           if (this.form.id != null) {
             updateRecord(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
               this.changeOpen = false;
               this.getList();
+              this.getDetailList(this.form.id);
             });
           } else {
             addRecord(this.form).then(response => {

+ 13 - 10
ui/src/views/production/region/index.vue

@@ -76,16 +76,16 @@
         >删除
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['production:region:edit']"
-        >导入
-        </el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="info"-->
+<!--          icon="el-icon-upload2"-->
+<!--          size="mini"-->
+<!--          @click="handleImport"-->
+<!--          v-hasPermi="['production:region:edit']"-->
+<!--        >导入-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -161,6 +161,9 @@
         <el-form-item label="位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
+        <el-form-item label="责任人是否为系统中人员" prop="personLiable">
+          <el-input v-model="form.personLiable" placeholder="请输入责任人"/>
+        </el-form-item>
         <el-form-item label="责任人" prop="personLiable">
           <el-input v-model="form.personLiable" placeholder="请输入责任人"/>
         </el-form-item>