Ver código fonte

筹建操作记录表

guarantee-lsq 1 ano atrás
pai
commit
7807e729bc

+ 40 - 0
platform-dao/src/main/java/com/platform/dao/dto/preparation/PreparationRecordDTO.java

@@ -0,0 +1,40 @@
+package com.platform.dao.dto.preparation;
+
+import com.platform.common.bean.BaseDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @Description 筹建管理DTO
+ * @Author xc
+ * @Date 2022-12-28 20:00:26
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = true)
+public class PreparationRecordDTO extends BaseDTO implements Serializable {
+
+    private String id;
+    /**
+     * 筹建单ID
+     */
+    private String preparationId;
+    /**
+     * 操作人
+     */
+    private String realName;
+
+    /**
+     * 同 Preparation 的 status
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 68 - 0
platform-dao/src/main/java/com/platform/dao/entity/preparation/PreparationRecord.java

@@ -0,0 +1,68 @@
+package com.platform.dao.entity.preparation;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @Description 筹建管理记录表实体类
+ * @Author xc
+ * @Date 2022-12-28 20:00:26
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "t_preparation_record")
+public class PreparationRecord implements Serializable{
+    /**
+     * 主键
+     */
+    @Id
+    private String id;
+    /**
+     * 筹建单ID
+     */
+    private String preparationId;
+    /**
+     * 操作人
+     */
+    private String realName;
+
+    /**
+     * 同 Preparation 的 status
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 创建日期
+     */
+    private LocalDateTime createdTime;
+    /**
+     * 更新日期
+     */
+    private LocalDateTime updateTime;
+    /**
+     * 创建人
+     */
+    private String createdUserId;
+    /**
+     * 创建人名称
+     */
+    private String createdUserName;
+    /**
+     * 更新人
+     */
+    private String updateUserId;
+    /**
+     * 更新人名称
+     */
+    private String updateUserName;
+
+}

+ 27 - 0
platform-dao/src/main/java/com/platform/dao/mapper/preparation/PreparationRecordMapper.java

@@ -0,0 +1,27 @@
+package com.platform.dao.mapper.preparation;
+
+import com.platform.dao.config.MyMapper;
+import com.platform.dao.dto.preparation.PreparationRecordDTO;
+import com.platform.dao.entity.preparation.PreparationRecord;
+import com.platform.dao.vo.query.preparation.PreparationRecordVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @Description 筹建管理 mapper
+ * @Author xc
+ * @Date 2022-12-28 20:00:26
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Component
+public interface PreparationRecordMapper extends MyMapper<PreparationRecord> {
+    /**
+     * 分页查询
+     * @param dto
+     * @return
+     */
+    List<PreparationRecordVO> selectList(PreparationRecordDTO dto);
+
+}

+ 39 - 0
platform-dao/src/main/java/com/platform/dao/vo/query/preparation/PreparationRecordVO.java

