This commit is contained in:
shuo.wang
2025-04-16 21:06:44 +08:00
parent 6b2f393f89
commit 413279f6ea
9 changed files with 115 additions and 10 deletions

View File

@@ -17,6 +17,7 @@
<result property="addresseeAddress" column="addressee_address" jdbcType="VARCHAR"/>
<result property="declareGoodsLogisticsWarehouse" column="declare_goods_logistics_warehouse"
jdbcType="VARCHAR"/>
<result property="declareGoodsType" column="declare_goods_type" jdbcType="VARCHAR"/>
<result property="declareGoodsDate" column="declare_goods_date" jdbcType="VARCHAR"/>
<result property="warehouseDeliveryDate" column="warehouse_delivery_date" jdbcType="VARCHAR"/>
<result property="orderCreateTime" column="order_create_time" jdbcType="TIMESTAMP"/>
@@ -37,6 +38,7 @@
addressee_district, addressee_address, declare_goods_logistics_warehouse, declare_goods_date,
warehouse_delivery_date, order_create_time, order_update_time, order_create_user, order_update_user,
receiving_firm_name, receiving_ms_bank_account, receiving_ms_bank_branch, bank_unionPay_account,
receiving_create_time, receiving_update_time, receiving_create_user, receiving_update_user
receiving_create_time, receiving_update_time, receiving_create_user, receiving_update_user,
declare_goods_type
</sql>
</mapper>

View File

@@ -0,0 +1,20 @@
package com.cool.store.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/04/16/20:46
* @Version 1.0
* @注释:
*/
@Data
public class DeclareGoodsDateDTO {
@ApiModelProperty(value = "报货日期,例如:星期一(星期六,星期天)/每月1号")
private String declareGoods;
@ApiModelProperty(value = "报货日期,例如:星期一(星期六,星期天)/每月1号")
private String deliverGoods;
}

View File

@@ -58,6 +58,10 @@ public class OrderSysInfoDO {
@Column(name = "declare_goods_logistics_warehouse")
private String declareGoodsLogisticsWarehouse;
/** 报货类型 */
@Column(name = "declare_goods_type")
private String declareGoodsType;
/** 报货日期 */
@Column(name = "declare_goods_date")
private String declareGoodsDate;

View File

@@ -48,7 +48,10 @@ public class OrderSysInfoRequest {
@ApiModelProperty(value = "报货物流仓库(编码)" )
private String declareGoodsLogisticsWarehouse;
@ApiModelProperty(value = "报货日期" )
@ApiModelProperty(value = "报货类型 0-按周报货 1-按月报货 2-自提" )
private String declareGoodsType;
@ApiModelProperty(value = "报货日期 数组格式\"[{ 报货日期 \"declareGoods\": \"\",送货日期\"deliverGoods\":\"\"}]" )
private String declareGoodsDate;
@ApiModelProperty(value = "仓库配送日期" )
@@ -101,6 +104,7 @@ public class OrderSysInfoRequest {
orderSysInfoDO.setAddresseeDistrict(this.addresseeDistrict);
orderSysInfoDO.setAddresseeAddress(this.addresseeAddress);
orderSysInfoDO.setDeclareGoodsLogisticsWarehouse(this.declareGoodsLogisticsWarehouse);
orderSysInfoDO.setDeclareGoodsType(this.declareGoodsType);
orderSysInfoDO.setDeclareGoodsDate(this.declareGoodsDate);
orderSysInfoDO.setWarehouseDeliveryDate(this.warehouseDeliveryDate);
@@ -113,7 +117,7 @@ public class OrderSysInfoRequest {
}
public Boolean check(){
if (Objects.equals(this.type, OrderSysTypeEnum.ORDER_SYS_TYPE_1.getType())){
if (StringUtils.isAnyBlank(this.xgjRegionId,this.xgjVicePresident,this.declareGoodsDate,this.declareGoodsLogisticsWarehouse,this.warehouseDeliveryDate)){
if (StringUtils.isAnyBlank(this.xgjRegionId,this.xgjVicePresident,this.declareGoodsDate,this.declareGoodsLogisticsWarehouse,this.declareGoodsType)){
return false;
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.request;
import com.cool.store.dto.DeclareGoodsDateDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -191,11 +192,11 @@ public class ZxjpApiRequest {
@ApiModelProperty(value = "报货物流仓库(编码)")
private String declareGoodsLogisticsWarehouse ;
@ApiModelProperty(value = "报货日期")
private String declareGoodsDate ;
@ApiModelProperty(value = "报货类型 0-按周报货 1-按月报货 2-自提" )
private String declareGoodsType;
@ApiModelProperty(value = "仓库配送日期")
private String warehouseDeliveryDate ;
@ApiModelProperty(value = "报货日期" )
private List<DeclareGoodsDateDTO> declareGoodsDate;
@ApiModelProperty(value = "收款公司名称")
private String receivingFirmName;

View File

@@ -150,7 +150,10 @@ public class BuildInformationResponse {
@ApiModelProperty(value = "报货物流仓库" )
private String declareGoodsLogisticsWarehouseName;
@ApiModelProperty(value = "报货日期" )
@ApiModelProperty(value = "报货类型 0-按周报货 1-按月报货 2-自提" )
private String declareGoodsType;
@ApiModelProperty(value = "报货日期 数组格式\"[{ 报货日期declareGoods: \"\",送货日期deliverGoods:\"\"}]" )
private String declareGoodsDate;
@ApiModelProperty(value = "仓库配送日期" )

View File

@@ -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())) {

View File

@@ -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());

View File

@@ -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);
}
}
}