Merge remote-tracking branch 'origin/cc_20250325_select' into cc_20250325_select
This commit is contained in:
@@ -69,6 +69,7 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
||||
orderSysInfoDO.setAddresseeDistrict(request.getAddresseeDistrict());
|
||||
orderSysInfoDO.setAddresseeAddress(request.getAddresseeAddress());
|
||||
orderSysInfoDO.setDeclareGoodsLogisticsWarehouse(request.getDeclareGoodsLogisticsWarehouse());
|
||||
orderSysInfoDO.setDeclareGoodsType(request.getDeclareGoodsType());
|
||||
orderSysInfoDO.setDeclareGoodsDate(request.getDeclareGoodsDate());
|
||||
orderSysInfoDO.setWarehouseDeliveryDate(request.getWarehouseDeliveryDate());
|
||||
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus())) {
|
||||
|
||||
@@ -340,8 +340,7 @@ public class PointServiceImpl implements PointService {
|
||||
private Boolean checkIsAudit(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfoDO) {
|
||||
if (StringUtils.isAnyBlank(pointInfo.getPointArea(), pointInfo.getLatitude(),
|
||||
pointInfo.getLongitude(), pointInfo.getAddress(), pointInfo.getProvince(), pointInfo.getCity(),
|
||||
pointInfo.getDistrict(), pointInfo.getTownship(), pointInfo.getOpportunityPointCode(), pointInfo.getOpportunityPointName()
|
||||
, pointInfo.getProvinceCode(), pointInfo.getCityCode(), pointInfo.getDistrictCode(), pointDetailInfoDO.getMonthRent()
|
||||
pointInfo.getDistrict(), pointDetailInfoDO.getMonthRent()
|
||||
, pointDetailInfoDO.getLandlordMobile())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.cool.store.service.impl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.DeclareGoodsDateDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.DownSystemTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
@@ -13,8 +14,11 @@ import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
import com.cool.store.mapper.SignFranchiseMapper;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.service.SyncDataService;
|
||||
import com.cool.store.utils.JSONUtils;
|
||||
import com.cool.store.utils.JsonUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -140,8 +144,8 @@ public class SyncDataServiceImpl implements SyncDataService {
|
||||
request.setAddresseeDistrict(orderSysInfoDO.getAddresseeDistrict());
|
||||
request.setAddresseeAddress(orderSysInfoDO.getAddresseeAddress());
|
||||
request.setDeclareGoodsLogisticsWarehouse(orderSysInfoDO.getDeclareGoodsLogisticsWarehouse());
|
||||
request.setDeclareGoodsDate(orderSysInfoDO.getDeclareGoodsDate());
|
||||
request.setWarehouseDeliveryDate(orderSysInfoDO.getWarehouseDeliveryDate());
|
||||
request.setDeclareGoodsType(orderSysInfoDO.getDeclareGoodsType());
|
||||
request.setDeclareGoodsDate(JSONUtils.parseToListOrMap(orderSysInfoDO.getDeclareGoodsDate(), new TypeReference<List<DeclareGoodsDateDTO>>() {}));
|
||||
request.setReceivingFirmName(orderSysInfoDO.getReceivingFirmName());
|
||||
request.setReceivingMSBankAccount(orderSysInfoDO.getReceivingMsBankAccount());
|
||||
request.setReceivingMSBankBranch(orderSysInfoDO.getReceivingMsBankBranch());
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class JSONUtils {
|
||||
|
||||
// 创建 ObjectMapper 实例(建议单例)
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
/**
|
||||
* 将 JSON 字符串解析为指定类型的对象
|
||||
*
|
||||
* @param jsonString JSON 字符串
|
||||
* @param clazz 目标类型的 Class 对象
|
||||
* @param <T> 泛型类型
|
||||
* @return 转换后的对象
|
||||
*/
|
||||
public static <T> T parseToObject(String jsonString, Class<T> clazz) {
|
||||
if (StringUtil.isBlank(jsonString) || clazz == null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return objectMapper.readValue(jsonString, clazz);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException("JSON 解析失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 JSON 字符串解析为指定类型的对象列表
|
||||
*
|
||||
* @param jsonString JSON 字符串
|
||||
* @param typeRef TypeReference,用于描述复杂类型(如 List<T>)
|
||||
* @param <T> 泛型类型
|
||||
* @return 转换后的对象列表
|
||||
*/
|
||||
public static <T> T parseToListOrMap(String jsonString, TypeReference<T> typeRef) {
|
||||
if (StringUtil.isBlank(jsonString) || typeRef == null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return objectMapper.readValue(jsonString, typeRef);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException("JSON 解析失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将对象转换为 JSON 字符串
|
||||
*
|
||||
* @param object 待转换的对象
|
||||
* @return JSON 字符串
|
||||
*/
|
||||
public static String toJsonString(Object object) {
|
||||
if (object == null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return objectMapper.writeValueAsString(object);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException("对象转 JSON 失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user