Commit 31979699 by jianan

新单跟进同步预约信息test

parent 0e3130bb
...@@ -2,7 +2,6 @@ package com.yd.csf.api.controller; ...@@ -2,7 +2,6 @@ package com.yd.csf.api.controller;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yd.base.feign.dto.ApiCertificateDto;
import com.yd.common.enums.CommonEnum; import com.yd.common.enums.CommonEnum;
import com.yd.common.enums.ResultCode; import com.yd.common.enums.ResultCode;
import com.yd.common.exception.BusinessException; import com.yd.common.exception.BusinessException;
...@@ -14,25 +13,19 @@ import com.yd.csf.service.common.ErrorCode; ...@@ -14,25 +13,19 @@ import com.yd.csf.service.common.ErrorCode;
import com.yd.csf.service.dto.CustomerAddRequest; import com.yd.csf.service.dto.CustomerAddRequest;
import com.yd.csf.service.dto.CustomerQueryRequest; import com.yd.csf.service.dto.CustomerQueryRequest;
import com.yd.csf.service.dto.CustomerUpdateRequest; import com.yd.csf.service.dto.CustomerUpdateRequest;
import com.yd.csf.service.dto.TaxationDto;
import com.yd.csf.service.model.Customer; import com.yd.csf.service.model.Customer;
import com.yd.csf.service.model.Taxation;
import com.yd.csf.service.service.CustomerService; import com.yd.csf.service.service.CustomerService;
import com.yd.csf.service.service.ITaxationService; import com.yd.csf.service.service.ITaxationService;
import com.yd.csf.service.utils.GSONUtil;
import com.yd.csf.service.vo.CustomerVO; import com.yd.csf.service.vo.CustomerVO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -52,8 +45,6 @@ public class ApiCustomerController { ...@@ -52,8 +45,6 @@ public class ApiCustomerController {
private CustomerService customerService; private CustomerService customerService;
@Resource @Resource
private ApiTaxationService apiTaxationService; private ApiTaxationService apiTaxationService;
@Resource
private ITaxationService iTaxationService;
/** /**
* 创建客户 * 创建客户
...@@ -180,52 +171,6 @@ public class ApiCustomerController { ...@@ -180,52 +171,6 @@ public class ApiCustomerController {
return Result.success(customerService.getCustomerVO(customer)); return Result.success(customerService.getCustomerVO(customer));
} }
@GetMapping("/get/vo/test")
public Result<Boolean> getCustomerVOTest() {
// 查询数据库
List<Customer> customerList = customerService.list();
if (!CollUtil.isEmpty(customerList)) {
for (Customer customer : customerList) {
List<ApiTaxationDto> apiTaxationDtoList = apiTaxationDtoList(customer.getCustomerBizId());
if (CollUtil.isNotEmpty(apiTaxationDtoList)) {
customer.setTaxList(GSONUtil.toJson(apiTaxationDtoList));
customerService.lambdaUpdate()
.set(Customer::getTaxList, customer.getTaxList())
.eq(Customer::getId, customer.getId())
.update();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
// 获取封装类
return Result.success(true);
}
public Result<List<Taxation>> list(ApiObjectTaxationDto dto) {
List<Taxation> list = iTaxationService.queryList(TaxationDto.builder().objectBizId(dto.getObjectBizId()).build());
return Result.success(list);
}
public List<ApiTaxationDto> apiTaxationDtoList(String objectBizId) {
List<ApiTaxationDto> apiTaxationDtoList = new ArrayList<>();
Result<List<Taxation>> result = list(ApiObjectTaxationDto.builder().objectBizId(objectBizId).build());
if (!CollectionUtils.isEmpty(result.getData())) {
apiTaxationDtoList = result.getData().stream().map(d -> {
ApiTaxationDto taxationDto = new ApiTaxationDto();
BeanUtils.copyProperties(d,taxationDto);
return taxationDto;
}).collect(Collectors.toList());
}
return apiTaxationDtoList;
}
/** /**
* 分页获取客户列表(仅管理员可用) * 分页获取客户列表(仅管理员可用)
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment