Browse Source

Merge remote-tracking branch 'origin/sit' into sit

liudongzhi 2 months ago
parent
commit
66990cdf9f

+ 5 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreStaffConfig.java

@@ -144,4 +144,9 @@ public class StoreStaffConfig extends Model<StoreStaffConfig> {
     @ApiModelProperty(value = "平均评分(1-5星,支持0.5星)")
     @TableField("service_score")
     private java.math.BigDecimal serviceScore;
+
+    @ApiModelProperty(value = "审核时间")
+    @TableField("audit_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date auditTime;
 }

+ 8 - 0
alien-entity/src/main/java/shop/alien/entity/store/dto/StoreStaffConfigListQueryDto.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * 商家端-员工列表查询 DTO(QueryString 绑定)
  */
@@ -33,6 +35,12 @@ public class StoreStaffConfigListQueryDto {
 
     @ApiModelProperty(value = "员工名称")
     private String staffName;
+
+    @ApiModelProperty(value = "创建时间开始(yyyy-MM-dd HH:mm:ss)")
+    private Date startCreatedTime;
+
+    @ApiModelProperty(value = "创建时间结束(yyyy-MM-dd HH:mm:ss)")
+    private Date endCreatedTime;
 }
 
 

+ 2 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreStaffConfigController.java

@@ -54,6 +54,8 @@ public class StoreStaffConfigController {
             @ApiImplicitParam(name = "onlineStatus", value = "上线状态(0-上线 1-下线)", dataType = "Integer", paramType = "query", required = false),
             @ApiImplicitParam(name = "staffPosition", value = "职位", dataType = "String", paramType = "query", required = false),
             @ApiImplicitParam(name = "staffName", value = "员工姓名", dataType = "String", paramType = "query", required = false),
+            @ApiImplicitParam(name = "startCreatedTime", value = "创建时间开始(yyyy-MM-dd HH:mm:ss)", dataType = "String", paramType = "query", required = false),
+            @ApiImplicitParam(name = "endCreatedTime", value = "创建时间结束(yyyy-MM-dd HH:mm:ss)", dataType = "String", paramType = "query", required = false),
     })
     @GetMapping("/getStaffConfigList")
     public R<IPage<StoreStaffConfig>> getStaffConfigList(StoreStaffConfigListQueryDto query) {

+ 5 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffAuditAsyncService.java

@@ -12,6 +12,7 @@ import shop.alien.store.util.ai.AiContentModerationUtil;
 import shop.alien.store.util.ai.AiVideoModerationUtil;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -130,6 +131,8 @@ public class StoreStaffAuditAsyncService {
             if (allPassed) {
                 // AI审核通过,状态设置为"审核通过"(1),明确清空拒绝原因
                 updateWrapper.set(StoreStaffConfig::getStatus, "1")
+                             .set(StoreStaffConfig::getAuditTime, new Date())
+                             .set(StoreStaffConfig::getOnlineStatus,0)
                              .set(StoreStaffConfig::getRejectionReason, null);
                 storeStaffConfigMapper.update(null, updateWrapper);
                 log.info("人员AI审核通过,状态设置为审核通过,已清空拒绝原因:staffId={}", staffId);
@@ -151,6 +154,7 @@ public class StoreStaffAuditAsyncService {
 
                 String reason = failureReasons.isEmpty() ? "审核未通过" : String.join("; ", failureReasons);
                 updateWrapper.set(StoreStaffConfig::getStatus, "2")
+                             .set(StoreStaffConfig::getAuditTime, new Date())
                              .set(StoreStaffConfig::getRejectionReason, reason);
                 storeStaffConfigMapper.update(null, updateWrapper);
                 log.warn("人员AI审核失败,状态设置为审核拒绝:staffId={}, reason={}", staffId, reason);
@@ -164,6 +168,7 @@ public class StoreStaffAuditAsyncService {
                 StoreStaffConfig auditUpdate = new StoreStaffConfig();
                 auditUpdate.setId(staffId);
                 auditUpdate.setStatus("2");
+                auditUpdate.setAuditTime(new Date());
                 auditUpdate.setRejectionReason("审核系统异常,请稍后重试");
                 storeStaffConfigMapper.updateById(auditUpdate);
             } catch (Exception updateException) {

+ 11 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -114,6 +114,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
         Integer onlineStatus = query == null ? null : query.getOnlineStatus();
         String staffPosition = query == null ? null : query.getStaffPosition();
         String staffName = query == null ? null : query.getStaffName();
+        Date startCreatedTime = query == null ? null : query.getStartCreatedTime();
+        Date endCreatedTime = query == null ? null : query.getEndCreatedTime();
 
         IPage<StoreStaffConfig> storePage = new Page<>(page, size);
         if (storeId == null) {
@@ -123,8 +125,15 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
         queryWrapper.like(null != status && !status.isEmpty(), "status", status);
         queryWrapper.eq(onlineStatus != null, "online_status", onlineStatus);
         queryWrapper.eq("store_id", storeId);
-        queryWrapper.eq(StringUtils.isNotEmpty(staffPosition), "staff_position", staffPosition);
-        queryWrapper.eq(StringUtils.isNotEmpty(staffName), "name", staffName);
+        queryWrapper.like(StringUtils.isNotEmpty(staffPosition), "staff_position", staffPosition);
+        queryWrapper.like(StringUtils.isNotEmpty(staffName), "name", staffName);
+        // 创建时间范围查询
+        if (startCreatedTime != null) {
+            queryWrapper.ge("created_time", startCreatedTime);
+        }
+        if (endCreatedTime != null) {
+            queryWrapper.le("created_time", endCreatedTime);
+        }
         // 只查询未删除的记录
         queryWrapper.eq("delete_flag", 0);
         // 排序规则:先按置顶状态降序(置顶的在前),再按置顶时间降序,最后按创建时间降序