Browse Source

仓库报表

3254194295 2 years ago
parent
commit
1de462380f

+ 4 - 0
platform-dao/src/main/java/com/platform/dao/dto/workplace/WorkplaceBacklogUserDTO.java

@@ -18,6 +18,10 @@ import java.time.LocalDateTime;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class WorkplaceBacklogUserDTO extends BaseDTO implements Serializable {
+    /**
+     * 部门类型
+     */
+    private String deptType;
 
     private String id;
     /**

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/entity/workplace/WorkplaceBacklog.java

@@ -65,6 +65,7 @@ public class WorkplaceBacklog implements Serializable {
     /**
      * 状态
      */
+    @Transient
     private Integer status;
     /**
      * 创建时间

+ 4 - 0
platform-dao/src/main/java/com/platform/dao/entity/workplace/WorkplaceBacklogUser.java

@@ -1,5 +1,6 @@
 package com.platform.dao.entity.workplace;
 
+import com.platform.dao.enums.WorkplaceBacklogStatusEnum;
 import lombok.Data;
 
 import javax.persistence.Table;
@@ -28,6 +29,8 @@ public class WorkplaceBacklogUser implements Serializable {
      */
     private String backlogId;
 
+    private Integer status;
+
     /**
      * 创建时间
      */
@@ -42,5 +45,6 @@ public class WorkplaceBacklogUser implements Serializable {
         this.userId = userId;
         this.backlogId = backlogId;
         this.createdTime = createdTime;
+        this.status = WorkplaceBacklogStatusEnum.WORKPLACE_BACKLOG_STATUS_WAITING.getValue();
     }
 }

+ 7 - 0
platform-dao/src/main/java/com/platform/dao/mapper/workplace/WorkplaceBacklogMapper.java

@@ -2,7 +2,9 @@ package com.platform.dao.mapper.workplace;
 
 import com.platform.dao.config.MyMapper;
 import com.platform.dao.dto.workplace.WorkplaceBacklogDTO;
+import com.platform.dao.dto.workplace.WorkplaceBacklogUserDTO;
 import com.platform.dao.entity.workplace.WorkplaceBacklog;
+import com.platform.dao.vo.query.workplace.WorkplaceBacklogUserVO;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -31,4 +33,9 @@ public interface WorkplaceBacklogMapper extends MyMapper<WorkplaceBacklog> {
      * @param loanId
      */
     void updateLiquidateTask(String loanId);
+
+    List<WorkplaceBacklogUserVO> queryNew(WorkplaceBacklogUserDTO model);
+
 }
+
+

+ 39 - 0
platform-dao/src/main/resources/mapper/workplace/WorkplaceBacklogMapper.xml

@@ -44,4 +44,43 @@
           and task.loan_id = #{loanId}
           and type = 4
     </update>
+
+    <select id="queryNew" resultType="com.platform.dao.vo.query.workplace.WorkplaceBacklogUserVO"
+            parameterType="com.platform.dao.dto.workplace.WorkplaceBacklogUserDTO">
+        select bu.id as id,
+        bu.user_id as userId,
+        bu.created_time as createdTime,
+        b.id as backlog_id,
+        b.content as content,
+        b.task_create_time as taskCreateTime,
+        b.detail_type as detailType,
+        b.type as type,
+        b.other_id as otherId,
+        b.target_id as targetId,
+        bu.status FROM t_workplace_backlog b JOIN `t_workplace_backlog_user` bu ON
+        b.id = bu.`backlog_id`
+        <where>
+<!--            <if test="deptType != null and deptType != ''">-->
+<!--                and b.dept_type = #{deptType}-->
+<!--            </if>-->
+<!--            <if test="types != null">-->
+<!--                AND b.type in-->
+<!--                <foreach item="item" index="index" collection="types" open="(" close=")" separator=",">-->
+<!--                    #{item}-->
+<!--                </foreach>-->
+<!--            </if>-->
+            <if test="type != null">
+                and b.type = #{type}
+            </if>
+            <if test="status != null">
+                and bu.status = #{status}
+            </if>
+            <if test="content != null and content != ''">
+                and bu.content = #{content}
+            </if>
+            <if test="userId!=null">
+                and bu.user_id=#{userId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 11 - 5
platform-service/src/main/java/com/platform/service/workplace/impl/WorkplaceBacklogServiceImpl.java

@@ -117,10 +117,15 @@ public class WorkplaceBacklogServiceImpl extends BaseServiceImpl<WorkplaceBacklo
         if (log == null) {
             throw new BusinessException(ResultCode.DATA_NOT_EXIST);
         }
-//        WorkplaceBacklogUser logUser = new WorkplaceBacklogUser(IdGeneratorUtils.getObjectId(), SecurityUtils.getUser().getId(), log.getId(), LocalDateTime.now());
-//        workplaceBacklogUserMapper.insert(logUser);
-        log.setStatus(WorkplaceBacklogStatusEnum.WORKPLACE_BACKLOG_STATUS_END.getValue());
-        mapper.updateByPrimaryKeySelective(log);
+        WorkplaceBacklogUser queryUser = new WorkplaceBacklogUser();
+        queryUser.setUserId(SecurityUtils.getUserInfo().getUserId());
+        queryUser.setBacklogId(id);
+        WorkplaceBacklogUser logUser = workplaceBacklogUserMapper.selectOne(queryUser);
+        String userLogId = logUser.getId();
+        logUser = new WorkplaceBacklogUser();
+        logUser.setId(userLogId);
+        logUser.setStatus(WorkplaceBacklogStatusEnum.WORKPLACE_BACKLOG_STATUS_END.getValue());
+        workplaceBacklogUserMapper.updateByPrimaryKeySelective(logUser);
     }
 
     @Override
@@ -153,7 +158,8 @@ public class WorkplaceBacklogServiceImpl extends BaseServiceImpl<WorkplaceBacklo
         PageHelper.startPage(pageNum, pageSize);
         String userId = SecurityUtils.getUserInfo().getUserId();
         model.setUserId(userId);
-        return new MyVOPage<>(workplaceBacklogUserMapper.selectByUser(model));
+        return new MyVOPage<>(mapper.queryNew(model));
+        //return new MyVOPage<>(workplaceBacklogUserMapper.selectByUser(model));
     }
 
 }