Commit b3b50563 by 蘑菇🍄

fix

parent dd0af10a
......@@ -82,6 +82,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
if (isJSON(order.getAmountPayableInfo()) && isJSON(order.getDiscountAmountInfo())) {
copyList.remove(order);
continue;
}
order.setAmountPayableInfo(formatPayinfo(order.getAmountPayableInfo()));
order.setDiscountAmountInfo(formatDiscount(order.getDiscountAmountInfo()));
......@@ -124,6 +125,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
if (isJSON(order.getAmountPayableInfo()) && isJSON(order.getDiscountAmountInfo())) {
copyList.remove(order);
continue;
}
order.setAmountPayableInfo(formatPayinfo(order.getAmountPayableInfo()));
order.setDiscountAmountInfo(formatDiscount(order.getDiscountAmountInfo()));
......@@ -209,7 +211,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
@Override
public void formatLogistics() {
handlerOrderLogistics();
// handlerOrderLogistics();
handlerOrderRefundLogistics();
}
......@@ -227,16 +229,14 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
CopyOnWriteArrayList<OrderLogistics> copyList = new CopyOnWriteArrayList(page.getContent());
for (OrderLogistics order : copyList) {
if (isJSON(order.getLogisticsInformation()) ) {
copyList.remove(order);
}
order.setLogisticsInformation(formateTraces(order.getLogisticsInformation()));
}
if (CollectionUtils.isEmpty(copyList)) {
continue;
if (!CollectionUtils.isEmpty(copyList)) {
orderLogisticsRepository.save(copyList);
}
orderLogisticsRepository.save(copyList);
}
}
......@@ -254,9 +254,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
CopyOnWriteArrayList<OrderRefundLogistics> copyList = new CopyOnWriteArrayList(page.getContent());
for (OrderRefundLogistics order : copyList) {
if (isJSON(order.getLogisticsInformation()) ) {
copyList.remove(order);
}
order.setLogisticsInformation(formateTraces(order.getLogisticsInformation()));
}
......@@ -284,6 +282,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
try {
trace.put("Traces", JSON.parseArray(info));
}catch (Exception e){
e.printStackTrace();
logger.info("source:{}",info);
trace.put("Traces", new JSONArray());
}
......
......@@ -28,6 +28,11 @@ public class OrderJsonFormatTest extends GicJpaDemoApplicationTests{
}
@Test
public void testLogistics() {
format.formatLogistics();
}
@Test
public void formatOrderTest() {
format.formatOrder();
format.formatOrderItem();
......
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