提交 c086544b 作者: 张小凤

BackstageTaskServiceImpl(update)

上级 996a44a1
...@@ -81,6 +81,6 @@ public interface UserAppApi { ...@@ -81,6 +81,6 @@ public interface UserAppApi {
@GetMapping("/userapp/company/getCompanyInfoById") @GetMapping("/userapp/company/getCompanyInfoById")
String getCompanyInfoById(@ApiParam(value = "单位", required = true) @RequestParam Integer id, @RequestHeader("token") String token); String getCompanyInfoById(@ApiParam(value = "单位", required = true) @RequestParam Integer id, @RequestHeader("token") String token);
@PostMapping("/userapp/company/listCompanyPage") @PostMapping("/userapp/company/listCompanyPageBack")
String listCompanyPage(@ApiParam(value = "单位查询QO", required = true) @RequestBody CompanyInfoQO companyInfoQO, @RequestHeader("token") String token); List<CompanyInfoVO> listCompanyPage(@ApiParam(value = "单位查询QO", required = true) @RequestBody CompanyInfoQO companyInfoQO, @RequestHeader("token") String token);
} }
...@@ -48,7 +48,7 @@ public class UserAppApiHystrix implements UserAppApi { ...@@ -48,7 +48,7 @@ public class UserAppApiHystrix implements UserAppApi {
} }
@Override @Override
public String listCompanyPage(CompanyInfoQO companyInfoQO, String token) { public List<CompanyInfoVO> listCompanyPage(CompanyInfoQO companyInfoQO, String token) {
log.error("熔断:feignListAppUserAccount:{}", companyInfoQO); log.error("熔断:feignListAppUserAccount:{}", companyInfoQO);
return null; return null;
} }
......
...@@ -207,39 +207,31 @@ public class BackstageTaskServiceImpl implements BackstageTaskService { ...@@ -207,39 +207,31 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
return ResultBody.success(backstageTaskServiceDao.queryByIdCount(companyId)); return ResultBody.success(backstageTaskServiceDao.queryByIdCount(companyId));
} }
private List<WorkServiceDTO> getWorkServiceDTOS( private List<WorkServiceDTO> getWorkServiceDTOS(List<ServiceDO> pageList,HttpServletRequest request) {
List<ServiceDO> pageList, HttpServletRequest request) { List<CompanyInfoVO> companyInfoList = userAppApi.listCompanyPage(new CompanyInfoQO(1, 100000), request.getHeader("token"));
String companyInfoVOS =
userAppApi.listCompanyPage(new CompanyInfoQO(1, 100000), request.getHeader("token"));
JSONObject jsonObject = JSON.parseObject(companyInfoVOS);
JSONObject jsonObject1 = JSON.parseObject(String.valueOf(jsonObject.get("result")));
List<CompanyInfoVO> companyInfoList =
new Gson()
.fromJson(
new Gson().toJson(jsonObject1.get("list")),
new TypeToken<List<CompanyInfoVO>>() {}.getType());
String companyName = ""; String companyName = "";
List<WorkServiceDTO> workServiceDTOList = new ArrayList<>(); List<WorkServiceDTO> workServiceDTOList = new ArrayList<>();
for (ServiceDO item : pageList) { for (ServiceDO item : pageList) {
for (CompanyInfoVO companyInfoVO : companyInfoList) { for (CompanyInfoVO companyInfoVO : companyInfoList) {
if (item.getCompanyId().equals(companyInfoVO.getId())) { if (item.getCompanyId().equals(companyInfoVO.getId())){
companyName = companyInfoVO.getCompanyName(); companyName=companyInfoVO.getCompanyName();
break;
} }
} }
List<InspComtDO> inspComtDOS = generateComments(item); List<InspComtDO> inspComtDOS = generateComments(item);
WorkServiceDTO workServiceDTO = WorkServiceDTO workServiceDTO =
WorkServiceDTO.builder() WorkServiceDTO.builder()
.id(item.getId()) .id(item.getId())
.serviceName(item.getServiceName()) .serviceName(item.getServiceName())
.companyId(item.getCompanyId()) .companyId(item.getCompanyId())
.companyName(companyName) .companyName(companyName)
.coverPlan(item.getCoverPlan()) .coverPlan(item.getCoverPlan())
.serviceIntroduction(item.getServiceIntroduction()) .serviceIntroduction(item.getServiceIntroduction())
.video(item.getVideo()) .video(item.getVideo())
.shareCard(item.getShareCard()) .shareCard(item.getShareCard())
.inspComtList(inspComtDOS) .inspComtList(inspComtDOS)
.inspComtAmount(inspComtDOS.size()) .inspComtAmount(inspComtDOS.size())
.build(); .build();
workServiceDTOList.add(workServiceDTO); workServiceDTOList.add(workServiceDTO);
} }
return workServiceDTOList; return workServiceDTOList;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论