2 năm trước cách đây
mục cha
commit
e2b791027d

+ 0 - 1
platform-dao/src/main/java/com/platform/dao/dto/repair/RepairApplicationFormDTO.java

@@ -24,7 +24,6 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class RepairApplicationFormDTO extends BaseDTO implements Serializable {
-    private Integer exceptStatus;
 
     private String deptId;
 

+ 72 - 0
platform-dao/src/main/java/com/platform/dao/vo/export/sb/ExportSbInfoDetailVO.java

@@ -0,0 +1,72 @@
+package com.platform.dao.vo.export.sb;
+
+import com.platform.office.annotation.Excel;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * @Description 设备基础信息导出VO
+ * @Author liuyu
+ * @Date 2021-04-21 21:05:46
+ * @Version Copyright (c) 2021,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+public class ExportSbInfoDetailVO implements Serializable {
+
+
+    /**
+     * 设备编号
+     */
+    @Excel(name = "设备编号")
+    private String no;
+    /**
+     * 设备位号
+     */
+    @Excel(name = "设备位号(必填)")
+    private String positionNo;
+
+    /**
+     * 设备名称
+     */
+    @Excel(name = "设备名称(必填)")
+    private String name;
+    /**
+     * 设备名称
+     */
+    @Excel(name = "设备型号(必填)")
+    private String model;
+    /**
+     * 设备位号
+     */
+    @Excel(name = "父位号")
+    private String ppNo;
+    /**
+     * 设备等级
+     */
+    @Excel(name = "设备等级(必填;1:A级;2:B级;3:C级)")
+    private Integer level;
+
+    /**
+     * 设备类别
+     */
+    @Excel(name = "设备类别(必填)")
+    private String typeName;
+
+    /**
+     * 设备位置
+     */
+    @Excel(name = "设备位置")
+    private String positionName;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态(必填;1在库;2使用中;7停用中)")
+    private Integer status;
+
+
+}

+ 6 - 0
platform-dao/src/main/java/com/platform/dao/vo/sb/SbInfoVO.java

@@ -25,6 +25,12 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class SbInfoVO extends BaseVO implements Serializable {
+    private String parentSbTypeName;
+    private String sbTypeName;
+    private String ParentPositionName;
+    private String positionNameStr;
+
+    private String sbTypeStr;
 
     private String sortNum;
     /**

+ 0 - 3
platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml

@@ -126,9 +126,6 @@
             <if test="repairFormType!=null and repairFormType!=''">
                 and application.repair_form_type=#{repairFormType}
             </if>
-            <if test="exceptStatus!=null">
-                application.status!=#{exceptStatus}
-            </if>
         </where>
     </select>
     <select id="selectById" parameterType="java.lang.Object"

+ 5 - 1
platform-dao/src/main/resources/mapper/sb/SbInfoMapper.xml

@@ -153,6 +153,7 @@ sb.param_list,
         sb.use_type as useType,
         sbType.name as typeName,
         position.name as positionName,
+        parent.name as parentPositionName,
         sb.check_date,
         sb.check_period,
         sb.register_no,
@@ -172,7 +173,8 @@ sb.apply_time,
                                      sb.remark,
                                      sb.apply_comment,
 sb.scrap_user_id,
-sb.scrap_user_name,sb.repair_dept_id,sb.sort_num
+sb.scrap_user_name,sb.repair_dept_id,sb.sort_num,
+sbType.name as sbTypeName,parentSbType.name as parentSbTypeName
     </sql>
 
     <sql id="deptSql">
@@ -621,6 +623,8 @@ sb.scrap_user_name,sb.repair_dept_id,sb.sort_num
         from t_sb_info sb
         left join t_sb_type sbType on sb.type_id = sbType.id
         left join t_sb_position position on sb.position_id = position.id
+        left join t_sb_type parentSbType on parentSbType.id = sbType.parentId
+        left join t_sb_position parentPosition on parentPosition.id = position.parent_id
         where sb.id = #{value}
     </select>
     <select id="getByNo" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoVO">

+ 16 - 0
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoController.java

@@ -12,6 +12,7 @@ import com.platform.dao.entity.sb.SbInfo;
 import com.platform.dao.enums.SysRoleCodeEnum;
 import com.platform.dao.util.ExcelUtil;
 import com.platform.dao.util.TreeUtil;
+import com.platform.dao.vo.export.sb.ExportSbInfoDetailVO;
 import com.platform.dao.vo.export.sb.ExportSbInfoMeasureVO;
 import com.platform.dao.vo.export.sb.ExportSbInfoVO;
 import com.platform.dao.vo.sb.SbInfoVO;
@@ -539,4 +540,19 @@ public class SbInfoController {
         return new R<>(sbInfoService.getRepairProfessorBySbId(id));
     }
 
+    /**
+     * 设备类型占比统计导出设备明细
+     * @param id
+     * @return
+     */
+    @GetMapping("/export/sb/detail")
+    @SysLog("设备基础信息导出")
+    @PreAuthorize("@pms.hasPermission('sb-infos-export')")
+    public void exportSbDetail(HttpServletResponse response, SbInfoDTO sbInfoDTO) {
+        List<SbInfoVO> list = sbInfoService.selectVOList(sbInfoDTO);
+        ExcelUtil.exportResponseDict(response, ExportSbInfoDetailVO.class, BeanConverterUtil.copyListProperties(list, ExportSbInfoVO.class), "设备基础信息");
+    }
+
+
+
 }

+ 7 - 1
platform-service/src/main/java/com/platform/service/fill/impl/FillGatherTaskServiceImpl.java

@@ -70,6 +70,9 @@ public class FillGatherTaskServiceImpl extends BaseServiceImpl<FillGatherTaskMap
 
     private void deleteDetails(List<String> detailIds,String taskId){
         StringBuilder ids = new StringBuilder();
+        Weekend<FillGatherTaskDetail> weekend = new Weekend<>(FillGatherTaskDetail.class);
+        WeekendCriteria<FillGatherTaskDetail,Object> weekendCriteria = weekend.weekendCriteria();
+        List<String> deleteIds = new ArrayList<>();
         for(int i=0;i<detailIds.size();i++){
             String id = detailIds.get(i);
             // 判断是否已填报,未填报的设备不允许删除
@@ -79,8 +82,11 @@ public class FillGatherTaskServiceImpl extends BaseServiceImpl<FillGatherTaskMap
             FillGatherTaskDetail detail = new FillGatherTaskDetail();
             detail.setId(detailIds.get(i));
             ids.append(detail.getId()).append("&");
-            fillGatherTaskDetailMapper.deleteByPrimaryKey(detail);
+            deleteIds.add(detail.getId());
+//            fillGatherTaskDetailMapper.deleteByPrimaryKey(detail);
         }
+        weekendCriteria.andIn(FillGatherTaskDetail::getId,deleteIds);
+        fillGatherTaskDetailMapper.deleteByExample(weekend);
         // 将redis缓存中的集合进行一个删除
         String idString = ids.toString();
         List<FillGatherTaskDetailVO> list = RedisUtils.getList(taskId,0,-1);

+ 0 - 1
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -583,7 +583,6 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 }else if(record.getSearchType() == 6){ // 报修审批-生产--暂时废弃
                     statusList.add(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
                 }else if(record.getSearchType() == -1){ // 全部工单
-                        record.setExceptStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_CANCEL.getValue());
                     if(record.getStatus() != null){
                         statusList.add(record.getStatus());
                     }

+ 13 - 0
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -1800,6 +1800,19 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
     @Override
     public SbInfoVO getById(Object id) {
         SbInfoVO vo = mapper.getById(id);
+        if (vo!=null) {
+            if (vo.getParentPositionName() == null) {
+                vo.setPositionNameStr(vo.getPositionName());
+            } else {
+                vo.setPositionNameStr(vo.getParentPositionName() + "->" + vo.getPositionName());
+            }
+            if (vo.getParentSbTypeName() == null) {
+                vo.setSbTypeStr(vo.getSbTypeName());
+            } else {
+                vo.setSbTypeStr(vo.getParentSbTypeName()+"->"+vo.getSbTypeName());
+            }
+        }
+
         /*if (StringUtils.isNotBlank(vo.getParentId())) {
             SbInfoVO parentVo = mapper.getById(vo.getParentId());
             vo.setParentSbName(parentVo.getName());