Kaynağa Gözat

SAI开项管理:导出功能修改

wangggziwen 2 yıl önce
ebeveyn
işleme
9fae94b71f

+ 47 - 12
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -238,32 +238,67 @@ public class TSaiApplyController extends BaseController
         // 字典查询
         List<SysDictData> saiApplyStatusDict = iSysDictTypeService.selectDictDataByType("SAI_APPLY_STATUS");
         List<SysDictData> teamDivideDict = iSysDictTypeService.selectDictDataByType("TEAM_DIVIDE");
+        List<SysDictData> saiUnsafeStatusDict = iSysDictTypeService.selectDictDataByType("SAI_UNSAFE_STATUS");
+        List<SysDictData> saiUnsafeActionDict = iSysDictTypeService.selectDictDataByType("SAI_UNSAFE_ACTION");
+        int no = 0;  // 序号
         for (TSaiApply entity : list) {
+            no++;
             // 复制属性
             SaiApplyExportVO vo = new SaiApplyExportVO();
-            vo.setDescription(entity.getDescription());
-            for (SysDictData sysDictData : saiApplyStatusDict) {
-                if (sysDictData.getDictValue().equals(entity.getApplyStatus() + "")) {
-                    vo.setApplyStatus(sysDictData.getDictLabel());
+            vo.setNo(no + "");
+            vo.setPlantName(entity.getApplicantDeptName());
+            vo.setStaffName(entity.getApplicantName());
+            vo.setStaffId(userService.selectUserById(Long.parseLong(entity.getApplicant())).getStaffId());
+            vo.setMonth((entity.getApplyDate().getMonth() + 1) + "");
+            vo.setDate(entity.getApplyDate().getDate()+ "");
+            for (SysDictData sysDictData : saiUnsafeStatusDict) {
+                if (sysDictData.getDictValue().equals(entity.getUnsafeStatus() + "")) {
+                    vo.setUnsafeStatus(sysDictData.getDictLabel());
                 }
             }
-            vo.setApplicantDept(entity.getApplicantDeptName());
-            for (SysDictData sysDictData : teamDivideDict) {
-                if (sysDictData.getDictValue().equals(entity.getApplicantTeam())) {
-                    vo.setApplicantTeam(sysDictData.getDictLabel());
+            for (SysDictData sysDictData : saiUnsafeActionDict) {
+                if (sysDictData.getDictValue().equals(entity.getUnsafeAction() + "")) {
+                    vo.setUnsafeAction(sysDictData.getDictLabel());
                 }
             }
-            vo.setApplicant(entity.getApplicantName());
-            vo.setHandler(entity.getHandlerName());
+            vo.setDescription(entity.getDescription());
+            vo.setReaction(entity.getReaction());
             vo.setExecutor(entity.getExecutorName());
-            vo.setApplyDate(entity.getApplyDate());
             vo.setEstimateFinishDate(entity.getEstimateFinishDate());
             vo.setActualFinishDate(entity.getActualFinishDate());
             Long isRecorded = entity.getIsRecorded();
             if (isRecorded != null) {
                 vo.setIsRecorded(isRecorded == 1L ? "是" : "否");
             }
-            vo.setRecordNo(entity.getRecordNo());
+            String inspectors = entity.getInspectors();
+            if (inspectors != null && !"".equals(inspectors)) {
+                if (inspectors.indexOf(",") != -1) {
+                    String[] split = inspectors.split(",");
+                    String inspectorName = "";
+                    for (int i = 0; i < split.length; i++) {
+                        inspectorName += userService.selectUserById(Long.parseLong(split[i])).getNickName();
+                        if (i < split.length - 1) {
+                            inspectorName += ",";
+                        }
+                    }
+                    vo.setInspectors(inspectorName);
+                } else {
+                    vo.setInspectors(userService.selectUserById(Long.parseLong(inspectors)).getNickName());
+                }
+            }
+            vo.setValidateDate(entity.getActualFinishDate());
+            for (SysDictData sysDictData : saiApplyStatusDict) {
+                if (sysDictData.getDictValue().equals(entity.getApplyStatus() + "")) {
+                    vo.setApplyStatus(sysDictData.getDictLabel());
+                }
+            }
+            vo.setRemarks(entity.getRemarks());
+//            for (SysDictData sysDictData : teamDivideDict) {
+//                if (sysDictData.getDictValue().equals(entity.getApplicantTeam())) {
+//                    vo.setApplicantTeam(sysDictData.getDictLabel());
+//                }
+//            }
+            vo.setRemark(null);
             exportVOList.add(vo);
         }
         ExcelUtil<SaiApplyExportVO> util = new ExcelUtil<SaiApplyExportVO>(SaiApplyExportVO.class);

+ 112 - 329
master/src/main/java/com/ruoyi/project/production/controller/vo/SaiApplyExportVO.java

@@ -18,446 +18,229 @@ public class SaiApplyExportVO extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
-    private Long saiApplyId;
+    @Excel(name = "序号", width = 8)
+    private String no;
 
-    /** 删除状态 */
-    private String delFlag;
+    @Excel(name = "装置")
+    private String plantName;
 
-    /** 部门编号 */
-    private Long deptId;
+    @Excel(name = "姓名")
+    private String staffName;
 
-    /** 问题描述 */
-    @Excel(name = "问题描述")
-    private String description;
+    @Excel(name = "员工号")
+    private String staffId;
 
-    /** 申请状态 */
-    @Excel(name = "申请状态")
-    private String applyStatus;
+    @Excel(name = "月份", width = 8)
+    private String month;
 
-    /** 登记人部门 */
-    @Excel(name = "登记人部门")
-    private String applicantDept;
+    @Excel(name = "日期", width = 8)
+    private String date;
 
-    private String applicantDeptName;
-
-    /** 登记人班组 */
-    @Excel(name = "登记人班组")
-    private String applicantTeam;
-
-    /** 登记人 */
-    @Excel(name = "登记人")
-    private String applicant;
+    /** 不安全行为 */
+    @Excel(name = "不安全行为", width = 50)
+    private String unsafeAction;
 
-    private String applicantName;
+    /** 不安全状态 */
+    @Excel(name = "不安全状态", width = 50)
+    private String unsafeStatus;
 
-    /** 当前处理人 */
-    @Excel(name = "当前处理人")
-    private String handler;
+    /** 问题描述 */
+    @Excel(name = "问题描述", width = 50)
+    private String description;
 
-    private String handlerName;
+    /** 采取的措施 */
+    @Excel(name = "采取的措施", width = 50)
+    private String reaction;
 
     /** 整改负责人 */
-    @Excel(name = "整改负责人")
+    @Excel(name = "责人")
     private String executor;
 
-    private String executorName;
-
-    /** 登记时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "登记时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date applyDate;
-
     /** 预计完成时间 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "预计完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "预计完成日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date estimateFinishDate;
 
     /** 实际完成时间 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
-    @Excel(name = "实际完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "实际完成日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date actualFinishDate;
 
     /** 是否录入开项系统 */
     @Excel(name = "是否录入开项系统")
     private String isRecorded;
 
-    /** 开项编号 */
-    @Excel(name = "开项编号")
-    private String recordNo;
-
-    /** 申请编号 */
-    private String apNo;
-
-    /** 流程id */
-    private String processId;
-
-    /** 评估人 */
-    private String assessor;
-
     /** 验收人 */
+    @Excel(name = "验证人")
     private String inspectors;
 
-    /** 不安全状态 */
-    private Long unsafeStatus;
-
-    /** 不安全行为 */
-    private Long unsafeAction;
-
-    /** 任务编号 */
-    private String taskId;
-
-    /** 任务名称 */
-    private String taskName;
-
-    /** 采取的措施 */
-    private String reaction;
-
-    /** 是否需要VE验证 */
-    private Long needVe;
-
-    /** VE验证条款 */
-    private String veItems;
+    /** 实际完成时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "验证日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date validateDate;
 
-    /** VC/VE验证成果 */
-    private String veResult;
+    /** 申请状态 */
+    @Excel(name = "状态")
+    private String applyStatus;
 
     /** 备注 */
+    @Excel(name = "验证描述", width = 50)
     private String remarks;
 
-    /** VC/VE验证条款(其它) */
-    private String veItemOther;
+    @Excel(name = "备注")
+    private String remark;
 
-    public String getApplicantName() {
-        return applicantName;
+    public String getNo() {
+        return no;
     }
 
-    public void setApplicantName(String applicantName) {
-        this.applicantName = applicantName;
+    public void setNo(String no) {
+        this.no = no;
     }
 
-    public String getExecutorName() {
-        return executorName;
+    public String getPlantName() {
+        return plantName;
     }
 
-    public void setExecutorName(String executorName) {
-        this.executorName = executorName;
+    public void setPlantName(String plantName) {
+        this.plantName = plantName;
     }
 
-    public String getApplicantDeptName() {
-        return applicantDeptName;
+    public String getStaffName() {
+        return staffName;
     }
 
-    public void setApplicantDeptName(String applicantDeptName) {
-        this.applicantDeptName = applicantDeptName;
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
     }
 
-    public String getHandlerName() {
-        return handlerName;
+    public String getStaffId() {
+        return staffId;
     }
 
-    public void setHandlerName(String handlerName) {
-        this.handlerName = handlerName;
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
     }
 
-    public void setSaiApplyId(Long saiApplyId)
-    {
-        this.saiApplyId = saiApplyId;
+    public String getMonth() {
+        return month;
     }
 
-    public Long getSaiApplyId()
-    {
-        return saiApplyId;
-    }
-    public void setDelFlag(String delFlag)
-    {
-        this.delFlag = delFlag;
+    public void setMonth(String month) {
+        this.month = month;
     }
 
-    public String getDelFlag()
-    {
-        return delFlag;
-    }
-    public void setDeptId(Long deptId)
-    {
-        this.deptId = deptId;
+    public String getDate() {
+        return date;
     }
 
-    public Long getDeptId()
-    {
-        return deptId;
-    }
-    public void setApplyStatus(String applyStatus)
-    {
-        this.applyStatus = applyStatus;
+    public void setDate(String date) {
+        this.date = date;
     }
 
-    public String getApplyStatus()
-    {
-        return applyStatus;
-    }
-    public void setApNo(String apNo)
-    {
-        this.apNo = apNo;
-    }
-
-    public String getApNo()
-    {
-        return apNo;
-    }
-    public void setProcessId(String processId)
-    {
-        this.processId = processId;
+    public String getUnsafeAction() {
+        return unsafeAction;
     }
 
-    public String getProcessId()
-    {
-        return processId;
-    }
-    public void setApplicant(String applicant)
-    {
-        this.applicant = applicant;
+    public void setUnsafeAction(String unsafeAction) {
+        this.unsafeAction = unsafeAction;
     }
 
-    public String getApplicant()
-    {
-        return applicant;
-    }
-    public void setAssessor(String assessor)
-    {
-        this.assessor = assessor;
+    public String getUnsafeStatus() {
+        return unsafeStatus;
     }
 
-    public String getAssessor()
-    {
-        return assessor;
-    }
-    public void setExecutor(String executor)
-    {
-        this.executor = executor;
+    public void setUnsafeStatus(String unsafeStatus) {
+        this.unsafeStatus = unsafeStatus;
     }
 
-    public String getExecutor()
-    {
-        return executor;
-    }
-    public void setInspectors(String inspectors)
-    {
-        this.inspectors = inspectors;
+    public Date getValidateDate() {
+        return validateDate;
     }
 
-    public String getInspectors()
-    {
-        return inspectors;
-    }
-    public void setApplicantDept(String applicantDept)
-    {
-        this.applicantDept = applicantDept;
+    public void setValidateDate(Date validateDate) {
+        this.validateDate = validateDate;
     }
 
-    public String getApplicantDept()
-    {
-        return applicantDept;
-    }
-    public void setApplicantTeam(String applicantTeam)
-    {
-        this.applicantTeam = applicantTeam;
+    public String getDescription() {
+        return description;
     }
 
-    public String getApplicantTeam()
-    {
-        return applicantTeam;
-    }
-    public void setDescription(String description)
-    {
+    public void setDescription(String description) {
         this.description = description;
     }
 
-    public String getDescription()
-    {
-        return description;
-    }
-    public void setUnsafeStatus(Long unsafeStatus)
-    {
-        this.unsafeStatus = unsafeStatus;
-    }
-
-    public Long getUnsafeStatus()
-    {
-        return unsafeStatus;
-    }
-    public void setUnsafeAction(Long unsafeAction)
-    {
-        this.unsafeAction = unsafeAction;
+    public String getReaction() {
+        return reaction;
     }
 
-    public Long getUnsafeAction()
-    {
-        return unsafeAction;
-    }
-    public void setApplyDate(Date applyDate)
-    {
-        this.applyDate = applyDate;
+    public void setReaction(String reaction) {
+        this.reaction = reaction;
     }
 
-    public Date getApplyDate()
-    {
-        return applyDate;
-    }
-    public void setHandler(String handler)
-    {
-        this.handler = handler;
+    public String getExecutor() {
+        return executor;
     }
 
-    public String getHandler()
-    {
-        return handler;
-    }
-    public void setTaskId(String taskId)
-    {
-        this.taskId = taskId;
+    public void setExecutor(String executor) {
+        this.executor = executor;
     }
 
-    public String getTaskId()
-    {
-        return taskId;
-    }
-    public void setTaskName(String taskName)
-    {
-        this.taskName = taskName;
+    public Date getEstimateFinishDate() {
+        return estimateFinishDate;
     }
 
-    public String getTaskName()
-    {
-        return taskName;
-    }
-    public void setEstimateFinishDate(Date estimateFinishDate)
-    {
+    public void setEstimateFinishDate(Date estimateFinishDate) {
         this.estimateFinishDate = estimateFinishDate;
     }
 
-    public Date getEstimateFinishDate()
-    {
-        return estimateFinishDate;
-    }
-    public void setActualFinishDate(Date actualFinishDate)
-    {
-        this.actualFinishDate = actualFinishDate;
-    }
-
-    public Date getActualFinishDate()
-    {
+    public Date getActualFinishDate() {
         return actualFinishDate;
     }
-    public void setIsRecorded(String isRecorded)
-    {
-        this.isRecorded = isRecorded;
+
+    public void setActualFinishDate(Date actualFinishDate) {
+        this.actualFinishDate = actualFinishDate;
     }
 
-    public String getIsRecorded()
-    {
+    public String getIsRecorded() {
         return isRecorded;
     }
-    public void setRecordNo(String recordNo)
-    {
-        this.recordNo = recordNo;
-    }
 
-    public String getRecordNo()
-    {
-        return recordNo;
-    }
-    public void setReaction(String reaction)
-    {
-        this.reaction = reaction;
+    public void setIsRecorded(String isRecorded) {
+        this.isRecorded = isRecorded;
     }
 
-    public String getReaction()
-    {
-        return reaction;
-    }
-    public void setNeedVe(Long needVe)
-    {
-        this.needVe = needVe;
+    public String getInspectors() {
+        return inspectors;
     }
 
-    public Long getNeedVe()
-    {
-        return needVe;
-    }
-    public void setVeItems(String veItems)
-    {
-        this.veItems = veItems;
+    public void setInspectors(String inspectors) {
+        this.inspectors = inspectors;
     }
 
-    public String getVeItems()
-    {
-        return veItems;
-    }
-    public void setVeResult(String veResult)
-    {
-        this.veResult = veResult;
+    public String getApplyStatus() {
+        return applyStatus;
     }
 
-    public String getVeResult()
-    {
-        return veResult;
-    }
-    public void setRemarks(String remarks)
-    {
-        this.remarks = remarks;
+    public void setApplyStatus(String applyStatus) {
+        this.applyStatus = applyStatus;
     }
 
-    public String getRemarks()
-    {
+    public String getRemarks() {
         return remarks;
     }
-    public void setVeItemOther(String veItemOther)
-    {
-        this.veItemOther = veItemOther;
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
     }
 
-    public String getVeItemOther()
-    {
-        return veItemOther;
+    @Override
+    public String getRemark() {
+        return remark;
     }
 
     @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("saiApplyId", getSaiApplyId())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("deptId", getDeptId())
-            .append("applyStatus", getApplyStatus())
-            .append("apNo", getApNo())
-            .append("processId", getProcessId())
-            .append("applicant", getApplicant())
-            .append("assessor", getAssessor())
-            .append("executor", getExecutor())
-            .append("inspectors", getInspectors())
-            .append("applicantDept", getApplicantDept())
-            .append("applicantTeam", getApplicantTeam())
-            .append("description", getDescription())
-            .append("unsafeStatus", getUnsafeStatus())
-            .append("unsafeAction", getUnsafeAction())
-            .append("applyDate", getApplyDate())
-            .append("handler", getHandler())
-            .append("taskId", getTaskId())
-            .append("taskName", getTaskName())
-            .append("estimateFinishDate", getEstimateFinishDate())
-            .append("actualFinishDate", getActualFinishDate())
-            .append("isRecorded", getIsRecorded())
-            .append("recordNo", getRecordNo())
-            .append("reaction", getReaction())
-            .append("needVe", getNeedVe())
-            .append("veItems", getVeItems())
-            .append("veResult", getVeResult())
-            .append("remarks", getRemarks())
-            .append("veItemOther", getVeItemOther())
-            .toString();
+    public void setRemark(String remark) {
+        this.remark = remark;
     }
 }

+ 11 - 1
master/src/main/java/com/ruoyi/project/production/service/impl/TSaiApplyServiceImpl.java

@@ -3,9 +3,11 @@ package com.ruoyi.project.production.service.impl;
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.project.system.domain.SysDept;
+import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.mapper.SysDeptMapper;
 import com.ruoyi.project.system.mapper.SysUserMapper;
+import com.ruoyi.project.system.service.ISysDictTypeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.production.mapper.TSaiApplyMapper;
@@ -30,6 +32,9 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     @Autowired
     private SysUserMapper sysUserMapper;
 
+    @Autowired
+    private ISysDictTypeService iSysDictTypeService;
+
     /**
      * 查询SAI开项管理
      *
@@ -52,13 +57,18 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     public List<TSaiApply> selectTSaiApplyList(TSaiApply tSaiApply)
     {
         List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
+        List<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
         for (TSaiApply saiApply : tSaiApplies) {
             String applicantDept = saiApply.getApplicantDept();
             String applicant = saiApply.getApplicant();
             String handler = saiApply.getHandler();
             String executor = saiApply.getExecutor();
             if (applicantDept != null) {
-                saiApply.setApplicantDeptName(sysDeptMapper.selectDeptById(Long.parseLong(applicantDept)).getDeptName());
+                for (SysDictData sysDictData : staffUnitDict) {
+                    if (sysDictData.getDictValue().equals(applicantDept)) {
+                        saiApply.setApplicantDeptName(sysDictData.getDictLabel());
+                    }
+                }
             }
             if (applicant != null) {
                 saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());