Showing
9 changed files
with
101 additions
and
4 deletions
| ... | @@ -11,6 +11,7 @@ import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; | ... | @@ -11,6 +11,7 @@ import com.infoloop.tianting.model.dto.WxUserDto.WxUserPhoneResponseDto; |
| 11 | import com.infoloop.tianting.service.ClientCustomerService; | 11 | import com.infoloop.tianting.service.ClientCustomerService; |
| 12 | import com.infoloop.tianting.service.LoginService; | 12 | import com.infoloop.tianting.service.LoginService; |
| 13 | import com.infoloop.tianting.service.WxMiniProgramService; | 13 | import com.infoloop.tianting.service.WxMiniProgramService; |
| 14 | +import com.infoloop.tianting.service.client.ClientCustomerServiceHttpClient; | ||
| 14 | import io.swagger.annotations.Api; | 15 | import io.swagger.annotations.Api; |
| 15 | import io.swagger.annotations.ApiOperation; | 16 | import io.swagger.annotations.ApiOperation; |
| 16 | import java.util.List; | 17 | import java.util.List; |
| ... | @@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 34 | public class ClientCustomerController { | 35 | public class ClientCustomerController { |
| 35 | private final ClientCustomerService clientCustomerService; | 36 | private final ClientCustomerService clientCustomerService; |
| 36 | private final WxMiniProgramService wxMiniProgramService; | 37 | private final WxMiniProgramService wxMiniProgramService; |
| 38 | + private final ClientCustomerServiceHttpClient clientCustomerServiceHttpClient; | ||
| 37 | 39 | ||
| 38 | @ApiOperation(value = "根据hisCustomerId获取ClientCustomer") | 40 | @ApiOperation(value = "根据hisCustomerId获取ClientCustomer") |
| 39 | @GetMapping("/customers/his/{hisCustomerId}") | 41 | @GetMapping("/customers/his/{hisCustomerId}") |
| ... | @@ -58,6 +60,15 @@ public class ClientCustomerController { | ... | @@ -58,6 +60,15 @@ public class ClientCustomerController { |
| 58 | enterpriseId, customerId); | 60 | enterpriseId, customerId); |
| 59 | } | 61 | } |
| 60 | 62 | ||
| 63 | + @ApiOperation(value = "获取今日在住") | ||
| 64 | + @GetMapping("/clientCustomers/current") | ||
| 65 | + @ResponseStatus(HttpStatus.OK) | ||
| 66 | + public List<HospitalRecordDto> get(@PathVariable Integer enterpriseId, | ||
| 67 | + @PathVariable Integer customerId) { | ||
| 68 | + return clientCustomerService.getClientCustomerHospitalRecordsByCustomerId( | ||
| 69 | + enterpriseId, customerId); | ||
| 70 | + } | ||
| 71 | + | ||
| 61 | 72 | ||
| 62 | 73 | ||
| 63 | } | 74 | } | ... | ... |
| ... | @@ -19,6 +19,7 @@ import java.util.List; | ... | @@ -19,6 +19,7 @@ import java.util.List; |
| 19 | import javax.validation.Valid; | 19 | import javax.validation.Valid; |
| 20 | import lombok.RequiredArgsConstructor; | 20 | import lombok.RequiredArgsConstructor; |
| 21 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; |
| 22 | +import org.aspectj.lang.annotation.SuppressAjWarnings; | ||
| 22 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | import org.springframework.http.HttpStatus; | 24 | import org.springframework.http.HttpStatus; |
| 24 | import org.springframework.validation.annotation.Validated; | 25 | import org.springframework.validation.annotation.Validated; |
| ... | @@ -39,6 +40,7 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -39,6 +40,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 39 | public class OrderController { | 40 | public class OrderController { |
| 40 | private final OrderService orderService; | 41 | private final OrderService orderService; |
| 41 | 42 | ||
| 43 | + @SaIgnore | ||
| 42 | @ApiOperation(value = "根据customerId获取用户订单") | 44 | @ApiOperation(value = "根据customerId获取用户订单") |
| 43 | @GetMapping("/orders/{customerId}") | 45 | @GetMapping("/orders/{customerId}") |
| 44 | @ResponseStatus(HttpStatus.OK) | 46 | @ResponseStatus(HttpStatus.OK) |
| ... | @@ -58,6 +60,7 @@ public class OrderController { | ... | @@ -58,6 +60,7 @@ public class OrderController { |
| 58 | .build()); | 60 | .build()); |
| 59 | } | 61 | } |
| 60 | 62 | ||
| 63 | + @SaIgnore | ||
| 61 | @ApiOperation(value = "根据orderId获取订单详情") | 64 | @ApiOperation(value = "根据orderId获取订单详情") |
| 62 | @GetMapping("/orderDetails/{orderId}") | 65 | @GetMapping("/orderDetails/{orderId}") |
| 63 | @ResponseStatus(HttpStatus.OK) | 66 | @ResponseStatus(HttpStatus.OK) | ... | ... |
| ... | @@ -65,4 +65,33 @@ public class ClientCustomerDbDTO { | ... | @@ -65,4 +65,33 @@ public class ClientCustomerDbDTO { |
| 65 | private Integer stallId; | 65 | private Integer stallId; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | + @Data | ||
| 69 | + @Builder | ||
| 70 | + @ApiModel(description = "CurrentClientCustomerDto") | ||
| 71 | + public static class CurrentClientCustomerDto { | ||
| 72 | + private Integer id; | ||
| 73 | + private Integer clientId; | ||
| 74 | + private String clientName; | ||
| 75 | + private String stallName; | ||
| 76 | + private String name; | ||
| 77 | + private String sex; | ||
| 78 | + private Integer age; | ||
| 79 | + private Integer stallId; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Data | ||
| 83 | + @Builder | ||
| 84 | + @ApiModel(description = "CurrentHisClientCustomerDto") | ||
| 85 | + public static class CurrentHisClientCustomerDto { | ||
| 86 | + private Integer id; | ||
| 87 | + private Integer clientId; | ||
| 88 | + private String clientName; | ||
| 89 | + private String stallName; | ||
| 90 | + private String name; | ||
| 91 | + private String sex; | ||
| 92 | + private Integer age; | ||
| 93 | + private Integer stallId; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + | ||
| 68 | } | 97 | } | ... | ... |
| ... | @@ -56,7 +56,7 @@ public class SkuDbDTO { | ... | @@ -56,7 +56,7 @@ public class SkuDbDTO { |
| 56 | private String alias; | 56 | private String alias; |
| 57 | private String basicMaterials; // 主料 | 57 | private String basicMaterials; // 主料 |
| 58 | private String fat; | 58 | private String fat; |
| 59 | - private Integer protein; | 59 | + private String protein; |
| 60 | private String carbohydrate; | 60 | private String carbohydrate; |
| 61 | private String energy; | 61 | private String energy; |
| 62 | List<SkuSpecialDetailSingleResponseDto> allergyList; // 过敏源 | 62 | List<SkuSpecialDetailSingleResponseDto> allergyList; // 过敏源 | ... | ... |
| 1 | +package com.infoloop.tianting.service.client; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.databind.DeserializationFeature; | ||
| 4 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 5 | +import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.CurrentClientCustomerDto; | ||
| 6 | +import com.infoloop.tianting.model.dto.WxUserDto.WxUserOpenIdDto; | ||
| 7 | +import java.util.ArrayList; | ||
| 8 | +import java.util.List; | ||
| 9 | +import lombok.RequiredArgsConstructor; | ||
| 10 | +import okhttp3.OkHttpClient; | ||
| 11 | +import okhttp3.Request; | ||
| 12 | +import okhttp3.Response; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.stereotype.Service; | ||
| 15 | + | ||
| 16 | +@Service | ||
| 17 | +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) | ||
| 18 | +public class ClientCustomerServiceHttpClient { | ||
| 19 | + private final OkHttpClient client = new OkHttpClient(); | ||
| 20 | + | ||
| 21 | + public List<CurrentClientCustomerDto> getCurrentClientCustomer() { | ||
| 22 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
| 23 | + try { | ||
| 24 | + String url = "http://47.101.193.136:3031/clientcustomers/current/query"; | ||
| 25 | + Request request = new Request.Builder() | ||
| 26 | + .url(url) | ||
| 27 | + .build(); | ||
| 28 | + | ||
| 29 | + Response response = client.newCall(request).execute(); | ||
| 30 | + | ||
| 31 | + String jsonData = response.body().string(); | ||
| 32 | + System.out.println(jsonData); | ||
| 33 | + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
| 34 | +// return objectMapper.readValue(jsonData, WxUserOpenIdDto.class); | ||
| 35 | + return new ArrayList<>(); | ||
| 36 | + } catch (Exception e) { | ||
| 37 | + System.out.println("error"+e.getMessage()); | ||
| 38 | + throw new IllegalArgumentException("获取用户openid失败"); | ||
| 39 | + } | ||
| 40 | + } | ||
| 41 | +} |
| ... | @@ -168,7 +168,7 @@ public class OrderServiceRpcClient { | ... | @@ -168,7 +168,7 @@ public class OrderServiceRpcClient { |
| 168 | .setShowName(showName) | 168 | .setShowName(showName) |
| 169 | .setShouldUpdateNotServe(d.getShouldUpdateNotServe()) | 169 | .setShouldUpdateNotServe(d.getShouldUpdateNotServe()) |
| 170 | .setNotServe(notServe) | 170 | .setNotServe(notServe) |
| 171 | - .setShouldUpdateMealDetailJson(d.getShouldUpdateMealDetailJson()) | 171 | + .setShouldUpdateMealDetailJson(d.getShouldUpdateMenuDetailId()) |
| 172 | .setMealDetailJson(mealDetail) | 172 | .setMealDetailJson(mealDetail) |
| 173 | .build(); | 173 | .build(); |
| 174 | return detail; | 174 | return detail; |
| ... | @@ -247,7 +247,7 @@ public class OrderServiceRpcClient { | ... | @@ -247,7 +247,7 @@ public class OrderServiceRpcClient { |
| 247 | .setNotServe(orderDetailDto.getNotServe()) | 247 | .setNotServe(orderDetailDto.getNotServe()) |
| 248 | .setShouldCreateAdjustSkuRemark(true) | 248 | .setShouldCreateAdjustSkuRemark(true) |
| 249 | .setShouldCreatePrice(true) | 249 | .setShouldCreatePrice(true) |
| 250 | - .setShouldCreateMealDetailJson(false) | 250 | + .setShouldCreateMealDetailJson(true) |
| 251 | .setSkuId(orderDetailDto.getSkuId()) | 251 | .setSkuId(orderDetailDto.getSkuId()) |
| 252 | .build(); | 252 | .build(); |
| 253 | orderDetails.add(orderDetail); | 253 | orderDetails.add(orderDetail); |
| ... | @@ -282,6 +282,7 @@ public class OrderServiceRpcClient { | ... | @@ -282,6 +282,7 @@ public class OrderServiceRpcClient { |
| 282 | // .setPickupCode(createOrderDto.getPickupCode()) | 282 | // .setPickupCode(createOrderDto.getPickupCode()) |
| 283 | .setShouldCreateRemark(true) | 283 | .setShouldCreateRemark(true) |
| 284 | .setRemark(createOrderDto.getRemark()) | 284 | .setRemark(createOrderDto.getRemark()) |
| 285 | + .setShouldCreateCustomerNoticeJson(true) | ||
| 285 | .setCustomerNoticeJson(customerNotice) | 286 | .setCustomerNoticeJson(customerNotice) |
| 286 | .setCloseTimeType(createOrderDto.getCloseTimeType()) | 287 | .setCloseTimeType(createOrderDto.getCloseTimeType()) |
| 287 | .setShouldCreateOrderDetails(true) | 288 | .setShouldCreateOrderDetails(true) | ... | ... |
| ... | @@ -18,6 +18,7 @@ public GeDishSkuByIdsRpcResponse getDishSkusByIds(List<Integer> ids) { | ... | @@ -18,6 +18,7 @@ public GeDishSkuByIdsRpcResponse getDishSkusByIds(List<Integer> ids) { |
| 18 | .addAllIds(ids) | 18 | .addAllIds(ids) |
| 19 | .setIncludeDeleted(false) | 19 | .setIncludeDeleted(false) |
| 20 | .build(); | 20 | .build(); |
| 21 | - return skuServiceProtoRpcBlockingStub.getDishSkusByIds(request); | 21 | + final var res = skuServiceProtoRpcBlockingStub.getDishSkusByIds(request); |
| 22 | + return res; | ||
| 22 | } | 23 | } |
| 23 | } | 24 | } | ... | ... |
| ... | @@ -38,6 +38,7 @@ public class SkuServiceImpl implements SkuService { | ... | @@ -38,6 +38,7 @@ public class SkuServiceImpl implements SkuService { |
| 38 | .createdAt(DateUtil.formatDate(sku.getCreatedAt())) | 38 | .createdAt(DateUtil.formatDate(sku.getCreatedAt())) |
| 39 | .energy(sku.getEnergy()) | 39 | .energy(sku.getEnergy()) |
| 40 | .fat(sku.getFat()) | 40 | .fat(sku.getFat()) |
| 41 | + .protein(sku.getProtein()) | ||
| 41 | .skuList(sku.getSkusList().stream().map(subSku -> SkuDetailSingleResponseDto.builder().id(subSku.getId()).name(subSku.getName()).build()).collect( | 42 | .skuList(sku.getSkusList().stream().map(subSku -> SkuDetailSingleResponseDto.builder().id(subSku.getId()).name(subSku.getName()).build()).collect( |
| 42 | Collectors.toList())) | 43 | Collectors.toList())) |
| 43 | .tasteList(sku.getTastesList().stream().map(taste -> SkuDetailSingleResponseDto.builder().id(taste.getId()).name(taste.getName()).build()).collect( | 44 | .tasteList(sku.getTastesList().stream().map(taste -> SkuDetailSingleResponseDto.builder().id(taste.getId()).name(taste.getName()).build()).collect( | ... | ... |
| ... | @@ -13,6 +13,8 @@ service ClientCustomerServiceRpc { | ... | @@ -13,6 +13,8 @@ service ClientCustomerServiceRpc { |
| 13 | rpc GetClientCustomerById (GetClientCustomerByIdRpcRequest) returns (GetClientCustomerByIdRpcResponse) {} | 13 | rpc GetClientCustomerById (GetClientCustomerByIdRpcRequest) returns (GetClientCustomerByIdRpcResponse) {} |
| 14 | //HIS客户 | 14 | //HIS客户 |
| 15 | rpc GetClientCustomerByHISCustomerId (GetClientCustomerByHISCustomerIdRpcRequest) returns (GetClientCustomerByHISCustomerIdRpcResponse) {} | 15 | rpc GetClientCustomerByHISCustomerId (GetClientCustomerByHISCustomerIdRpcRequest) returns (GetClientCustomerByHISCustomerIdRpcResponse) {} |
| 16 | + //HIS客户 | ||
| 17 | + rpc GetClientCustomersByHISCustomerIds (GetClientCustomersByHISCustomerIdsRpcRequest) returns (GetClientCustomersByHISCustomerIdsRpcResponse) {} | ||
| 16 | //月子中心客户 | 18 | //月子中心客户 |
| 17 | rpc GetClientCustomerByContactNo (GetClientCustomerByContactNoRpcRequest) returns (GetClientCustomerByContactNoRpcResponse) {} | 19 | rpc GetClientCustomerByContactNo (GetClientCustomerByContactNoRpcRequest) returns (GetClientCustomerByContactNoRpcResponse) {} |
| 18 | rpc GetClientCustomerByMobile (GetClientCustomerByMobileRpcRequest) returns (GetClientCustomerByMobileRpcResponse) {} | 20 | rpc GetClientCustomerByMobile (GetClientCustomerByMobileRpcRequest) returns (GetClientCustomerByMobileRpcResponse) {} |
| ... | @@ -100,6 +102,14 @@ message GetClientCustomerByHISCustomerIdRpcResponse { | ... | @@ -100,6 +102,14 @@ message GetClientCustomerByHISCustomerIdRpcResponse { |
| 100 | SingleClientCustomerRpcResponse response = 1; | 102 | SingleClientCustomerRpcResponse response = 1; |
| 101 | } | 103 | } |
| 102 | 104 | ||
| 105 | +message GetClientCustomersByHISCustomerIdsRpcRequest { | ||
| 106 | + repeated string HISCustomerIds = 1; | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +message GetClientCustomersByHISCustomerIdsRpcResponse { | ||
| 110 | + repeated SingleClientCustomerRpcResponse responses = 1; | ||
| 111 | +} | ||
| 112 | + | ||
| 103 | message GetClientCustomerByContactNoRpcRequest { | 113 | message GetClientCustomerByContactNoRpcRequest { |
| 104 | string contractNo = 1; | 114 | string contractNo = 1; |
| 105 | } | 115 | } | ... | ... |
-
Please register or login to post a comment