Skip to content

Commit 313886e

Browse files
authored
* fix: Fixed bug with administrator adding orders. fix: Fixed ts-wait-order-service. update: deploy.yaml fix: Fixed errors in rebook, update station and update user. fix: Adapt to interface changes, fix bug in consign service. fix: update deploy.yaml.sample. fix: update deploy.yaml.sample. fix: Fixed errors in update user. fix: Updated the interface to find users. fix: Updated deployment file. Added Dockerfile for ts-wait-order-service update deployment file fix: Fixed the error of inconsistent orderId. * fix: Fixed the error of inconsistent orderId. * update: Updated sw_deploy.yaml.sample.
1 parent 9bdd9a2 commit 313886e

File tree

17 files changed

+52
-42
lines changed

17 files changed

+52
-42
lines changed

deployment/kubernetes-manifests/quickstart-k8s/yamls/deploy.yaml.sample

+11-11
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ spec:
5656
spec:
5757
containers:
5858
- name: ts-admin-order-service
59-
image: codewisdom/ts-admin-order-service:1.0.0
59+
image: codewisdom/ts-admin-order-service:1.0.1
6060
imagePullPolicy: IfNotPresent
6161
env:
6262
- name: NODE_IP
@@ -182,7 +182,7 @@ spec:
182182
spec:
183183
containers:
184184
- name: ts-admin-user-service
185-
image: codewisdom/ts-admin-user-service:1.0.0
185+
image: codewisdom/ts-admin-user-service:1.0.1
186186
imagePullPolicy: IfNotPresent
187187
env:
188188
- name: NODE_IP
@@ -526,7 +526,7 @@ spec:
526526
spec:
527527
containers:
528528
- name: ts-consign-service
529-
image: codewisdom/ts-consign-service:1.0.0
529+
image: codewisdom/ts-consign-service:1.0.1
530530
imagePullPolicy: IfNotPresent
531531
env:
532532
- name: NODE_IP
@@ -966,7 +966,7 @@ spec:
966966
spec:
967967
containers:
968968
- name: ts-order-other-service
969-
image: codewisdom/ts-order-other-service:1.0.0
969+
image: codewisdom/ts-order-other-service:1.0.1
970970
imagePullPolicy: IfNotPresent
971971
env:
972972
- name: NODE_IP
@@ -1012,7 +1012,7 @@ spec:
10121012
spec:
10131013
containers:
10141014
- name: ts-order-service
1015-
image: codewisdom/ts-order-service:1.0.0
1015+
image: codewisdom/ts-order-service:1.0.1
10161016
imagePullPolicy: IfNotPresent
10171017
env:
10181018
- name: NODE_IP
@@ -1234,7 +1234,7 @@ spec:
12341234
spec:
12351235
containers:
12361236
- name: ts-rebook-service
1237-
image: codewisdom/ts-rebook-service:1.0.0
1237+
image: codewisdom/ts-rebook-service:1.0.1
12381238
imagePullPolicy: IfNotPresent
12391239
env:
12401240
- name: NODE_IP
@@ -1494,7 +1494,7 @@ spec:
14941494
spec:
14951495
containers:
14961496
- name: ts-station-service
1497-
image: codewisdom/ts-station-service:1.0.0
1497+
image: codewisdom/ts-station-service:1.0.1
14981498
imagePullPolicy: IfNotPresent
14991499
env:
15001500
- name: NODE_IP
@@ -1800,7 +1800,7 @@ spec:
18001800
spec:
18011801
containers:
18021802
- name: ts-user-service
1803-
image: codewisdom/ts-user-service:1.0.0
1803+
image: codewisdom/ts-user-service:1.0.1
18041804
imagePullPolicy: IfNotPresent
18051805
env:
18061806
- name: NODE_IP
@@ -1930,7 +1930,7 @@ spec:
19301930
spec:
19311931
containers:
19321932
- name: ts-wait-order-service
1933-
image: codewisdom/ts-wait-order-service:1.0.0
1933+
image: codewisdom/ts-wait-order-service:1.0.1
19341934
imagePullPolicy: IfNotPresent
19351935
env:
19361936
- name: NODE_IP
@@ -1939,7 +1939,7 @@ spec:
19391939
fieldPath: status.hostIP
19401940
envFrom:
19411941
- secretRef:
1942-
name: ts-wait-order-service
1942+
name: ts-wait-order-mysql
19431943
- configMapRef:
19441944
name: nacos
19451945
ports:
@@ -1974,7 +1974,7 @@ spec:
19741974
spec:
19751975
containers:
19761976
- name: ts-ui-dashboard
1977-
image: codewisdom/ts-ui-dashboard:1.0.0
1977+
image: codewisdom/ts-ui-dashboard:1.0.1
19781978
imagePullPolicy: IfNotPresent
19791979
ports:
19801980
- containerPort: 8080

