ソースを参照

异常管理添加增加采购发起人及发起人筛选

yzc 1 年間 前
コミット
0b1235b90a

+ 12 - 3
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/entity/abnormal/dto/AbnormalInfoSelectDto.java

@@ -7,16 +7,25 @@ import lombok.Setter;
 /**
  * 异常记录列表查询入参实体
  *
- * @author 
+ * @author
  * @since 2023-04-11
  */
 @Getter
 @Setter
 public class AbnormalInfoSelectDto extends BaseSelectDto {
 
-    /**异常类型*/
+    /**
+     * 异常类型
+     */
     private Integer type;
-    /**异常状态*/
+    /**
+     * 异常状态
+     */
     private Integer status;
 
+    /**
+     * 采购人id
+     */
+    private Long purchaseUserId;
+
 }

+ 17 - 2
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/entity/abnormal/vo/AbnormalInfoVo.java

@@ -7,14 +7,29 @@ import lombok.Setter;
 /**
  * 异常记录列表查询返回值实体
  *
- * @author 
+ * @author
  * @since 2023-04-11
  */
 @Getter
 @Setter
 public class AbnormalInfoVo extends AbnormalInfo {
 
-    /**最近处理人*/
+    /**
+     * 最近处理人
+     */
     private String handleUserName;
 
+    /**
+     * 采购人id
+     */
+    private Long purchaseUserId;
+    /**
+     * 采购人名称
+     */
+    private String purchaseUserName;
+    /**
+     * 创建人名称
+     */
+    private String createUserName;
+
 }

+ 15 - 8
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/abnormal/impl/AbnormalInfoServiceImpl.java

@@ -1,18 +1,18 @@
 package com.fjhx.victoriatourist.service.abnormal.impl;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.victoriatourist.entity.abnormal.dto.AbnormalInfoSelectDto;
 import com.fjhx.victoriatourist.entity.abnormal.po.AbnormalInfo;
+import com.fjhx.victoriatourist.entity.abnormal.vo.AbnormalInfoVo;
 import com.fjhx.victoriatourist.mapper.abnormal.AbnormalInfoMapper;
 import com.fjhx.victoriatourist.service.abnormal.AbnormalInfoService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.SqlField;
 import com.ruoyi.system.utils.UserUtil;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.victoriatourist.entity.abnormal.vo.AbnormalInfoVo;
-import com.fjhx.victoriatourist.entity.abnormal.dto.AbnormalInfoSelectDto;
-import com.ruoyi.common.utils.wrapper.IWrapper;
 
 
 /**
@@ -20,7 +20,7 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
  * 异常记录 服务实现类
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-11
  */
 @DS(SourceConstant.VICTORIATOURIST)
@@ -32,6 +32,9 @@ public class AbnormalInfoServiceImpl extends ServiceImpl<AbnormalInfoMapper, Abn
         IWrapper<AbnormalInfo> wrapper = getWrapper();
         wrapper.eq(AbnormalInfo::getType, dto.getType())
                 .eq(AbnormalInfo::getStatus, dto.getStatus());
+
+        //采购人id过滤
+        wrapper.eq("p.create_user", dto.getPurchaseUserId());
         wrapper.keyword(dto.getKeyword(),
                 new SqlField(AbnormalInfo::getTitle),
                 new SqlField(AbnormalInfo::getLinkCode)
@@ -39,8 +42,12 @@ public class AbnormalInfoServiceImpl extends ServiceImpl<AbnormalInfoMapper, Abn
 
         wrapper.orderByDesc("ai", AbnormalInfo::getId);
         Page<AbnormalInfoVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
-        //赋值最近操作人
-        UserUtil.assignmentNickName(page.getRecords(),AbnormalInfo::getUpdateUser,AbnormalInfoVo::setHandleUserName);
+        //赋值创建人名称
+        UserUtil.assignmentNickName(page.getRecords(), AbnormalInfo::getCreateUser, AbnormalInfoVo::setCreateUserName);
+        //赋值跟进人名称
+        UserUtil.assignmentNickName(page.getRecords(), AbnormalInfo::getHandleUser, AbnormalInfoVo::setHandleUserName);
+        //赋值采购人名称
+        UserUtil.assignmentNickName(page.getRecords(), AbnormalInfoVo::getPurchaseUserId, AbnormalInfoVo::setPurchaseUserName);
         return page;
     }
 

+ 3 - 1
hx-victoriatourist/src/main/resources/mapper/abnormal/AbnormalInfoMapper.xml

@@ -15,8 +15,10 @@
             ai.create_user,
             ai.create_time,
             ai.update_user,
-            ai.update_time
+            ai.update_time,
+            p.create_user purchaseUserId
         from abnormal_info ai
+            left JOIN bytesailing_purchase.purchase p ON ai.link_id = p.id
             ${ew.customSqlSegment}
     </select>