zhuyifan

feat(customer): 添加通过 hisCustomerNo 查询客户信息接口

......@@ -37,6 +37,13 @@ public class ClientCustomerController {
return clientCustomerService.getClientCustomerByHISCustomerId(hisCustomerId);
}
@ApiOperation(value = "根据hisCustomerNo获取ClientCustomer")
@GetMapping("/his/customer/{hisCustomerNo}")
@ResponseStatus(HttpStatus.OK)
public ClientCustomerDto getClientCustomerByHISCustomerNo(@PathVariable String hisCustomerNo) {
return clientCustomerService.getClientCustomerByHISCustomerNo(hisCustomerNo);
}
@ApiOperation(value = "根据customerId获取ClientCustomer")
@GetMapping("/customers/{customerId}")
@ResponseStatus(HttpStatus.OK)
......
......@@ -8,6 +8,7 @@ import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRe
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
import java.util.List;
public interface ClientCustomerService {
......@@ -34,4 +35,5 @@ public interface ClientCustomerService {
TodayOrderDto getTodayOrderStatisticForHis(String token);
ClientCustomerDto getClientCustomerByHISCustomerNo(String hisCustomerNo);
}
......
......@@ -547,4 +547,32 @@ public class ClientCustomerServiceImpl implements ClientCustomerService {
.build();
}
@Override
public ClientCustomerDto getClientCustomerByHISCustomerNo(String hisCustomerNo) {
var response = clientCustomerServiceRpcClient.getClientCustomerByHISCustomerNo(hisCustomerNo).getResponse();
return ClientCustomerDto.builder()
.id(response.getId())
.clientId(response.getClientId())
.enterpriseId(response.getEnterpriseId())
.age(response.getAge())
.height(response.getHeight())
.HISCustomerId(response.getHISCustomerId())
.identityCardNo(response.getIdentityCardNo())
.mobile(response.getMobile())
.name(response.getName())
.openId(response.getOpenId())
.sex(response.getSex())
.stallId(response.getStallId())
.weight(response.getWeight())
.isDeleted(response.getIsDeleted())
.birthday(DateUtil.formatDate(response.getBirthday()))
.createdAt(DateUtil.formatDate(response.getCreatedAt()))
.createdBy(response.getCreatedBy())
.creationSource(response.getCreationSource())
.updatedAt(DateUtil.formatDate(response.getUpdatedAt()))
.updateSource(response.getUpdateSource())
.updatedBy(response.getUpdatedBy())
.build();
}
}
......