deployment/kubernetes-manifests/quickstart-k8s/yamls/sw_deploy.yaml.sample

+10-10
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ spec:
9393
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
9494
containers:
9595
- name: ts-admin-order-service
96-
image: codewisdom/ts-admin-order-service:1.0.0
96+
image: codewisdom/ts-admin-order-service:1.0.1
9797
imagePullPolicy: IfNotPresent
9898
volumeMounts:
9999
- name: skywalking-agent
@@ -297,7 +297,7 @@ spec:
297297
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
298298
containers:
299299
- name: ts-admin-user-service
300-
image: codewisdom/ts-admin-user-service:1.0.0
300+
image: codewisdom/ts-admin-user-service:1.0.1
301301
imagePullPolicy: IfNotPresent
302302
volumeMounts:
303303
- name: skywalking-agent
@@ -849,7 +849,7 @@ spec:
849849
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
850850
containers:
851851
- name: ts-consign-service
852-
image: codewisdom/ts-consign-service:1.0.0
852+
image: codewisdom/ts-consign-service:1.0.1
853853
imagePullPolicy: IfNotPresent
854854
volumeMounts:
855855
- name: skywalking-agent
@@ -1549,7 +1549,7 @@ spec:
15491549
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
15501550
containers:
15511551
- name: ts-order-other-service
1552-
image: codewisdom/ts-order-other-service:1.0.0
1552+
image: codewisdom/ts-order-other-service:1.0.1
15531553
imagePullPolicy: IfNotPresent
15541554
volumeMounts:
15551555
- name: skywalking-agent
@@ -1621,7 +1621,7 @@ spec:
16211621
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
16221622
containers:
16231623
- name: ts-order-service
1624-
image: codewisdom/ts-order-service:1.0.0
1624+
image: codewisdom/ts-order-service:1.0.1
16251625
imagePullPolicy: IfNotPresent
16261626
volumeMounts:
16271627
- name: skywalking-agent
@@ -1973,7 +1973,7 @@ spec:
19731973
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
19741974
containers:
19751975
- name: ts-rebook-service
1976-
image: codewisdom/ts-rebook-service:1.0.0
1976+
image: codewisdom/ts-rebook-service:1.0.1
19771977
imagePullPolicy: IfNotPresent
19781978
volumeMounts:
19791979
- name: skywalking-agent
@@ -2389,7 +2389,7 @@ spec:
23892389
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
23902390
containers:
23912391
- name: ts-station-service
2392-
image: codewisdom/ts-station-service:1.0.0
2392+
image: codewisdom/ts-station-service:1.0.1
23932393
imagePullPolicy: IfNotPresent
23942394
volumeMounts:
23952395
- name: skywalking-agent
@@ -2877,7 +2877,7 @@ spec:
28772877
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
28782878
containers:
28792879
- name: ts-user-service
2880-
image: codewisdom/ts-user-service:1.0.0
2880+
image: codewisdom/ts-user-service:1.0.1
28812881
imagePullPolicy: IfNotPresent
28822882
volumeMounts:
28832883
- name: skywalking-agent
@@ -3059,7 +3059,7 @@ spec:
30593059
args: [ "-c", "cp -R /skywalking/agent /agent/" ]
30603060
containers:
30613061
- name: ts-wait-order-service
3062-
image: codewisdom/ts-wait-order-service:1.0.0
3062+
image: codewisdom/ts-wait-order-service:1.0.1
30633063
imagePullPolicy: IfNotPresent
30643064
volumeMounts:
30653065
- name: skywalking-agent
@@ -3118,7 +3118,7 @@ spec:
31183118
spec:
31193119
containers:
31203120
- name: ts-ui-dashboard
3121-
image: codewisdom/ts-ui-dashboard:1.0.0
3121+
image: codewisdom/ts-ui-dashboard:1.0.1
31223122
imagePullPolicy: IfNotPresent
31233123
ports:
31243124
- containerPort: 8080

