修改bug

20230922-ljl-fixBug
ljl 1 year ago
parent 3190a154d4
commit a90d7ddbd7

@ -385,7 +385,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
continue; continue;
} }
for (Map.Entry<String, DsPayRetDTO> entry: sourceOrderIdAndPayRetMap.entrySet()) { for (Map.Entry<String, DsPayRetDTO> entry: sourceOrderIdAndPayRetMap.entrySet()) {
if (!entry.getValue().getReason().isEmpty()) { if (entry.getValue().getReason() != null && !entry.getValue().getReason().isEmpty()) {
continue; continue;
} }
sourceOrderIdAndPayFailReasonMap.put(entry.getKey(), entry.getValue().getReason()); sourceOrderIdAndPayFailReasonMap.put(entry.getKey(), entry.getValue().getReason());
@ -448,11 +448,19 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
OpOrder opOrder = orderIdAndOrderMap.get(platformOrder.getPlatformOrderId()); OpOrder opOrder = orderIdAndOrderMap.get(platformOrder.getPlatformOrderId());
if (purchaseSetting.getIsAutoFillRemark() >= 1) { if (purchaseSetting.getIsAutoFillRemark() >= 1) {
String autoFillRemarkTpl = buildRemarkTplHtml(purchaseSetting.getAutoFillRemarkTpl()); String autoFillRemarkTpl = buildRemarkTplHtml(purchaseSetting.getAutoFillRemarkTpl());
platformOrder.setSourceOrderBuyerRemark(buildSourceOrderRemarkAndMemo(shop, autoFillRemarkTpl, opOrder)); String sourceOrderBuyerRemark = buildSourceOrderRemarkAndMemo(shop, autoFillRemarkTpl, opOrder);
if (sourceOrderBuyerRemark.length() > 500) {
sourceOrderBuyerRemark = sourceOrderBuyerRemark.substring(0, 500);
}
platformOrder.setSourceOrderBuyerRemark(sourceOrderBuyerRemark);
} }
if (purchaseSetting.getIsAutoFillOrderMemo() >= 1) { if (purchaseSetting.getIsAutoFillOrderMemo() >= 1) {
String autoFillOrderMemoTpl = buildRemarkTplHtml(purchaseSetting.getAutoFillOrderMemoTpl()); String autoFillOrderMemoTpl = buildRemarkTplHtml(purchaseSetting.getAutoFillOrderMemoTpl());
platformOrder.setSourceOrderSellerMemo(buildSourceOrderRemarkAndMemo(shop, autoFillOrderMemoTpl, opOrder)); String sourceOrderSellerMemo = buildSourceOrderRemarkAndMemo(shop, autoFillOrderMemoTpl, opOrder);
if (sourceOrderSellerMemo.length() > 500) {
sourceOrderSellerMemo = sourceOrderSellerMemo.substring(0, 500);
}
platformOrder.setSourceOrderSellerMemo(sourceOrderSellerMemo);
} }
} }
} }
@ -543,6 +551,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return newSellerWords; return newSellerWords;
} }
log.info("shopRemarkFlag: " + shopRemarkFlag); log.info("shopRemarkFlag: " + shopRemarkFlag);
if (newSellerWords.length() > 500) {
newSellerWords = newSellerWords.substring(0, 500);
}
opOrderService.updateOpOrderSellerRemarkToDb(shopBO, opOrder.getOrderId(), newSellerWords, shopRemarkFlag, false, OrderPrintConst.UPDATE_SELLER_WORD_SOURCE_SINGLE, purchaseOrderRemark); opOrderService.updateOpOrderSellerRemarkToDb(shopBO, opOrder.getOrderId(), newSellerWords, shopRemarkFlag, false, OrderPrintConst.UPDATE_SELLER_WORD_SOURCE_SINGLE, purchaseOrderRemark);
return newSellerWords; return newSellerWords;
} }
@ -570,6 +581,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
return newShopNote; return newShopNote;
} }
newShopNote = newShopNote.replaceAll(AppConst.appChineseName, "0.0"); newShopNote = newShopNote.replaceAll(AppConst.appChineseName, "0.0");
if (newShopNote.length() > 500) {
newShopNote = newShopNote.substring(0, 500);
}
opOrderExtService.updateOpOrderShopNote(shopId, orderId, newShopNote); opOrderExtService.updateOpOrderShopNote(shopId, orderId, newShopNote);
return newShopNote; return newShopNote;
} }

@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
@ -117,6 +118,10 @@ public class CloudRequestTemplate {
} }
// 发起请求 // 发起请求
// SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
// requestFactory.setConnectTimeout(10000); // 设置连接超时时间为5秒
// requestFactory.setReadTimeout(20000); // 设置读取超时时间为5秒
final ResponseEntity<byte[]> responseEntity = restTemplate.exchange(reqeustUrl, HttpMethod.POST, requestEntity, byte[].class); final ResponseEntity<byte[]> responseEntity = restTemplate.exchange(reqeustUrl, HttpMethod.POST, requestEntity, byte[].class);
log.info("#executePost responseEntity: {}", JSON.toJSONString(responseEntity)); log.info("#executePost responseEntity: {}", JSON.toJSONString(responseEntity));
if (Objects.isNull(responseEntity) || responseEntity.getStatusCodeValue() != 200 || StringUtils.isEmpty(responseEntity.getBody())) { if (Objects.isNull(responseEntity) || responseEntity.getStatusCodeValue() != 200 || StringUtils.isEmpty(responseEntity.getBody())) {

@ -162,6 +162,8 @@ public class Test {
} }
public static void main(String[] args) throws ParseException { public static void main(String[] args) throws ParseException {
System.out.println("ni号顺11".length());
System.out.println("ni号顺11".substring(0, 6));
try { try {
System.out.println(CommonTool.mbSubString("你12324好是的3423423发生45345率的4353发生3453率胜453多负少", 10)); System.out.println(CommonTool.mbSubString("你12324好是的3423423发生45345率的4353发生3453率胜453多负少", 10));
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save