Commit 34c80af4 by 范富荣

优化报表提交接口

1 parent 576a7976
...@@ -68,7 +68,6 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -68,7 +68,6 @@ public class SupervisorTaskDTO implements Serializable {
/** /**
* 督导记录(富文本内容) * 督导记录(富文本内容)
*/ */
@NotEmpty(message = "督导记录不能为空")
@ApiModelProperty(notes = "督导记录", required = true) @ApiModelProperty(notes = "督导记录", required = true)
private String taskContext; private String taskContext;
......
...@@ -639,12 +639,18 @@ public class SupervisorTaskInfoService { ...@@ -639,12 +639,18 @@ public class SupervisorTaskInfoService {
} else { } else {
List<StaffBaseInfoDTO> staffList = response.getResult(); List<StaffBaseInfoDTO> staffList = response.getResult();
if (CollectionUtils.isNotEmpty(staffList)) { if (CollectionUtils.isNotEmpty(staffList)) {
overviewDTO.setStaffCount(staffList.size()); //根据员工手机号去重计算员工个数
Set<String> phoneSet = staffList.stream().map(StaffBaseInfoDTO::getStaffPhone).collect(Collectors.toSet());
overviewDTO.setStaffCount(phoneSet.size());
//查询产值 //查询产值
SceneBaseReq req = new SceneBaseReq(); SceneBaseReq req = new SceneBaseReq();
req.setMerchantIds(merchantIdList); req.setMerchantIds(merchantIdList);
req.setCycleType(4); req.setCycleType(4);
req.setStaffUuids(staffList.stream().map(StaffBaseInfoDTO::getLoginUuid).collect(Collectors.toList())); req.setStaffUuids(staffList.stream().map(StaffBaseInfoDTO::getLoginUuid).collect(Collectors.toList()));
//设置指标开始时间,从配置文件中取值
req.setStartTime(env.getProperty("supervisor.output.startTime", String.class, "2021-01-01"));
//设置指标结束时间,固定当前日期
req.setEndTime(DateUtils.formatDate(new Date()));
RpcResponse<SceneOutputResponse> outputResponse = businessSceneAnalysisRemote.querySupervisorOutput(req); RpcResponse<SceneOutputResponse> outputResponse = businessSceneAnalysisRemote.querySupervisorOutput(req);
if (outputResponse.hasError()) { if (outputResponse.hasError()) {
log.error("查询督导团队产值失败,SceneBaseReq={}, error={}, message={}", JSON.toJSONString(req), outputResponse.getError(), outputResponse.getMessage()); log.error("查询督导团队产值失败,SceneBaseReq={}, error={}, message={}", JSON.toJSONString(req), outputResponse.getError(), outputResponse.getMessage());
......
package cn.com.glsx.dj.supervisor.service; package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.smartcarlife.dto.ShopMerchantDirectorConfigDTO;
import cn.com.glsx.dj.smartcarlife.enums.DirectorTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.ShopMerchantDirectorConfigRemote;
import cn.com.glsx.dj.supervisor.dto.SupervisorManageSummaryDTO; 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;
...@@ -10,14 +13,17 @@ import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage; ...@@ -10,14 +13,17 @@ import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage;
import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff; import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.commons.collections.CollectionUtils;
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.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @Title: * @Title:
...@@ -30,6 +36,9 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -30,6 +36,9 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
@Autowired @Autowired
private SupervisorTaskInfoService supervisorTaskInfoService; private SupervisorTaskInfoService supervisorTaskInfoService;
@Autowired
private ShopMerchantDirectorConfigRemote shopMerchantDirectorConfigRemote;
@Test @Test
public void testGetTaskDetailById() { public void testGetTaskDetailById() {
SupervisorTaskDTO detail = supervisorTaskInfoService.getTaskDetailById(1L); SupervisorTaskDTO detail = supervisorTaskInfoService.getTaskDetailById(1L);
...@@ -219,4 +228,26 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -219,4 +228,26 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
request.setTaskDesc("督导记录sdhnasuihfasifnasfnassjasidjkioasdasfn"); request.setTaskDesc("督导记录sdhnasuihfasifnasfnassjasidjkioasdasfn");
Long id = supervisorTaskInfoService.createSpecialTask(request); Long id = supervisorTaskInfoService.createSpecialTask(request);
} }
@Test
public void testGetTeamOverview() {
ShopMerchantDirectorConfigDTO dto = new ShopMerchantDirectorConfigDTO();
dto.setDirectorUserId("63c121922cba4956b2aac3f21dacd92f");
dto.setDirectorTypes(Arrays.asList(DirectorTypeEnum.FLIGHT_SUPERVISION.getValue()));
RpcResponse<List<ShopMerchantDirectorConfigDTO>> merchantResponse = shopMerchantDirectorConfigRemote.list(dto);
List<Integer> merchantIdList = new ArrayList<>();
if (merchantResponse.isSuccess() && merchantResponse.getResult() != null) {
List<ShopMerchantDirectorConfigDTO> merchantList = merchantResponse.getResult();
if (CollectionUtils.isNotEmpty(merchantList)) {
merchantIdList = merchantList.stream()
.map(ShopMerchantDirectorConfigDTO::getMerchantId)
.collect(Collectors.toList());
SupervisorTaskQueryDTO request = new SupervisorTaskQueryDTO();
request.setMerchantIdList(merchantIdList);
SupervisorTeamOverviewDTO overview = supervisorTaskInfoService.getTeamOverview(request);
System.out.println(JSON.toJSONString(overview));
}
}
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!