ts-admin-order-service/src/main/java/adminorder/service/AdminOrderServiceImpl.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public Response updateOrder(Order request, HttpHeaders headers) {
121121
if (request.getTrainNumber().startsWith("G") || request.getTrainNumber().startsWith("D")) {
122122

123123
AdminOrderServiceImpl.LOGGER.info("[updateOrder][Update Order][trainNumber starts With G or D]");
124-
HttpEntity requestEntity = new HttpEntity(request, null);
124+
HttpEntity requestEntity = new HttpEntity(request, headers);
125125
String order_service_url = getServiceUrl("ts-order-service");
126126
ResponseEntity<Response> re = restTemplate.exchange(
127127
order_service_url + "/api/v1/orderservice/order/admin",
@@ -132,7 +132,7 @@ public Response updateOrder(Order request, HttpHeaders headers) {
132132

133133
} else {
134134
AdminOrderServiceImpl.LOGGER.info("[updateOrder][Add New Order Other][trainNumber doesn't starts With G or D]");
135-
HttpEntity requestEntity = new HttpEntity(request, null);
135+
HttpEntity requestEntity = new HttpEntity(request, headers);
136136
String order_other_service_url = getServiceUrl("ts-order-other-service");
137137
ResponseEntity<Response> re = restTemplate.exchange(
138138
order_other_service_url + "/api/v1/orderOtherService/orderOther/admin",
@@ -152,7 +152,7 @@ public Response addOrder(Order request, HttpHeaders headers) {
152152
LOGGER.info("[addOrder][ADD ORDER][request info: {}]", request.toString());
153153
if (request.getTrainNumber().startsWith("G") || request.getTrainNumber().startsWith("D")) {
154154
AdminOrderServiceImpl.LOGGER.info("[addOrder][Add New Order][trainNumber starts With G or D]");
155-
HttpEntity requestEntity = new HttpEntity(request, null);
155+
HttpEntity requestEntity = new HttpEntity(request, headers);
156156
String order_service_url = getServiceUrl("ts-order-service");
157157
ResponseEntity<Response> re = restTemplate.exchange(
158158
order_service_url + "/api/v1/orderservice/order/admin",
@@ -163,7 +163,7 @@ public Response addOrder(Order request, HttpHeaders headers) {
163163

164164
} else {
165165
AdminOrderServiceImpl.LOGGER.info("[addOrder][Add New Order Other][trainNumber doesn't starts With G or D]");
166-
HttpEntity requestEntity = new HttpEntity(request, null);
166+
HttpEntity requestEntity = new HttpEntity(request, headers);
167167
String order_other_service_url = getServiceUrl("ts-order-other-service");
168168
ResponseEntity<Response> re = restTemplate.exchange(
169169
order_other_service_url + "/api/v1/orderOtherService/orderOther/admin",

ts-admin-user-service/src/main/java/adminuser/dto/UserDto.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@NoArgsConstructor
1212
@ToString
1313
public class UserDto {
14-
private String accountId;
14+
private String userId;
1515

1616
private String userName;
1717

ts-consign-price-service/src/main/java/consignprice/entity/ConsignPrice.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public class ConsignPrice {
2121
@GeneratedValue(generator = "jpa-uuid")
2222
@Column(length = 36)
2323
private String id;
24-
25-
@Column(name = "idx")
24+
@Column(name = "idx",unique = true)
2625
private int index;
2726
@Column(name = "initial_weight")
2827
private double initialWeight;

ts-consign-service/src/test/java/consign/service/ConsignServiceImplTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void testInsertConsignRecord() {
4545
HttpEntity requestEntity = new HttpEntity(null, headers);
4646
Response<Double> response = new Response<>(1, null, 3.0);
4747
ResponseEntity<Response<Double>> re = new ResponseEntity<>(response, HttpStatus.OK);
48-
Consign consignRequest = new Consign(UUID.randomUUID().toString(), UUID.randomUUID(), UUID.randomUUID(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, true);
48+
Consign consignRequest = new Consign(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, true);
4949
ConsignRecord consignRecord = new ConsignRecord(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, 3.0);
5050
Mockito.when(restTemplate.exchange(
5151
"http://ts-consign-price-service:16110/api/v1/consignpriceservice/consignprice/" + consignRequest.getWeight() + "/" + consignRequest.isWithin(),
@@ -63,7 +63,7 @@ public void testUpdateConsignRecord1() {
6363
HttpEntity requestEntity = new HttpEntity(null, headers);
6464
Response<Double> response = new Response<>(1, null, 3.0);
6565
ResponseEntity<Response<Double>> re = new ResponseEntity<>(response, HttpStatus.OK);
66-
Consign consignRequest = new Consign(UUID.randomUUID().toString(), UUID.randomUUID(), UUID.randomUUID(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, true);
66+
Consign consignRequest = new Consign(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, true);
6767
ConsignRecord consignRecord = new ConsignRecord(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 2.0, 3.0);
6868
Mockito.when(repository.findById(Mockito.anyString())).thenReturn(java.util.Optional.of(consignRecord));
6969
Mockito.when(restTemplate.exchange(
@@ -80,7 +80,7 @@ public void testUpdateConsignRecord1() {
8080

8181
@Test
8282
public void testUpdateConsignRecord2() {
83-
Consign consignRequest = new Consign(UUID.randomUUID().toString(), UUID.randomUUID(), UUID.randomUUID(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, true);
83+
Consign consignRequest = new Consign(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, true);
8484
ConsignRecord consignRecord = new ConsignRecord(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), "handle_date", "target_date", "place_from", "place_to", "consignee", "10001", 1.0, 3.0);
8585
Mockito.when(repository.findById(Mockito.anyString())).thenReturn(java.util.Optional.of(consignRecord));
8686
Mockito.when(repository.save(Mockito.any(ConsignRecord.class))).thenReturn(null);

ts-order-other-service/src/main/java/other/service/OrderOtherServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public Response create(Order order, HttpHeaders headers) {
9696
return new Response<>(0, "Order already exist", order);
9797
} else {
9898
order.setId(UUID.randomUUID().toString());
99-
orderOtherRepository.save(order);
99+
order=orderOtherRepository.save(order);
100100
OrderOtherServiceImpl.LOGGER.info("[create][Order Create Success][OrderId:{},Price: {}]",order.getId(),order.getPrice());
101101
return new Response<>(1, success, order);
102102
}

ts-order-service/src/main/java/order/service/OrderServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public Response create(Order order, HttpHeaders headers) {
9292
return new Response<>(0, "Order already exist", null);
9393
} else {
9494
order.setId(UUID.randomUUID().toString());
95-
orderRepository.save(order);
95+
order=orderRepository.save(order);
9696
OrderServiceImpl.LOGGER.info("[create][Order Create Success][Order Price][OrderId:{} , Price: {}]",order.getId(),order.getPrice());
9797
return new Response<>(1, success, order);
9898
}

ts-preserve-service/src/main/java/preserve/service/PreserveServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ private Response<Contacts> getContactsById(String contactsId, HttpHeaders httpHe
389389
}
390390

391391
private Response createOrder(Order coi, HttpHeaders httpHeaders) {
392-
PreserveServiceImpl.LOGGER.info("[createOrder][Preserve Other Service][Get Contacts By Id]");
392+
PreserveServiceImpl.LOGGER.info("[createOrder][Preserve Service][create order]");
393393

394394
HttpEntity requestEntityCreateOrderResult = new HttpEntity(coi, httpHeaders);
395395
String order_service_url = getServiceUrl("ts-order-service");

ts-rebook-service/src/main/java/rebook/service/RebookServiceImpl.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ public Response rebook(RebookInfo info, HttpHeaders httpHeaders) {
144144

145145
@Override
146146
public Response payDifference(RebookInfo info, HttpHeaders httpHeaders) {
147-
httpHeaders = null;
148147

149148
Response queryOrderResult = getOrderByRebookInfo(info, httpHeaders);
150-
151149
if (queryOrderResult.getStatus() == 0) {
152150
return new Response<>(0, queryOrderResult.getMsg(), null);
153151
}
@@ -160,8 +158,11 @@ public Response payDifference(RebookInfo info, HttpHeaders httpHeaders) {
160158
gtdi.setTripId(info.getTripId());
161159
// TripAllDetail
162160
Response gtdrResposne = getTripAllDetailInformation(gtdi, info.getTripId(), httpHeaders);
161+
162+
163163
TripAllDetail gtdr = (TripAllDetail) gtdrResposne.getData();
164164

165+
165166
String ticketPrice = "0";
166167
if (info.getSeatType() == SeatClass.FIRSTCLASS.getCode()) {
167168
ticketPrice = gtdr.getTripResponse().getPriceForConfortClass();
@@ -395,6 +396,7 @@ private Response<Order> getOrderByRebookInfo(RebookInfo info, HttpHeaders httpHe
395396
requestEntityGetOrderByRebookInfo,
396397
new ParameterizedTypeReference<Response<Order>>() {
397398
});
399+
398400
queryOrderResult = reGetOrderByRebookInfo.getBody();
399401
return queryOrderResult;
400402
}

ts-station-service/src/main/java/fdse/microservice/service/StationServiceImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public Response update(Station info, HttpHeaders headers) {
5656
return new Response<>(0, "Station not exist", null);
5757
} else {
5858
Station station = op.get();
59+
station.setName(info.getName());
5960
station.setStayTime(info.getStayTime());
6061
repository.save(station);
6162
return new Response<>(1, "Update success", station);

ts-ui-dashboard/static/assets/js/admin_user.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ app.controller('indexCtrl', function ($scope, $http, $window, loadDataService) {
145145
headers: {"Authorization": "Bearer " + sessionStorage.getItem("admin_token")},
146146
withCredentials: true,
147147
data: {
148-
accountId: $scope.update_user_id,
148+
userId: $scope.update_user_id,
149149
userName: $scope.update_user_name,
150150
password: $scope.update_user_password,
151151
gender: $scope.update_user_gender,

ts-ui-dashboard/static/assets/js/client_collect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var collectTicket = new Vue({
6060
// filter
6161
if(result.data[i].status == 1) {
6262
that.tempOrderList[tempIndex] = result.data[i];
63-
that.tempOrderList[tempIndex].boughtDate = that.convertNumberToDateTimeString(that.tempOrderList[tempIndex].boughtDate)
63+
// that.tempOrderList[tempIndex].boughtDate = that.convertNumberToDateTimeString(that.tempOrderList[tempIndex].boughtDate)
6464
tempIndex++;
6565
}
6666
}

ts-ui-dashboard/static/assets/js/client_ticket_book.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ function initFoodSelect(tripId, from, to, date) {
203203

204204
if (result.status == 1) {
205205

206-
var trainFoodList = result.data.trainFoodList[0]['foodList'];
206+
var trainFoodList = result.data.trainFoodList;
207207
console.log("trainFoodList:");
208-
console.log(trainFoodList[0]);
208+
console.log(trainFoodList);
209209

210210
$("#train-food-type-list").html("");
211211
$("#food-station-list").html("");

ts-user-service/src/main/java/user/service/impl/UserServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public Response deleteUser(String userId, HttpHeaders headers) {
151151
@Transactional
152152
public Response updateUser(UserDto userDto, HttpHeaders headers) {
153153
LOGGER.info("[updateUser][UPDATE USER: {}]", userDto.toString());
154-
User oldUser = userRepository.findByUserName(userDto.getUserName());
154+
User oldUser = userRepository.findByUserId(userDto.getUserId());
155155
if (oldUser != null) {
156156
User newUser = User.builder().email(userDto.getEmail())
157157
.password(userDto.getPassword())

ts-wait-order-service/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM java:8-jre
2+
3+
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
4+
5+
ADD ./target/ts-wait-order-service-1.0.jar /app/
6+
CMD ["java", "-Xmx200m", "-jar", "/app/ts-wait-order-service-1.0.jar"]
7+
8+
EXPOSE 15678

ts-wait-order-service/src/main/resources/application.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spring:
1212
datasource:
1313
url: jdbc:mysql://${WAIT_ORDER_MYSQL_HOST:10.176.122.1}:${WAIT_ORDER_MYSQL_PORT:3306}/${WAIT_ORDER_MYSQL_DATABASE:ts}?useSSL=false
1414
username: ${WAIT_ORDER_MYSQL_USER:root}
15-
password: ${WAIT_ORDER_PASSWORD:Abcd1234#}
15+
password: ${WAIT_ORDER_MYSQL_PASSWORD:Abcd1234#}
1616
driver-class-name: com.mysql.cj.jdbc.Driver
1717
jpa:
1818
hibernate:

0 commit comments

Comments
 (0)