@@ -0,0 +1,39 @@
+package com.platform.dao.vo.query.preparation;
+
+import com.platform.common.bean.BaseVO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @Description 筹建管理VO结果类
+ * @Author xc
+ * @Date 2022-12-28 20:00:26
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = true)
+public class PreparationRecordVO extends BaseVO implements Serializable {
+    private String id;
+    /**
+     * 筹建单ID
+     */
+    private String preparationId;
+    /**
+     * 操作人
+     */
+    private String realName;
+
+    /**
+     * 同 Preparation 的 status
+     */
+    private Integer status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 2 - 1
platform-dao/src/main/resources/mapper/preparation/PreparationMapper.xml

@@ -156,7 +156,8 @@
             </foreach>
         </if>
         <if test="tempUserId != null and tempUserId != ''">
-            and (preparation.user_id = #{tempUserId} or preparation.dispatch_user_id = #{tempUserId} or preparation.repair_user_id = #{tempUserId})
+            and (preparation.user_id = #{tempUserId} or preparation.dispatch_user_id = #{tempUserId}
+            or preparation.repair_user_id = #{tempUserId} or preparation.apply_verify_user_id = #{tempUserId})
         </if>
     </sql>
     <select id="selectList" parameterType="com.platform.dao.dto.preparation.PreparationDTO"

+ 61 - 0
platform-dao/src/main/resources/mapper/preparation/PreparationRecordMapper.xml

@@ -0,0 +1,61 @@
+<?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.platform.dao.mapper.preparation.PreparationRecordMapper">
+    <sql id="List_Condition">
+        <if test="id != null and id != ''">
+            and record.id = #{id}
+        </if>
+        <if test="preparationId != null and preparationId != ''">
+            and record.preparation_id = #{preparationId}
+        </if>
+        <if test="realName != null and realName != ''">
+            and record.real_name = #{realName}
+        </if>
+        <if test="status != null ">
+            and record.status = #{status}
+        </if>
+        <if test="remark != null and remark != ''">
+            and record.remark = #{remark}
+        </if>
+        <if test="createdTimeStart != null">
+            and record.created_time <![CDATA[>=]]> #{createdTimeStart}
+        </if>
+        <if test="createdTimeEnd != null">
+            and record.created_time <![CDATA[<=]]> #{createdTimeEnd}
+        </if>
+        <if test="createdTime != null">
+            and record.created_time = #{createdTime}
+        </if>
+        <if test="updateTimeStart != null">
+            and record.update_time <![CDATA[>=]]> #{updateTimeStart}
+        </if>
+        <if test="updateTimeEnd != null">
+            and record.update_time <![CDATA[<=]]> #{updateTimeEnd}
+        </if>
+        <if test="updateTime != null">
+            and record.update_time = #{updateTime}
+        </if>
+        <if test="createdUserId != null and createdUserId != ''">
+            and record.created_user_id = #{createdUserId}
+        </if>
+        <if test="createdUserName != null and createdUserName != ''">
+            and record.created_user_name = #{createdUserName}
+        </if>
+        <if test="updateUserId != null and updateUserId != ''">
+            and record.update_user_id = #{updateUserId}
+        </if>
+        <if test="updateUserName != null and updateUserName != ''">
+            and record.update_user_name = #{updateUserName}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and record.id like concat(concat('%',#{keyword}),'%')
+        </if>
+    </sql>
+    <select id="selectList" parameterType="com.platform.dao.dto.preparation.PreparationRecordDTO"
+            resultType="com.platform.dao.vo.query.preparation.PreparationRecordVO">
+        select record.* from t_preparation_record as record
+        <where>
+            <include refid="List_Condition"/>
+        </where>
+    </select>
+</mapper>

+ 36 - 0
platform-service/src/main/java/com/platform/service/preparation/PreparationRecordService.java

@@ -0,0 +1,36 @@
+package com.platform.service.preparation;
+
+import com.platform.common.bean.AbstractPageResultBean;
+import com.platform.dao.dto.preparation.PreparationRecordDTO;
+import com.platform.dao.entity.preparation.PreparationRecord;
+import com.platform.dao.vo.query.preparation.PreparationRecordVO;
+import com.platform.service.base.IBaseService;
+
+import java.util.List;
+
+/**
+ * @Description 筹建管理 service
+ * @Author xc
+ * @Date 2022-12-28 20:00:26
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
+ */
+public interface PreparationRecordService extends IBaseService<PreparationRecord, PreparationRecordDTO> {
+
+    /**
+     * 批量删除
+     *
+     * @param ids :
+     * @return :
+     */
+    int batchDelete(List<String> ids);
+
+    /**
+     * 分页查询
+     *
+     * @param record
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    AbstractPageResultBean<PreparationRecordVO> selectPageList(PreparationRecordDTO record, int pageNum, int pageSize);
+}

+ 45 - 0
platform-service/src/main/java/com/platform/service/preparation/impl/PreparationRecordServiceImpl.java

@@ -0,0 +1,45 @@
+package com.platform.service.preparation.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.platform.common.bean.AbstractPageResultBean;
+import com.platform.dao.bean.MyPage;
+import com.platform.dao.dto.preparation.PreparationRecordDTO;
+import com.platform.dao.entity.preparation.PreparationRecord;
+import com.platform.dao.mapper.preparation.PreparationRecordMapper;
+import com.platform.dao.vo.query.preparation.PreparationRecordVO;
+import com.platform.service.base.impl.BaseServiceImpl;
+import com.platform.service.preparation.PreparationRecordService;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.weekend.Weekend;
+import tk.mybatis.mapper.weekend.WeekendCriteria;
+
+import java.util.List;
+
+/**
+ * @Description 筹建管理 service 实现类
+ * @Author xc
+ * @Date 2022-12-28 20:00:26
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Service("preparationRecordService")
+public class PreparationRecordServiceImpl extends BaseServiceImpl<PreparationRecordMapper, PreparationRecord, PreparationRecordDTO> implements PreparationRecordService {
+
+
+    @Override
+    public int batchDelete(List<String> ids) {
+        Weekend<PreparationRecord> weekend = new Weekend<>(PreparationRecord.class);
+        WeekendCriteria<PreparationRecord, Object> weekendCriteria = weekend.weekendCriteria();
+        weekendCriteria.andIn(PreparationRecord::getId, ids);
+        mapper.deleteByExample(weekend);
+        return 1;
+    }
+
+    @Override
+    public AbstractPageResultBean<PreparationRecordVO> selectPageList(PreparationRecordDTO record, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        return new MyPage(mapper.selectList(record));
+    }
+}
+
+
+

+ 8 - 12
platform-service/src/main/java/com/platform/service/preparation/impl/PreparationServiceImpl.java

@@ -4,15 +4,12 @@ import com.github.pagehelper.PageHelper;
 import com.platform.common.bean.AbstractPageResultBean;
 import com.platform.common.cache.ConfigCache;
 import com.platform.common.cache.DictCache;
-import com.platform.common.constant.CommonConstants;
 import com.platform.common.exception.DeniedException;
 import com.platform.common.model.UserInfo;
 import com.platform.common.util.*;
 import com.platform.dao.bean.MyPage;
 import com.platform.dao.dto.preparation.PreparationDTO;
-import com.platform.dao.dto.repair.RepairRecordTemplateData;
 import com.platform.dao.dto.upms.SysUserDTO;
-import com.platform.dao.entity.customize.CustomFieldTemplateData;
 import com.platform.dao.entity.preparation.Preparation;
 import com.platform.dao.entity.sb.SbPosition;
 import com.platform.dao.entity.upms.SysFile;
@@ -27,10 +24,8 @@ import com.platform.dao.util.MessageTemplateUtil;
 import com.platform.dao.vo.SysUserRoleVO;
 import com.platform.dao.vo.SysUserVO;
 import com.platform.dao.vo.query.preparation.PreparationVO;
-import com.platform.dao.vo.repair.RepairApplicationFormVO;
 import com.platform.dao.vo.report.AllPreparationReportVO;
 import com.platform.dao.vo.report.PreparationReportByStatusVO;
-import com.platform.dao.vo.report.RepairReport24VO;
 import com.platform.service.base.impl.BaseServiceImpl;
 import com.platform.service.event.WorkplaceBacklogEvent;
 import com.platform.service.preparation.PreparationService;
@@ -252,16 +247,17 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
     @Override
     public AbstractPageResultBean<PreparationVO> selectPageList(PreparationDTO record, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        if(record.getSearchType() != null){
-            UserInfo userInfo = SecurityUtils.getUserInfo();
-            record.setTempUserId(userInfo.getUserId());
+        UserInfo userInfo = SecurityUtils.getUserInfo();
+        record.setTempUserId(userInfo.getUserId());
+        if(record.getSearchType() != null && record.getStatus() == null){
             List<Integer> statusList = new ArrayList<>();
             if(record.getSearchType() == 1){ // 我的工单
                 statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
                 statusList.add(PreparationStatusEnum.PROCESSING.getValue());
                 statusList.add(PreparationStatusEnum.FINISHED.getValue());
-            }else if(record.getSearchType() == 2){ // 待派工单
-                statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
+            }else if(record.getSearchType() == 2){ // 待接工单
+                statusList.add(PreparationStatusEnum.VERIFY_SUCCESS.getValue());
+                record.setTempUserId(null);
             }
             // 超级管理员可以看到各个状态下的所有数据 相关领导,可以在这里进行设置
             if(userInfo.getSuperAdmin() == 1 || record.getSearchType() == -1){
@@ -393,9 +389,9 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
         PageHelper.startPage(pageNum, pageSize);
         UserInfo userInfo = SecurityUtils.getUserInfo();
         record.setTempUserId(userInfo.getUserId());
-        if(record.getStatus() != null && record.getStatus() == -1){
+        /*if(record.getStatus() != null && record.getStatus() == -1){
             record.setStatus(null);
-        }
+        }*/
         return new MyPage(mapper.selectList(record));
     }