Commit 222378e8 by zhouhaibao

Merge branch 'main' of http://192.168.3.233:8090/dj/rpc-dj-supervisor

# Conflicts:
#	rpc-dj-supervisor/pom.xml
2 parents dbde0fdc 6e4b2d3b
Showing 25 changed files with 710 additions and 25 deletions
...@@ -27,6 +27,9 @@ public class AudioReceptionDTO implements Serializable { ...@@ -27,6 +27,9 @@ public class AudioReceptionDTO implements Serializable {
@ApiModelProperty(notes = "客户手机号") @ApiModelProperty(notes = "客户手机号")
private String phoneNumber; private String phoneNumber;
@ApiModelProperty(notes = "员工手机号")
private String staffPhone;
@ApiModelProperty(notes = "门店商户号") @ApiModelProperty(notes = "门店商户号")
private String merchantNo; private String merchantNo;
...@@ -49,8 +52,8 @@ public class AudioReceptionDTO implements Serializable { ...@@ -49,8 +52,8 @@ public class AudioReceptionDTO implements Serializable {
@ApiModelProperty(notes = "录音结束时间") @ApiModelProperty(notes = "录音结束时间")
private Date endTime; // 录音结束时间 private Date endTime; // 录音结束时间
@ApiModelProperty(notes = "总耗时时长") @ApiModelProperty(notes = "总耗时时长,秒")
private Long totalDuration; private String totalDuration;
@ApiModelProperty(notes = "车型") @ApiModelProperty(notes = "车型")
private String carModel; private String carModel;
...@@ -60,6 +63,18 @@ public class AudioReceptionDTO implements Serializable { ...@@ -60,6 +63,18 @@ public class AudioReceptionDTO implements Serializable {
@ApiModelProperty(notes = "复盘状态,0-未复盘,1-已复盘") @ApiModelProperty(notes = "复盘状态,0-未复盘,1-已复盘")
private Integer reviewStatus; private Integer reviewStatus;
/**
* 录音标签
*/
@ApiModelProperty(notes = "录音标签")
private String reviewTarget;
/**
* 录音复盘内容
*/
@ApiModelProperty(notes = "录音复盘内容")
private String reviewContent;
@ApiModelProperty(notes = "录音批次id") @ApiModelProperty(notes = "录音批次id")
private Integer batchId; private Integer batchId;
......
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 督导管理汇总数据 DTO
*
* @author xiehx
* @date 2026-03-12
*/
@Data
public class SupervisorManageSummaryDTO implements Serializable {
/**
* 在职督导总人数
*/
@ApiModelProperty(notes = "在职督导总人数")
private Integer totalCount;
/**
* 管理门店总数(所有督导负责的门店去重后的总数)
*/
@ApiModelProperty(notes = "管理门店总数")
private Integer managedStoreCount;
/**
* 本月总产值(单位:万,保留1位小数)
*/
@ApiModelProperty(notes = "本月总产值(单位:万,保留1位小数)")
private BigDecimal monthlyOutput;
}
...@@ -26,7 +26,7 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -26,7 +26,7 @@ public class SupervisorTaskDTO implements Serializable {
private Long id; private Long id;
@NotNull(message = "日报类型不能为空") @NotNull(message = "日报类型不能为空")
@ApiModelProperty(notes = "日报类型 0-日报 1-周报,2-月报, 3-录音", required = true) @ApiModelProperty(notes = "日报类型 0-日报 1-周报,2-月报, 3-录音,4-专项,5-带教", required = true)
private Integer taskType; private Integer taskType;
@ApiModelProperty(notes = "任务状态 0-待完成 1-进行中,2-已完成") @ApiModelProperty(notes = "任务状态 0-待完成 1-进行中,2-已完成")
...@@ -37,12 +37,11 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -37,12 +37,11 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "在岗标识 0-在岗 1-调休(日报)") @ApiModelProperty(notes = "在岗标识 0-在岗 1-调休(日报)")
private Integer onDutyFlag; private Integer onDutyFlag;
@NotNull(groups = {SupervisorTaskInfoRemote.SubmitDayTask.class}, message = "门店ID不能为空")
@ApiModelProperty(notes = "门店ID") @ApiModelProperty(notes = "门店ID")
private Integer merchantId; private Integer merchantId;
@NotEmpty(groups = {SupervisorTaskInfoRemote.SubmitDayTask.class}, message = "门店名称不能为空")
@ApiModelProperty(notes = "门店名称") @ApiModelProperty(notes = "门店名称")
private String merchantName; private String merchantName;
...@@ -97,8 +96,10 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -97,8 +96,10 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "更新时间") @ApiModelProperty(notes = "更新时间")
private Date updatedDate; private Date updatedDate;
@ApiModelProperty(notes = "更新人")
private String updatedBy; private String updatedBy;
@ApiModelProperty(notes = "更新人手机号")
private String updatedPhone; private String updatedPhone;
/** /**
...@@ -108,7 +109,7 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -108,7 +109,7 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "周任务人员列表") @ApiModelProperty(notes = "周任务人员列表")
private List<SupervisorWeekTaskStaff> weekTaskStaffList; private List<SupervisorWeekTaskStaff> weekTaskStaffList;
@NotEmpty(groups = {SupervisorTaskInfoRemote.SubmitDayTask.class, SupervisorTaskInfoRemote.SubmitWeekTask.class}, message = "照片图片列表不能为空") @NotEmpty(groups = {SupervisorTaskInfoRemote.SubmitWeekTask.class}, message = "照片图片列表不能为空")
@ApiModelProperty(notes = "照片图片列表") @ApiModelProperty(notes = "照片图片列表")
private List<SupervisorTaskImage> taskImageList; private List<SupervisorTaskImage> taskImageList;
......
...@@ -28,4 +28,25 @@ public class SupervisorTaskQueryDTO implements Serializable { ...@@ -28,4 +28,25 @@ public class SupervisorTaskQueryDTO implements Serializable {
@ApiModelProperty(notes = "任务状态 0-待完成 1-进行中,2-已完成") @ApiModelProperty(notes = "任务状态 0-待完成 1-进行中,2-已完成")
private Integer taskStatus; private Integer taskStatus;
@ApiModelProperty(notes = "更新人")
private String updatedBy;
/**
* 计算录音详情标识, 0-计算,1-不计算
*/
private int calculateAudioDetailFlag;
@ApiModelProperty(notes = "督导管理的门店id列表")
private List<Integer> merchantIdList;
@ApiModelProperty(notes = "督导管理的员工手机号列表")
private List<String> staffPhoneList;
/**
* 接待结果 1.成交 0.战败
*/
private Integer receptionStatus;
} }
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class SupervisorTaskSummaryDTO implements Serializable {
/**
* 总人数
*/
@ApiModelProperty(notes = "督导总人数")
private Integer totalCount;
/**
* 提交任务人数
*/
@ApiModelProperty(notes = "提交任务人数")
private Integer submittedCount;
/**
* 提交任务数
*/
@ApiModelProperty(notes = "提交任务数")
private Integer submittedTaskCount;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class SupervisorTeamOverviewDTO implements Serializable {
/**
* 团队员工个数
*/
@ApiModelProperty(notes = "团队员工个数")
private Integer staffCount;
/**
* 门店数量
*/
@ApiModelProperty(notes = "门店数量")
private Integer shopCount;
/**
* 总产值
*/
@ApiModelProperty(notes = "总产值")
private BigDecimal totalValue;
}
...@@ -26,7 +26,7 @@ public class SupervisorAudioReviewInfo implements Serializable { ...@@ -26,7 +26,7 @@ public class SupervisorAudioReviewInfo implements Serializable {
* 关联接待记录id(inspection_conversation_batch.id) * 关联接待记录id(inspection_conversation_batch.id)
*/ */
@Column(name = "reception_id") @Column(name = "reception_id")
private Long receptionId; private Integer receptionId;
/** /**
* 关联任务id(supervisor_task_info.id) * 关联任务id(supervisor_task_info.id)
......
...@@ -38,7 +38,7 @@ public class SupervisorWarningBaselineConfig implements Serializable { ...@@ -38,7 +38,7 @@ public class SupervisorWarningBaselineConfig implements Serializable {
private Integer timeDimension; private Integer timeDimension;
/** /**
* 区间最小值,+∞用NULL表示 * 区间最小值
*/ */
@ApiModelProperty(notes = "区间最小值", required = true) @ApiModelProperty(notes = "区间最小值", required = true)
@Column(name = "min_value") @Column(name = "min_value")
...@@ -50,6 +50,13 @@ public class SupervisorWarningBaselineConfig implements Serializable { ...@@ -50,6 +50,13 @@ public class SupervisorWarningBaselineConfig implements Serializable {
@ApiModelProperty(notes = "区间最大值, +∞用NULL表示") @ApiModelProperty(notes = "区间最大值, +∞用NULL表示")
@Column(name = "max_value") @Column(name = "max_value")
private BigDecimal maxValue; private BigDecimal maxValue;
/**
* 正无穷大标识
*
*/
@ApiModelProperty(notes = "最大值正无穷大标识, 0-否,1-是", required = true)
@Column(name = "max_value_inf")
private Integer maxValueInf;
/** /**
* 预警等级:0-红,1-黄,2-绿 * 预警等级:0-红,1-黄,2-绿
......
package cn.com.glsx.dj.supervisor.remote; package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.*;
import cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO; import cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO;
import cn.com.glsx.dj.supervisor.dto.AudioSummaryDTO; import cn.com.glsx.dj.supervisor.dto.AudioSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorManageSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo; import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo;
...@@ -37,6 +39,19 @@ public interface SupervisorTaskInfoRemote { ...@@ -37,6 +39,19 @@ public interface SupervisorTaskInfoRemote {
@ApiResponse("提交结果") @ApiResponse("提交结果")
RpcResponse<SupervisorTaskDTO> getTaskDetailById(Long id); RpcResponse<SupervisorTaskDTO> getTaskDetailById(Long id);
/**
* 查询督导任务汇总信息
*
* @param request
* @return 督导任务汇总信息
*/
@ApiMethod("查询督导任务汇总信息")
@ApiParams({@ApiParam(name = "request", notes = "查询参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("提交结果")
RpcResponse<SupervisorTaskSummaryDTO> getTaskSummary(SupervisorTaskQueryDTO request);
@ApiMethod("查询督导任务分页列表") @ApiMethod("查询督导任务分页列表")
@ApiParams({@ApiParam(name = "request", notes = "查询参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)}) @ApiParams({@ApiParam(name = "request", notes = "查询参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("提交结果") @ApiResponse("提交结果")
...@@ -77,4 +92,21 @@ public interface SupervisorTaskInfoRemote { ...@@ -77,4 +92,21 @@ public interface SupervisorTaskInfoRemote {
@ApiParams({@ApiParam(name = "request", notes = "带教信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)}) @ApiParams({@ApiParam(name = "request", notes = "带教信息", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("提交结果") @ApiResponse("提交结果")
RpcResponse<Long> submitCoaching(SupervisorTaskDTO request); RpcResponse<Long> submitCoaching(SupervisorTaskDTO request);
/**
* 查询督导团队概况信息
*/
@ApiMethod("查询督导团队概况信息")
@ApiParams({@ApiParam(name = "request", notes = "督导管理的门店id列表", dataType = ApiParam.DataTypeEnum.ARRAY, required = true)})
@ApiResponse("督导团队概况信息")
RpcResponse<SupervisorTeamOverviewDTO> getTeamOverview(SupervisorTaskQueryDTO request);
/**
* 督导管理汇总
*/
@ApiMethod("督导管理汇总")
@ApiParams({@ApiParam(name = "request", notes = "不需要参数,传null即可", dataType = ApiParam.DataTypeEnum.OBJECT, required = false)})
@ApiResponse("汇总数据")
RpcResponse<SupervisorManageSummaryDTO> getManageSummary();
} }
\ No newline at end of file \ No newline at end of file
...@@ -64,11 +64,16 @@ ...@@ -64,11 +64,16 @@
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
<version>5.8.38</version> <version>5.8.38</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.7.0-SNAPSHOT</version> <version>5.7.0-SNAPSHOT</version>
<scope>compile</scope> </dependency>
<dependency>
<groupId>cn.com.glsx.dj.peanalysis</groupId>
<artifactId>rpc-dj-pe-analysis-api</artifactId>
<version>5.7.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
package cn.com.glsx.dj.supervisor.config;
import cn.com.glsx.dj.peanalysis.remote.BusinessSceneAnalysisRemote;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class PeAnalysisDubboConfig extends DubboConfig {
@Bean
public BusinessSceneAnalysisRemote businessSceneAnalysisRemote() {
return factory.builder(BusinessSceneAnalysisRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
}
package cn.com.glsx.dj.supervisor.config;
import cn.com.glsx.dj.smartcarlife.remote.ShopMerchantDirectorConfigRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SmartcarlifeDubboConfig extends DubboConfig {
@Bean
public ShopMerchantDirectorConfigRemote shopMerchantDirectorConfigRemote() {
return factory.builder(ShopMerchantDirectorConfigRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
@Bean
public StaffBaseInfoRemote staffBaseInfoRemote() {
return factory.builder(StaffBaseInfoRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
}
package cn.com.glsx.dj.supervisor.mapper; package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO; import cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo; import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -13,4 +14,6 @@ public interface SupervisorAudioReviewInfoMapper extends OreMapper<SupervisorAud ...@@ -13,4 +14,6 @@ public interface SupervisorAudioReviewInfoMapper extends OreMapper<SupervisorAud
List<AudioReceptionDTO> listAudionByReceptionId(@Param("relationId") Long receptionId); List<AudioReceptionDTO> listAudionByReceptionId(@Param("relationId") Long receptionId);
List<AudioReceptionDTO> listAudionByEmployeeInfo(SupervisorTaskQueryDTO query);
} }
\ No newline at end of file \ No newline at end of file
...@@ -50,4 +50,14 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo> ...@@ -50,4 +50,14 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo>
List<TrainingListDTO> queryCoachingTrainingList(@Param("storeManagerPhone") String storeManagerPhone, List<TrainingListDTO> queryCoachingTrainingList(@Param("storeManagerPhone") String storeManagerPhone,
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate); @Param("endDate") String endDate);
List<Integer> queryMerchantBySupervisorPhone(@Param("phoneList") List<String> phoneList);
/**
* 查询给定门店列表下的全部驻店人员uuid列表
*
* @param merchantIdList
* @return
*/
List<String> queryStoreManagerUuidByMerchantId(@Param("merchantIdList") List<Integer> merchantIdList);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.remote; package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.*;
import cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO; import cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO;
import cn.com.glsx.dj.supervisor.dto.AudioSummaryDTO; import cn.com.glsx.dj.supervisor.dto.AudioSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorManageSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo; import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo;
...@@ -82,6 +84,20 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote { ...@@ -82,6 +84,20 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
} }
@Override @Override
public RpcResponse<SupervisorTaskSummaryDTO> getTaskSummary(SupervisorTaskQueryDTO request) {
try {
SupervisorTaskSummaryDTO result = supervisorTaskInfoService.getTaskSummary(request);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getTaskSummary error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getTaskSummary system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<SupervisorTaskDTO>> pageTask(RpcPagination<SupervisorTaskQueryDTO> request) { public RpcResponse<RpcPagination<SupervisorTaskDTO>> pageTask(RpcPagination<SupervisorTaskQueryDTO> request) {
try { try {
Page result = supervisorTaskInfoService.pageTask(request); Page result = supervisorTaskInfoService.pageTask(request);
...@@ -152,4 +168,34 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote { ...@@ -152,4 +168,34 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
} }
} }
@Override
public RpcResponse<SupervisorTeamOverviewDTO> getTeamOverview(SupervisorTaskQueryDTO request) {
try {
SupervisorTeamOverviewDTO result = supervisorTaskInfoService.getTeamOverview(request);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getTeamOverview error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getTeamOverview system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<SupervisorManageSummaryDTO> getManageSummary() {
try {
log.info("督导管理汇总 - 开始查询");
SupervisorManageSummaryDTO result = supervisorTaskInfoService.getManageSummary();
log.info("督导管理汇总 - 查询成功:{}", result);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getManageSummary error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getManageSummary system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
} }
...@@ -57,10 +57,22 @@ public class SupervisorAudioReviewInfoService { ...@@ -57,10 +57,22 @@ public class SupervisorAudioReviewInfoService {
public Page<AudioReceptionDTO> pageAudioReception(RpcPagination<SupervisorTaskQueryDTO> request) { public Page<AudioReceptionDTO> pageAudioReception(RpcPagination<SupervisorTaskQueryDTO> request) {
//分页查询 //分页查询
Page<AudioReceptionDTO> page = PageHelper.startPage(request.getPageNum(), request.getPageSize()); Page<AudioReceptionDTO> page = PageHelper.startPage(request.getPageNum(), request.getPageSize());
supervisorAudioReviewInfoMapper.listAudionByReceptionId(request.getCondition().getId()); List<AudioReceptionDTO> list = supervisorAudioReviewInfoMapper.listAudionByReceptionId(request.getCondition().getId());
if(CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
//处理录音时长
String duration = item.getTotalDuration();
long a = duration == null ? 0l : Long.parseLong(duration) / 1000;
item.setTotalDuration(String.valueOf(a));
});
}
return page; return page;
} }
public List<AudioReceptionDTO> listAudionByEmployeeInfo(SupervisorTaskQueryDTO query) {
return supervisorAudioReviewInfoMapper.listAudionByEmployeeInfo(query);
}
/** /**
* 查询录音复盘汇总信息 * 查询录音复盘汇总信息
* @param request * @param request
...@@ -115,6 +127,10 @@ public class SupervisorAudioReviewInfoService { ...@@ -115,6 +127,10 @@ public class SupervisorAudioReviewInfoService {
return true; return true;
} }
public int batchInsert(List<SupervisorAudioReviewInfo> list) {
return supervisorAudioReviewInfoMapper.insertList(list);
}
......
package cn.com.glsx.dj.supervisor.service; package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.CoursePushDTO; import cn.com.glsx.dj.peanalysis.dto.req.output.SceneBaseReq;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; import cn.com.glsx.dj.peanalysis.dto.res.output.SceneOutputResponse;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO; import cn.com.glsx.dj.peanalysis.remote.BusinessSceneAnalysisRemote;
import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.StaffBaseInfoDTO;
import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote;
import cn.com.glsx.dj.supervisor.dto.*;
import cn.com.glsx.dj.supervisor.enums.ReviewStatusEnum; import cn.com.glsx.dj.supervisor.enums.ReviewStatusEnum;
import cn.com.glsx.dj.supervisor.enums.TaskStatusEnum; import cn.com.glsx.dj.supervisor.enums.TaskStatusEnum;
import cn.com.glsx.dj.supervisor.enums.TaskTypeEnum; import cn.com.glsx.dj.supervisor.enums.TaskTypeEnum;
...@@ -16,9 +19,11 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -16,9 +19,11 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert; import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeListResonseDTO;
import cn.com.glsx.merchants.model.request.MerchantStaffRequest; import cn.com.glsx.merchants.model.request.MerchantStaffRequest;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse; import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.remote.MerchantStaffRemote; import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -31,10 +36,7 @@ import org.springframework.stereotype.Service; ...@@ -31,10 +36,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -63,6 +65,12 @@ public class SupervisorTaskInfoService { ...@@ -63,6 +65,12 @@ public class SupervisorTaskInfoService {
private SupervisorTaskCourseService supervisorTaskCourseService; private SupervisorTaskCourseService supervisorTaskCourseService;
@Autowired @Autowired
private StaffBaseInfoRemote staffBaseInfoRemote;
@Autowired
private BusinessSceneAnalysisRemote businessSceneAnalysisRemote;
@Autowired
private SupervisorTaskImageMapper supervisorTaskImageMapper; private SupervisorTaskImageMapper supervisorTaskImageMapper;
@Autowired @Autowired
...@@ -107,6 +115,10 @@ public class SupervisorTaskInfoService { ...@@ -107,6 +115,10 @@ public class SupervisorTaskInfoService {
supervisorTaskInfoMapper.insertList(taskList); supervisorTaskInfoMapper.insertList(taskList);
} }
public int insert(SupervisorTaskInfo taskInfo) {
return supervisorTaskInfoMapper.insert(taskInfo);
}
/** /**
* 生成周报信息 * 生成周报信息
* @param startTimeStr 周报的开始时间,yyyy-MM-dd * @param startTimeStr 周报的开始时间,yyyy-MM-dd
...@@ -121,6 +133,64 @@ public class SupervisorTaskInfoService { ...@@ -121,6 +133,64 @@ public class SupervisorTaskInfoService {
} }
/** /**
* 督导管理汇总
* 1. 查询全部督导列表
* 2. 将督导手机号微批查询北森在职状态,统计在职总人数
* 3. 按督导手机号查询 director_config 表,统计管理门店数
*
* @return 汇总数据
*/
public SupervisorManageSummaryDTO getManageSummary() {
SupervisorManageSummaryDTO summary = new SupervisorManageSummaryDTO();
summary.setTotalCount(0);
summary.setManagedStoreCount(0);
summary.setMonthlyOutput(java.math.BigDecimal.ZERO);
//查询在职督导总人数
List<MerchantStaffResponse> supervisorList = listAllSupervisors();
if (CollectionUtils.isEmpty(supervisorList)) {
log.info("督导列表为空,返回默认汇总");
return summary;
}
List<String> phoneList = supervisorList.stream()
.map(MerchantStaffResponse::getStaffPhone)
.filter(phone -> phone != null && !phone.isEmpty())
.distinct()
.collect(Collectors.toList());
summary.setTotalCount(getEffectiveSupervisors(phoneList));
// 3. 查询 director_config 表,统计所有督导负责的门店(director_type=6,平台中飞行督导)
List<Integer> merchantIdList = supervisorTaskInfoMapper.queryMerchantBySupervisorPhone(phoneList);
summary.setManagedStoreCount(merchantIdList.size());
// TODO 对接接口,查询统计本月内总产值
List<String> staffUuidList = supervisorTaskInfoMapper.queryStoreManagerUuidByMerchantId(merchantIdList);
// DateUtil.beginOfMonth(new Date())
summary.setMonthlyOutput(java.math.BigDecimal.ZERO);
return summary;
}
/**
* 查询在职督导总人数
* @return
*/
public int getEffectiveSupervisors(List<String> phoneList) {
// 1. 查询全部督导列表
int onlineCount = 0;
// 2. 批量查询北森信息,统计在职人数
if (!phoneList.isEmpty()) {
List<BeiSenEmployeeListResonseDTO> beisenList = supervisorLearningCenterService.listEmployeeInfoByStaffPhone(phoneList);
if (beisenList != null) {
onlineCount = (int) beisenList.stream()
.filter(emp -> Integer.valueOf(1).equals(emp.getZzStatus())) // 注意这里的值跟数据库中的是反的
.count();
}
}
return onlineCount;
}
/**
* 查询所有飞行督导人员 * 查询所有飞行督导人员
* @return * @return
*/ */
...@@ -233,6 +303,35 @@ public class SupervisorTaskInfoService { ...@@ -233,6 +303,35 @@ public class SupervisorTaskInfoService {
} }
/** /**
* 查询督导任务汇总信息
* @param request
* @return
*/
public SupervisorTaskSummaryDTO getTaskSummary(SupervisorTaskQueryDTO request) {
SupervisorTaskSummaryDTO res = new SupervisorTaskSummaryDTO();
//查询所有飞行督导员工列表
List<MerchantStaffResponse> merchantStaffResponses = listAllSupervisors();
if (CollectionUtils.isNotEmpty(merchantStaffResponses)) {
List<String> phoneList = merchantStaffResponses.stream()
.map(MerchantStaffResponse::getStaffPhone)
.filter(phone -> phone != null && !phone.isEmpty())
.distinct()
.collect(Collectors.toList());
res.setTotalCount(getEffectiveSupervisors(phoneList));
}
//根据条件,调用分页查询任务 接口,根据返回的数据,去重计算提交任务人数,提交任务数
List<SupervisorTaskDTO> taskList = supervisorTaskInfoMapper.listTask(request);
if (CollectionUtils.isNotEmpty(taskList)) {
//去重计算提交任务人数,提交任务数
Set<String> submittedPhoneSet = taskList.stream().filter(x -> TaskStatusEnum.COMPLETED.getCode().equals(x.getTaskStatus()))
.map(SupervisorTaskDTO::getUpdatedPhone).collect(Collectors.toSet());
res.setSubmittedCount(submittedPhoneSet.size());
res.setSubmittedTaskCount(taskList.size());
}
return res;
}
/**
* 查询督导任务分页列表 * 查询督导任务分页列表
* @param request * @param request
* @return * @return
...@@ -241,7 +340,7 @@ public class SupervisorTaskInfoService { ...@@ -241,7 +340,7 @@ public class SupervisorTaskInfoService {
Page<SupervisorTaskDTO> page = PageHelper.startPage(request.getPageNum(), request.getPageSize()); Page<SupervisorTaskDTO> page = PageHelper.startPage(request.getPageNum(), request.getPageSize());
//查询任务列表 //查询任务列表
List<SupervisorTaskDTO> taskList = supervisorTaskInfoMapper.listTask(request.getCondition()); List<SupervisorTaskDTO> taskList = supervisorTaskInfoMapper.listTask(request.getCondition());
if (CollectionUtils.isNotEmpty(taskList)) { if (CollectionUtils.isNotEmpty(taskList) && request.getCondition().getCalculateAudioDetailFlag() == 0) {
//录音复盘 需要计算录音进度 //录音复盘 需要计算录音进度
List<Long> idList = taskList.stream().filter(x -> TaskTypeEnum.AUDIO_RECORDING.getCode().equals(x.getTaskType())) List<Long> idList = taskList.stream().filter(x -> TaskTypeEnum.AUDIO_RECORDING.getCode().equals(x.getTaskType()))
.map(SupervisorTaskDTO::getId).collect(Collectors.toList()); .map(SupervisorTaskDTO::getId).collect(Collectors.toList());
...@@ -296,6 +395,46 @@ public class SupervisorTaskInfoService { ...@@ -296,6 +395,46 @@ public class SupervisorTaskInfoService {
} }
/** /**
* 查询督导团队概况信息
* @param request 督导管理的门店id列表
* @return 督导团队概况信息
*/
public SupervisorTeamOverviewDTO getTeamOverview(SupervisorTaskQueryDTO request) {
log.info("查询督导团队概况信息,查询条件: {}", request);
SupervisorTeamOverviewDTO overviewDTO = new SupervisorTeamOverviewDTO();
List<Integer> merchantIdList = request.getMerchantIdList();
// 计算团队员工个数
StaffBaseInfoDTO param = new StaffBaseInfoDTO();
param.setMerchantIdList(merchantIdList);
RpcResponse<List<StaffBaseInfoDTO>> response = staffBaseInfoRemote.listShopStaffBaseInfo(param);
if (response.hasError()) {
log.error("查询团队员工个数失败,merchantIdList={}, error={}, message={}", merchantIdList, response.getError(), response.getMessage());
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, response.getMessage());
} else {
List<StaffBaseInfoDTO> staffList = response.getResult();
if (CollectionUtils.isNotEmpty(staffList)) {
overviewDTO.setStaffCount(staffList.size());
//查询产值
SceneBaseReq req = new SceneBaseReq();
req.setMerchantIds(merchantIdList);
req.setCycleType(4);
req.setStaffPhones(staffList.stream().map(StaffBaseInfoDTO::getStaffPhone).collect(Collectors.toList()));
RpcResponse<SceneOutputResponse> outputResponse = businessSceneAnalysisRemote.querySupervisorOutput(req);
if (outputResponse.hasError()) {
log.error("查询督导团队产值失败,SceneBaseReq={}, error={}, message={}", JSON.toJSONString(req), outputResponse.getError(), outputResponse.getMessage());
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, outputResponse.getMessage());
} else {
SceneOutputResponse outputResp = outputResponse.getResult();
if (outputResp != null) {
overviewDTO.setTotalValue(outputResp.getOutputValue());
}
}
}
}
return overviewDTO;
}
/**
* 发起带教 - 提交 * 发起带教 - 提交
* @param request 带教信息 * @param request 带教信息
* @return 任务 ID * @return 任务 ID
......
...@@ -40,6 +40,7 @@ public class SupervisorWarningBaselineConfigService { ...@@ -40,6 +40,7 @@ public class SupervisorWarningBaselineConfigService {
// 新增 // 新增
config.getConfigList().stream().forEach(item -> { config.getConfigList().stream().forEach(item -> {
item.setIndicatorCode(config.getIndicatorCode()); item.setIndicatorCode(config.getIndicatorCode());
item.setIndicatorName(config.getIndicatorName());
item.setTimeDimension(config.getTimeDimension()); item.setTimeDimension(config.getTimeDimension());
item.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name()); item.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
item.setCreatedBy(config.getUpdatedBy()); item.setCreatedBy(config.getUpdatedBy());
...@@ -77,7 +78,7 @@ public class SupervisorWarningBaselineConfigService { ...@@ -77,7 +78,7 @@ public class SupervisorWarningBaselineConfigService {
} }
criteria.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name()); criteria.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
//根据更新时间降序 //根据更新时间降序
example.setOrderByClause("updatedDate desc"); example.setOrderByClause("updated_date desc");
return supervisorWarningBaselineConfigMapper.selectByExample(example); return supervisorWarningBaselineConfigMapper.selectByExample(example);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT" />
<result column="reception_id" property="receptionId" jdbcType="BIGINT" /> <result column="reception_id" property="receptionId" />
<result column="relation_id" property="relationId" jdbcType="BIGINT" /> <result column="relation_id" property="relationId" jdbcType="BIGINT" />
<result column="review_status" property="reviewStatus" jdbcType="INTEGER" /> <result column="review_status" property="reviewStatus" jdbcType="INTEGER" />
<result column="review_context" property="reviewContext" jdbcType="VARCHAR" /> <result column="review_context" property="reviewContext" jdbcType="VARCHAR" />
...@@ -26,17 +26,19 @@ ...@@ -26,17 +26,19 @@
</sql> </sql>
<select id="listAudionByReceptionId" resultType="cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO"> <select id="listAudionByReceptionId" resultType="cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO">
select sari.id, sari.receptionId as batchId, sari.reviewStatus, select sari.id, sari.receptionId as batchId, sari.reviewStatus, sari.review_target reviewTarget, sari.review_context reviewContext,
t2.audio_time as staticDate,t1.employee_name employeeName,re.customer_name customerName,re.phone_number as phoneNumber, t2.audio_time as staticDate,t1.employee_name employeeName,re.customer_name customerName,re.phone_number as phoneNumber,
re.merchant_id merchantNo,re.car_model carModel, re.car_brand as carBrand, re.merchant_id merchantNo,re.car_model carModel, re.car_brand as carBrand,
ind.customer_type as customerType,ind.avg_defence as avgDefence, ind.customer_type as customerType,ind.avg_defence as avgDefence,
cb.start_time startTime,cb.end_time endTime,cb.duration as totalDuration, cb.score as qualityCheckScore,cb.file_url fileUrl cb.start_time startTime,cb.end_time endTime,cb.duration as totalDuration, cb.score as qualityCheckScore,cb.file_url fileUrl,
sm.merchant_name merchantName
from supervisor_audio_review_info sari from supervisor_audio_review_info sari
left join inspection_conversation_batch cb on cb.id = sari.reception_id left join inspection_conversation_batch cb on cb.id = sari.reception_id
left join reception_customer_info re on cb.task_id = re.id left join reception_customer_info re on cb.task_id = re.id
left join inspection_defence ind on ind.batch_id = cb.id and ind.deleted_flag = 'N' left join inspection_defence ind on ind.batch_id = cb.id and ind.deleted_flag = 'N'
left join inspection_conversation_date t2 on cb.conversation_id = t2.id left join inspection_conversation_date t2 on cb.conversation_id = t2.id
left join inspection_employee_badge t1 on t1.badge_id = t2.badge_id left join inspection_employee_badge t1 on t1.badge_id = t2.badge_id
left join dj_car_life_service_merchant sm on re.merchant_id = sm.merchant_id and sm.deleted_flag= 'N'
<where> <where>
sari.deleted_flag = 'N' and cb.deleted_flag = 'N' sari.deleted_flag = 'N' and cb.deleted_flag = 'N'
and sari.relation_id = #{relationId} and sari.relation_id = #{relationId}
...@@ -44,4 +46,33 @@ ...@@ -44,4 +46,33 @@
order by cb.start_time desc order by cb.start_time desc
</select> </select>
<select id="listAudionByEmployeeInfo" parameterType="cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO" resultType="cn.com.glsx.dj.supervisor.dto.AudioReceptionDTO">
select cb.id as batchId , t1.phone_number as staffPhone
from join inspection_conversation_batch cb
left join reception_customer_info re on cb.task_id = re.id
left join inspection_conversation_date t2 on cb.conversation_id = t2.id
left join inspection_employee_badge t1 on t1.badge_id = t2.badge_id
<where>
and cb.deleted_flag = 'N'
<if test="merchantIdList != null and merchantIdList.size() > 0">
and re.merchant_id in
<foreach collection="merchantIdList" item="merchantId" open="(" close=")" separator=",">
#{merchantId}
</foreach>
</if>
<if test="staffPhoneList != null and staffPhoneList.size() > 0">
and t1.phone_number in
<foreach collection="staffPhoneList" item="staffPhone" open="(" close=")" separator=",">
#{staffPhone}
</foreach>
</if>
<if test="startDate != null and endDate != null">
and t2.audio_time between #{startDate} and #{endDate}
</if>
<if test="receptionStatus != null">
and re.reception_status = #{receptionStatus}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
<result column="store_manager_name" property="storeManagerName"/> <result column="store_manager_name" property="storeManagerName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" />
<result column="updated_phone" property="updatedPhone" />
<collection property="taskImageList" ofType="cn.com.glsx.dj.supervisor.model.SupervisorTaskImage"> <collection property="taskImageList" ofType="cn.com.glsx.dj.supervisor.model.SupervisorTaskImage">
<result column="image_url" property="imageUrl" /> <result column="image_url" property="imageUrl" />
</collection> </collection>
...@@ -75,8 +77,8 @@ ...@@ -75,8 +77,8 @@
</select> </select>
<select id="listTask" parameterType="cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO" resultMap="TaskDetailMap"> <select id="listTask" parameterType="cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO" resultMap="TaskDetailMap">
select sti.id, sti.task_type, sti.task_status,sti.updated_date, select sti.id, sti.task_type, sti.task_status,sti.updated_date,sti.updated_phone, sti.updated_by, sti.store_manager_name,
sti.store_manager_name sti.task_desc,sti.task_context
from supervisor_task_info sti from supervisor_task_info sti
<where> <where>
sti.deleted_flag = 'N' sti.deleted_flag = 'N'
...@@ -98,6 +100,9 @@ ...@@ -98,6 +100,9 @@
<if test="taskStatus != null"> <if test="taskStatus != null">
and sti.task_status = #{taskStatus} and sti.task_status = #{taskStatus}
</if> </if>
<if test="updatedBy != null and updatedBy != ''">
and sti.updated_by like concat('%', #{updatedBy}, '%')
</if>
</where> </where>
order by sti.task_status asc, sti.create_time desc order by sti.task_status asc, sti.create_time desc
</select> </select>
...@@ -184,5 +189,26 @@ ...@@ -184,5 +189,26 @@
</if> </if>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="queryMerchantBySupervisorPhone" resultType="java.lang.Integer">
SELECT DISTINCT merchant_id
FROM dj_car_life_shop_merchant_director_config
WHERE deleted_flag = 'N'
AND director_type = 6
AND director_phone IN
<foreach collection="phoneList" open="(" item="i" close=")" separator=",">
#{i}
</foreach>
</select>
<select id="queryStoreManagerUuidByMerchantId" resultType="java.lang.String">
SELECT DISTINCT staff_uuid
FROM dj_car_life_staff_account_record
WHERE deleted_flag = 'N'
AND job_type = 11
AND created_source = 6
AND merchant_id IN
<foreach collection="merchantIdList" open="(" item="i" close=")" separator=",">
#{i}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</sql> </sql>
<update id="batchUpdate"> <update id="batchUpdate">
UPDATE t_warning_baseline_config UPDATE supervisor_warning_baseline_config
SET SET
min_value = CASE min_value = CASE
<foreach collection="list" item="item" separator=""> <foreach collection="list" item="item" separator="">
......
package cn.com.glsx.dj.supervisor.service; package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.SupervisorManageSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskSummaryDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse; import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage; import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage;
import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/** /**
* @Title: * @Title:
...@@ -54,4 +62,136 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -54,4 +62,136 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
Long id = supervisorTaskInfoService.submitCoaching(request); Long id = supervisorTaskInfoService.submitCoaching(request);
System.out.println(id); System.out.println(id);
} }
@Test
public void testGetManageSummary() {
SupervisorManageSummaryDTO manageSummary = supervisorTaskInfoService.getManageSummary();
System.out.println(JSON.toJSONString(manageSummary));
}
@Test
public void testGenerateDayTask() {
String startTimeStr = "2026-03-11";
supervisorTaskInfoService.generateDayTask(startTimeStr);
}
/**
* 测试生成周报任务
*/
@Test
public void testGenerateWeekTask() {
String startTimeStr = "2026-03-09";
String endTimeStr = "2026-03-15";
supervisorTaskInfoService.generateWeekTask(startTimeStr, endTimeStr);
}
/**
* 测试生成月报任务
*/
@Test
public void testGenerateMonthTask() {
String startTimeStr = "2026-03-01";
String endTimeStr = "2026-03-31";
supervisorTaskInfoService.generateMonthTask(startTimeStr, endTimeStr);
}
/**
* 测试提交周报任务
*/
@Test
public void testSubmitWeekTask() {
SupervisorTaskDTO request = new SupervisorTaskDTO();
request.setId(6L);
// 设置其他全部参数
request.setTaskContext("督导周报记录");
List<SupervisorTaskImage> taskImageList = new ArrayList<>();
SupervisorTaskImage image = new SupervisorTaskImage();
image.setImageUrl("http://oss.glsx.com/123456.jpg");
taskImageList.add(image);
request.setTaskImageList(taskImageList);
request.setUpdatedBy("周敏");
request.setUpdatedPhone("18682474862");
List<SupervisorWeekTaskStaff> weekTaskStaffList = new ArrayList<>();
SupervisorWeekTaskStaff staff = new SupervisorWeekTaskStaff();
staff.setStaffName("测试");
staff.setStaffPhone("16666666666");
weekTaskStaffList.add(staff);
request.setWeekTaskStaffList(weekTaskStaffList);
supervisorTaskInfoService.submitDayTask(request);
}
/**
* 测试提交日报任务
*
*/
@Test
public void testSubmitDayTask() {
SupervisorTaskDTO request = new SupervisorTaskDTO();
request.setId(3L);
// 设置其他全部参数
request.setMerchantId(43423334);
request.setMerchantName("萨达梵蒂冈");
request.setOnDutyFlag(0);
request.setTaskContext("督导日报记录");
List<SupervisorTaskImage> taskImageList = new ArrayList<>();
SupervisorTaskImage image = new SupervisorTaskImage();
image.setImageUrl("http://oss.glsx.com/123456.jpg");
taskImageList.add(image);
request.setTaskImageList(taskImageList);
request.setUpdatedBy("周敏");
request.setUpdatedPhone("18682474862");
supervisorTaskInfoService.submitDayTask(request);
}
/**
* 测试提交月报任务
*/
@Test
public void testSubmitMonthTask() {
SupervisorTaskDTO request = new SupervisorTaskDTO();
request.setId(9L);
// 设置其他全部参数
request.setTaskContext("督导月报记录");
request.setUpdatedBy("周敏");
request.setUpdatedPhone("18682474862");
supervisorTaskInfoService.submitMonthTask(request);
}
@Test
public void testPageTask() {
RpcPagination<SupervisorTaskQueryDTO> request = new RpcPagination<>();
SupervisorTaskQueryDTO queryDTO = new SupervisorTaskQueryDTO();
queryDTO.setSupervisorPhone("18682474862");
request.setCondition(queryDTO);
List<Integer> typeList = Arrays.asList(0, 3, 5);
queryDTO.setTaskTypeList(typeList);
request.setPageSize(10);
request.setPageNum(1);
Page<SupervisorTaskDTO> supervisorTaskDTOS = supervisorTaskInfoService.pageTask(request);
System.out.println(JSON.toJSONString(supervisorTaskDTOS));
}
/**
* 根据ID查询督导任务详情
*/
@Test
public void testGetTaskDetail() {
Long id = 6L;
SupervisorTaskDTO taskDetail = supervisorTaskInfoService.getTaskDetailById(id);
System.out.println(JSON.toJSONString(taskDetail));
}
/**
* 测试查询督导任务汇总信息
*/
@Test
public void testGetTaskSummary() {
SupervisorTaskQueryDTO queryDTO = new SupervisorTaskQueryDTO();
queryDTO.setStartDate("2026-03-01");
queryDTO.setEndDate("2026-03-31");
queryDTO.setTaskTypeList(Arrays.asList(0, 3, 5));
SupervisorTaskSummaryDTO summary = supervisorTaskInfoService.getTaskSummary(queryDTO);
System.out.println(JSON.toJSONString(summary));
}
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.WarningBaselineConfigDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorWarningBaselineConfig;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.util.List;
import static org.junit.Assert.assertTrue;
public class SupervisorWarningBaselineConfigServiceTest extends BaseServiceTest {
@Autowired
private SupervisorWarningBaselineConfigService supervisorWarningBaselineConfigService;
/**
* 创建或修改预警基线配置
*/
@Test
public void testCreateOrUpdateWarningBaselineConfig() {
WarningBaselineConfigDTO config = new WarningBaselineConfigDTO();
config.setIndicatorCode("A036");
config.setIndicatorName("个人产值");
config.setTimeDimension(2);
List<SupervisorWarningBaselineConfig> configList = new java.util.ArrayList<>();
SupervisorWarningBaselineConfig redItem = new SupervisorWarningBaselineConfig();
redItem.setMinValue(new BigDecimal(0));
redItem.setMaxValue(new BigDecimal(1200));
redItem.setMaxValueInf(0);
redItem.setWarningLevel(0);
redItem.setId(4L);
configList.add(redItem);
SupervisorWarningBaselineConfig yellowItem = new SupervisorWarningBaselineConfig();
yellowItem.setMinValue(new BigDecimal(1200));
yellowItem.setMaxValue(new BigDecimal(4000));
yellowItem.setMaxValueInf(0);
yellowItem.setWarningLevel(1);
yellowItem.setId(5L);
configList.add(yellowItem);
SupervisorWarningBaselineConfig greenItem = new SupervisorWarningBaselineConfig();
greenItem.setMinValue(new BigDecimal(4000));
greenItem.setMaxValue(new BigDecimal(6000));
greenItem.setMaxValueInf(0);
greenItem.setWarningLevel(2);
greenItem.setId(6L);
configList.add(greenItem);
config.setConfigList(configList);
config.setUpdatedBy("system");
Boolean result = supervisorWarningBaselineConfigService.createOrUpdateWarningBaselineConfig(config);
assertTrue(result);
}
/**
* 查询所有预警基线配置
*/
@Test
public void testListAllWarningBaselineConfig() {
List<WarningBaselineConfigDTO> configList = supervisorWarningBaselineConfigService.listAllWarningBaselineConfig();
assertTrue(configList.size() > 0);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!