订单管理
This commit is contained in:
parent
46e107e86b
commit
022f73dd9e
@ -1,12 +1,23 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="asinkj-auth" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
<configuration default="false" name="asinkj-auth" type="docker-deploy" factoryName="dockerfile" server-name="阿里云">
|
||||||
<deployment type="dockerfile">
|
<deployment type="dockerfile">
|
||||||
<settings>
|
<settings>
|
||||||
<option name="imageTag" value="asinkj/asinkj-auth:2.2.2" />
|
<option name="imageTag" value="asinkj/asinkj-auth:2.2.2" />
|
||||||
<option name="buildOnly" value="true" />
|
<option name="containerName" value="asinkj-auth" />
|
||||||
|
<option name="portBindings">
|
||||||
|
<list>
|
||||||
|
<DockerPortBindingImpl>
|
||||||
|
<option name="containerPort" value="9210" />
|
||||||
|
<option name="hostPort" value="9210" />
|
||||||
|
</DockerPortBindingImpl>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="commandLineOptions" value="--network 1panel-network" />
|
||||||
<option name="sourceFilePath" value="asinkj-auth/Dockerfile" />
|
<option name="sourceFilePath" value="asinkj-auth/Dockerfile" />
|
||||||
</settings>
|
</settings>
|
||||||
</deployment>
|
</deployment>
|
||||||
<method v="2" />
|
<method v="2">
|
||||||
|
<option name="Maven.BeforeRunTask" enabled="true" file="F:\Asinkj-Cloud\asinkj-auth/pom.xml" goal="package" />
|
||||||
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
27
asinkj-api/asinkj-api-amz/pom.xml
Normal file
27
asinkj-api/asinkj-api-amz/pom.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.asinkj</groupId>
|
||||||
|
<artifactId>asinkj-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>asinkj-api-amz</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
asinkj-api-amz amz服务接口模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- AsinKj Common Core-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.asinkj</groupId>
|
||||||
|
<artifactId>asinkj-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,8 @@
|
|||||||
|
package org.asinkj.amz.api;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface RemoteFBADataService {
|
||||||
|
void pullAmzFbaDataToken(String startDate, String endDate) throws Exception;
|
||||||
|
}
|
@ -41,6 +41,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.asinkj</groupId>
|
||||||
|
<artifactId>asinkj-api-amz</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
</project>
|
</project>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<module>asinkj-api-system</module>
|
<module>asinkj-api-system</module>
|
||||||
<module>asinkj-api-resource</module>
|
<module>asinkj-api-resource</module>
|
||||||
<module>asinkj-api-workflow</module>
|
<module>asinkj-api-workflow</module>
|
||||||
|
<module>asinkj-api-amz</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>asinkj-api</artifactId>
|
<artifactId>asinkj-api</artifactId>
|
||||||
|
@ -18,6 +18,7 @@ EXPOSE ${SERVER_PORT}
|
|||||||
ADD ./target/asinkj-auth.jar ./app.jar
|
ADD ./target/asinkj-auth.jar ./app.jar
|
||||||
|
|
||||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
|
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
|
||||||
|
-Dspring.profiles.active='prod' \ # 动态读取环境变量
|
||||||
#-Dskywalking.agent.service_name=asinkj-auth \
|
#-Dskywalking.agent.service_name=asinkj-auth \
|
||||||
#-javaagent:/asinkj/skywalking/agent/skywalking-agent.jar \
|
#-javaagent:/asinkj/skywalking/agent/skywalking-agent.jar \
|
||||||
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
||||||
|
@ -105,6 +105,11 @@
|
|||||||
<artifactId>asinkj-api-resource</artifactId>
|
<artifactId>asinkj-api-resource</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.asinkj</groupId>
|
||||||
|
<artifactId>asinkj-api-amz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
<artifactId>okhttp</artifactId>
|
<artifactId>okhttp</artifactId>
|
||||||
|
@ -103,4 +103,19 @@ public class BizLogisticsOrderDetailController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(bizLogisticsOrderDetailService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(bizLogisticsOrderDetailService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物流订单明细(按箱子维度存储)
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:logisticsOrderDetail:edit")
|
||||||
|
@Log(title = "批量更新物流订单明细", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/updateList")
|
||||||
|
public R<Void> updateList(@Validated(AddGroup.class) @RequestBody List<BizLogisticsOrderDetailBo> list) {
|
||||||
|
bizLogisticsOrderDetailService.updateList(list);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.asinkj.amz.controller;
|
package org.asinkj.amz.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
@ -112,9 +113,9 @@ public class BizLogisticsQuoteController extends BaseController {
|
|||||||
|
|
||||||
@GetMapping("/today-quote-status")
|
@GetMapping("/today-quote-status")
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
public ResponseEntity<List<InquiryQuoteStatusDTO>> getTodayQuoteStatus() {
|
public R<List<InquiryQuoteStatusDTO>> getTodayQuoteStatus() {
|
||||||
List<InquiryQuoteStatusDTO> statusList = bizLogisticsQuoteService.getTodayQuoteStatus();
|
List<InquiryQuoteStatusDTO> statusList = bizLogisticsQuoteService.getTodayQuoteStatus();
|
||||||
return ResponseEntity.ok(statusList);
|
return R.ok(statusList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,4 +141,13 @@ public class BizLogisticsQuoteController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(bizLogisticsQuoteService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(bizLogisticsQuoteService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SaCheckPermission("amz:logisticsQuote:query")
|
||||||
|
@GetMapping("/report")
|
||||||
|
public R<List<Map<String, Object>>> getInfo() {
|
||||||
|
List<Map<String, Object>> maps = bizLogisticsQuoteService.generateReport();
|
||||||
|
return R.ok(maps);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -134,4 +134,28 @@ public class SysAmazonStoreController extends BaseController {
|
|||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SaCheckPermission("amz:amazonStore:remove")
|
||||||
|
@Log(title = "亚马逊FBAtest", businessType = BusinessType.OTHER)
|
||||||
|
@GetMapping("/test")
|
||||||
|
public R<Void> testAmzFbaToken() {
|
||||||
|
try {
|
||||||
|
sysAmazonStoreService.testAmazonData();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SaCheckPermission("amz:amazonStore:remove")
|
||||||
|
@Log(title = "亚马逊FBAtest", businessType = BusinessType.OTHER)
|
||||||
|
@GetMapping("/test2")
|
||||||
|
public R<Void> testAmzFbaToken2() {
|
||||||
|
try {
|
||||||
|
sysAmazonStoreService.testAmazonData2();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,11 @@ public class BizInquiryRequest extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long requesterId;
|
private Long requesterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人名称
|
||||||
|
*/
|
||||||
|
private String requesterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 目标物流商ID列表(JSON数组格式,示例:[101,202,303])
|
* 目标物流商ID列表(JSON数组格式,示例:[101,202,303])
|
||||||
*/
|
*/
|
||||||
|
@ -33,6 +33,10 @@ public class BizLogisticsQuote extends TenantEntity {
|
|||||||
* 物流商用户ID(关联sys_user表)
|
* 物流商用户ID(关联sys_user表)
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 物流商
|
||||||
|
*/
|
||||||
|
private String logisticsName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 目的地(建议使用ISO国家代码如CN/US/GB)
|
* 目的地(建议使用ISO国家代码如CN/US/GB)
|
||||||
|
@ -142,12 +142,14 @@ public class BizLogisticsOrderDetailBo extends BaseEntity {
|
|||||||
* 预计签收日期(物流商提供的预估日期)
|
* 预计签收日期(物流商提供的预估日期)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "预计签收日期(物流商提供的预估日期)不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "预计签收日期(物流商提供的预估日期)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private Date estimatedDeliveryDate;
|
private Date estimatedDeliveryDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实际签收日期(物流商回传的实际日期)
|
* 实际签收日期(物流商回传的实际日期)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "实际签收日期(物流商回传的实际日期)不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "实际签收日期(物流商回传的实际日期)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private Date actualDeliveryDate;
|
private Date actualDeliveryDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,67 +35,56 @@ public class SysAmazonStoreBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 领星ERP店铺标识ID
|
* 领星ERP店铺标识ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "领星ERP店铺标识ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long sid;
|
private Long sid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点ID
|
* 站点ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "站点ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long mid;
|
private Long mid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺名称
|
* 店铺名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "店铺名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String storeName;
|
private String storeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 亚马逊店铺ID(如AZTOL**)
|
* 亚马逊店铺ID(如AZTOL**)
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "亚马逊店铺ID(如AZTOL**)不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String sellerId;
|
private String sellerId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺账户名称
|
* 店铺账户名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "店铺账户名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String accountName;
|
private String accountName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺账号ID
|
* 店铺账号ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "店铺账号ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long sellerAccountId;
|
private Long sellerAccountId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点简称(如NA/EU)
|
* 站点简称(如NA/EU)
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "站点简称(如NA/EU)不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String region;
|
private String region;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商城所在国家
|
* 商城所在国家
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "商城所在国家不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String country;
|
private String country;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 亚马逊市场ID
|
* 亚马逊市场ID
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "亚马逊市场ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String marketplaceId;
|
private String marketplaceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 广告授权 0未授权 1已授权
|
* 广告授权 0未授权 1已授权
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "广告授权 0未授权 1已授权不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long hasAdsSetting;
|
private Long hasAdsSetting;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺状态 0停用 1正常 2异常 3欠费
|
* 店铺状态 0停用 1正常 2异常 3欠费
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "店铺状态 0停用 1正常 2异常 3欠费不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long status;
|
private Long status;
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,9 +48,15 @@ public class BizInquiryRequestVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 发起人id
|
* 发起人id
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "发起人id")
|
|
||||||
private Long requesterId;
|
private Long requesterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "发起人名称")
|
||||||
|
private String requesterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 目标物流商ID列表(JSON数组格式,示例:[101,202,303])
|
* 目标物流商ID列表(JSON数组格式,示例:[101,202,303])
|
||||||
*/
|
*/
|
||||||
@ -83,14 +89,12 @@ public class BizInquiryRequestVo implements Serializable {
|
|||||||
* 报价截止时间(超过此时限自动关闭询价)
|
* 报价截止时间(超过此时限自动关闭询价)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "报价截止时间", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "报价截止时间", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(readConverterExp = "超=过此时限自动关闭询价")
|
|
||||||
private LocalDateTime deadline;
|
private LocalDateTime deadline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 渠道ID(system=dict_code,custom=自定义渠道ID)
|
* 渠道ID(system=dict_code,custom=自定义渠道ID)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "渠道ID", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "渠道ID")
|
||||||
@ExcelDictFormat(readConverterExp = "s=ystem=dict_code,custom=自定义渠道ID")
|
|
||||||
private Long channelId;
|
private Long channelId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,6 +170,7 @@ public class BizLogisticsOrderDetailVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "预计签收日期")
|
@ExcelProperty(value = "预计签收日期")
|
||||||
// @ExcelDictFormat(readConverterExp = "物=流商提供的预估日期")
|
// @ExcelDictFormat(readConverterExp = "物=流商提供的预估日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private Date estimatedDeliveryDate;
|
private Date estimatedDeliveryDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -177,6 +178,7 @@ public class BizLogisticsOrderDetailVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "实际签收日期")
|
@ExcelProperty(value = "实际签收日期")
|
||||||
// @ExcelDictFormat(readConverterExp = "物=流商回传的实际日期")
|
// @ExcelDictFormat(readConverterExp = "物=流商回传的实际日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private Date actualDeliveryDate;
|
private Date actualDeliveryDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,6 +9,7 @@ import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
|||||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -106,4 +107,8 @@ public class BizLogisticsOrderVo implements Serializable {
|
|||||||
private Long shelfTimeliness;
|
private Long shelfTimeliness;
|
||||||
|
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.asinkj.amz.domain.vo;
|
package org.asinkj.amz.domain.vo;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.asinkj.amz.domain.BizLogisticsQuote;
|
import org.asinkj.amz.domain.BizLogisticsQuote;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
@ -9,13 +10,13 @@ import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
|||||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流报价视图对象 biz_logistics_quote
|
* 物流报价视图对象 biz_logistics_quote
|
||||||
*
|
*
|
||||||
@ -39,10 +40,13 @@ public class BizLogisticsQuoteVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 物流商用户ID(关联sys_user表)
|
* 物流商用户ID(关联sys_user表)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "物流商用户ID", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(readConverterExp = "关=联sys_user表")
|
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty(value = "物流商")
|
||||||
|
private String logisticsName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 目的地(建议使用ISO国家代码如CN/US/GB)
|
* 目的地(建议使用ISO国家代码如CN/US/GB)
|
||||||
*/
|
*/
|
||||||
@ -123,4 +127,6 @@ public class BizLogisticsQuoteVo implements Serializable {
|
|||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package org.asinkj.amz.dubbo;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
|
import org.asinkj.amz.api.RemoteFBADataService;
|
||||||
|
import org.asinkj.amz.service.ISysAmazonStoreService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
@DubboService
|
||||||
|
public class RemoteFBADataServiceImpl implements RemoteFBADataService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysAmazonStoreService sysAmazonStoreService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pullAmzFbaDataToken(String startDate, String endDate) throws Exception {
|
||||||
|
sysAmazonStoreService.pullAmzFBAData(startDate,endDate);
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,8 @@ import org.asinkj.amz.domain.BizLogisticsChannel;
|
|||||||
import org.asinkj.amz.domain.vo.BizLogisticsChannelVo;
|
import org.asinkj.amz.domain.vo.BizLogisticsChannelVo;
|
||||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流商渠道Mapper接口
|
* 物流商渠道Mapper接口
|
||||||
*
|
*
|
||||||
@ -12,4 +14,5 @@ import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface BizLogisticsChannelMapper extends BaseMapperPlus<BizLogisticsChannel, BizLogisticsChannelVo> {
|
public interface BizLogisticsChannelMapper extends BaseMapperPlus<BizLogisticsChannel, BizLogisticsChannelVo> {
|
||||||
|
|
||||||
|
List<String> listAllChannels();
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流报价Mapper接口
|
* 物流报价Mapper接口
|
||||||
@ -20,4 +21,8 @@ public interface BizLogisticsQuoteMapper extends BaseMapperPlus<BizLogisticsQuot
|
|||||||
@Param("providerIds") List<Long> providerIds,
|
@Param("providerIds") List<Long> providerIds,
|
||||||
@Param("quoteDate") LocalDate quoteDate
|
@Param("quoteDate") LocalDate quoteDate
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
List<Map<String, Object>> selectDynamicReport(@Param("channels") List<String> channels);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -66,4 +66,6 @@ public interface IBizLogisticsOrderDetailService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
void updateList(List<BizLogisticsOrderDetailBo> list);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import org.asinkj.common.mybatis.core.page.PageQuery;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流报价Service接口
|
* 物流报价Service接口
|
||||||
@ -27,6 +28,8 @@ public interface IBizLogisticsQuoteService {
|
|||||||
*/
|
*/
|
||||||
BizLogisticsQuoteVo queryById(Long id);
|
BizLogisticsQuoteVo queryById(Long id);
|
||||||
|
|
||||||
|
List<Map<String, Object>> generateReport();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询物流报价列表
|
* 分页查询物流报价列表
|
||||||
*
|
*
|
||||||
|
@ -75,4 +75,8 @@ public interface ISysAmazonStoreService {
|
|||||||
void pullAmzFBAData(String startDate,String endDate) throws Exception;
|
void pullAmzFBAData(String startDate,String endDate) throws Exception;
|
||||||
|
|
||||||
void getAmzStoreTokenData() throws Exception;
|
void getAmzStoreTokenData() throws Exception;
|
||||||
|
|
||||||
|
void testAmazonData() throws Exception;
|
||||||
|
|
||||||
|
void testAmazonData2() throws Exception;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getDestination()), BizInquiryRequest::getDestination, bo.getDestination());
|
lqw.eq(StringUtils.isNotBlank(bo.getDestination()), BizInquiryRequest::getDestination, bo.getDestination());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getTransportChannel()), BizInquiryRequest::getTransportChannel, bo.getTransportChannel());
|
lqw.eq(StringUtils.isNotBlank(bo.getTransportChannel()), BizInquiryRequest::getTransportChannel, bo.getTransportChannel());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getInquiryStatus()), BizInquiryRequest::getInquiryStatus, bo.getInquiryStatus());
|
lqw.eq(StringUtils.isNotBlank(bo.getInquiryStatus()), BizInquiryRequest::getInquiryStatus, bo.getInquiryStatus());
|
||||||
lqw.eq(bo.getDeadline() != null, BizInquiryRequest::getDeadline, bo.getDeadline());
|
// lqw.ge(BizInquiryRequest::getDeadline, DateUtil.now());
|
||||||
lqw.eq(bo.getChannelId() != null, BizInquiryRequest::getChannelId, bo.getChannelId());
|
lqw.eq(bo.getChannelId() != null, BizInquiryRequest::getChannelId, bo.getChannelId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getChannelName()), BizInquiryRequest::getChannelName, bo.getChannelName());
|
lqw.like(StringUtils.isNotBlank(bo.getChannelName()), BizInquiryRequest::getChannelName, bo.getChannelName());
|
||||||
lqw.eq(bo.getEffectiveStartTime() != null, BizInquiryRequest::getEffectiveStartTime, bo.getEffectiveStartTime());
|
lqw.eq(bo.getEffectiveStartTime() != null, BizInquiryRequest::getEffectiveStartTime, bo.getEffectiveStartTime());
|
||||||
@ -175,6 +175,8 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
|||||||
BizInquiryRequest bizInquiryRequest = new BizInquiryRequest();
|
BizInquiryRequest bizInquiryRequest = new BizInquiryRequest();
|
||||||
bizInquiryRequest.setDestination(destination);
|
bizInquiryRequest.setDestination(destination);
|
||||||
bizInquiryRequest.setChannelId(NumberUtil.parseLong(channelId));
|
bizInquiryRequest.setChannelId(NumberUtil.parseLong(channelId));
|
||||||
|
|
||||||
|
bizInquiryRequest.setRequesterName(LoginHelper.getLoginUser().getNickname());
|
||||||
if (bizInquiryRequest.getChannelId() == null) {
|
if (bizInquiryRequest.getChannelId() == null) {
|
||||||
return R.fail("渠道不能为空");
|
return R.fail("渠道不能为空");
|
||||||
}
|
}
|
||||||
@ -223,20 +225,10 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
|||||||
queryWrapper.eq(BizInquiryRequest::getDestination, destination);
|
queryWrapper.eq(BizInquiryRequest::getDestination, destination);
|
||||||
queryWrapper.eq(BizInquiryRequest::getChannelId, NumberUtil.parseLong(channelId));
|
queryWrapper.eq(BizInquiryRequest::getChannelId, NumberUtil.parseLong(channelId));
|
||||||
queryWrapper.eq(BizInquiryRequest::getQuoteDate, date);
|
queryWrapper.eq(BizInquiryRequest::getQuoteDate, date);
|
||||||
|
// queryWrapper.ge(BizInquiryRequest::getDeadline, DateUtil.now());
|
||||||
|
|
||||||
List<BizInquiryRequestVo> bizInquiryRequestVos = baseMapper.selectVoList(queryWrapper);
|
List<BizInquiryRequestVo> bizInquiryRequestVos = baseMapper.selectVoList(queryWrapper);
|
||||||
return TableDataInfo.build(bizInquiryRequestVos);
|
return TableDataInfo.build(bizInquiryRequestVos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String generateInquiryNo() {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
|
|
||||||
String datePart = sdf.format(new Date());
|
|
||||||
int seq = sequence.incrementAndGet();
|
|
||||||
if (seq > 999999) { // 处理溢出,例如重置或抛出异常
|
|
||||||
sequence.set(0);
|
|
||||||
seq = 0;
|
|
||||||
}
|
|
||||||
return String.format("INQ%s%06d", datePart, seq);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.asinkj.amz.service.impl;
|
package org.asinkj.amz.service.impl;
|
||||||
|
|
||||||
|
import org.asinkj.amz.domain.BizLogisticsOrder;
|
||||||
import org.asinkj.common.core.utils.MapstructUtils;
|
import org.asinkj.common.core.utils.MapstructUtils;
|
||||||
import org.asinkj.common.core.utils.StringUtils;
|
import org.asinkj.common.core.utils.StringUtils;
|
||||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.asinkj.common.satoken.utils.LoginHelper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.asinkj.amz.domain.bo.BizLogisticsOrderDetailBo;
|
import org.asinkj.amz.domain.bo.BizLogisticsOrderDetailBo;
|
||||||
import org.asinkj.amz.domain.vo.BizLogisticsOrderDetailVo;
|
import org.asinkj.amz.domain.vo.BizLogisticsOrderDetailVo;
|
||||||
@ -93,6 +95,8 @@ public class BizLogisticsOrderDetailServiceImpl implements IBizLogisticsOrderDet
|
|||||||
lqw.eq(bo.getEstimatedDeliveryDate() != null, BizLogisticsOrderDetail::getEstimatedDeliveryDate, bo.getEstimatedDeliveryDate());
|
lqw.eq(bo.getEstimatedDeliveryDate() != null, BizLogisticsOrderDetail::getEstimatedDeliveryDate, bo.getEstimatedDeliveryDate());
|
||||||
lqw.eq(bo.getActualDeliveryDate() != null, BizLogisticsOrderDetail::getActualDeliveryDate, bo.getActualDeliveryDate());
|
lqw.eq(bo.getActualDeliveryDate() != null, BizLogisticsOrderDetail::getActualDeliveryDate, bo.getActualDeliveryDate());
|
||||||
lqw.eq(bo.getTimeliness() != null, BizLogisticsOrderDetail::getTimeliness, bo.getTimeliness());
|
lqw.eq(bo.getTimeliness() != null, BizLogisticsOrderDetail::getTimeliness, bo.getTimeliness());
|
||||||
|
lqw.and(wrapper -> wrapper.eq(BizLogisticsOrderDetail::getCreateBy, LoginHelper.getUserId()).or().eq(BizLogisticsOrderDetail::getLogisticsProviderId, LoginHelper.getUserId()));
|
||||||
|
lqw.orderByAsc(BizLogisticsOrderDetail::getFbaBoxNumber);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,4 +151,9 @@ public class BizLogisticsOrderDetailServiceImpl implements IBizLogisticsOrderDet
|
|||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateList(List<BizLogisticsOrderDetailBo> list) {
|
||||||
|
baseMapper.updateBatchById(MapstructUtils.convert(list, BizLogisticsOrderDetail.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.asinkj.common.satoken.utils.LoginHelper;
|
import org.asinkj.common.satoken.utils.LoginHelper;
|
||||||
|
import org.asinkj.system.api.RemoteUserService;
|
||||||
|
import org.asinkj.system.api.model.LoginUser;
|
||||||
|
import org.asinkj.system.api.model.RoleDTO;
|
||||||
import org.asinkj.utils.SerialNoGenerator;
|
import org.asinkj.utils.SerialNoGenerator;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.asinkj.amz.domain.bo.BizLogisticsOrderBo;
|
import org.asinkj.amz.domain.bo.BizLogisticsOrderBo;
|
||||||
@ -24,10 +27,8 @@ import org.asinkj.amz.domain.vo.BizLogisticsOrderVo;
|
|||||||
import org.asinkj.amz.mapper.BizLogisticsOrderMapper;
|
import org.asinkj.amz.mapper.BizLogisticsOrderMapper;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.stream.Collectors;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流订单Service业务层处理
|
* 物流订单Service业务层处理
|
||||||
@ -60,6 +61,9 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BizLogisticsOrderMapper bizOrderMapper;
|
private BizLogisticsOrderMapper bizOrderMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物流订单
|
* 查询物流订单
|
||||||
*
|
*
|
||||||
@ -110,6 +114,17 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
|||||||
lqw.eq(bo.getShipmentQuantity() != null, BizLogisticsOrder::getShipmentQuantity, bo.getShipmentQuantity());
|
lqw.eq(bo.getShipmentQuantity() != null, BizLogisticsOrder::getShipmentQuantity, bo.getShipmentQuantity());
|
||||||
lqw.eq(bo.getAmazonShelfDate() != null, BizLogisticsOrder::getAmazonShelfDate, bo.getAmazonShelfDate());
|
lqw.eq(bo.getAmazonShelfDate() != null, BizLogisticsOrder::getAmazonShelfDate, bo.getAmazonShelfDate());
|
||||||
lqw.eq(bo.getShelfTimeliness() != null, BizLogisticsOrder::getShelfTimeliness, bo.getShelfTimeliness());
|
lqw.eq(bo.getShelfTimeliness() != null, BizLogisticsOrder::getShelfTimeliness, bo.getShelfTimeliness());
|
||||||
|
lqw.and(wrapper -> wrapper.eq(BizLogisticsOrder::getCreateBy, LoginHelper.getUserId()).or().eq(BizLogisticsOrder::getLogisticsProviderId, LoginHelper.getUserId()));
|
||||||
|
// Set<Long> roleIdSet = LoginHelper.getLoginUser().getRoles().stream().map(RoleDTO::getRoleId).collect(Collectors.toSet());
|
||||||
|
// log.info("roleIdSet:{}", roleIdSet);
|
||||||
|
// if (roleIdSet.contains(3L)){
|
||||||
|
// // 物流
|
||||||
|
// lqw.eq(BizLogisticsOrder::getLogisticsProviderId, LoginHelper.getUserId());
|
||||||
|
//
|
||||||
|
// }else if (roleIdSet.contains(4L)){
|
||||||
|
// //运营
|
||||||
|
// lqw.eq( BizLogisticsOrder::getCreateBy, LoginHelper.getUserId());
|
||||||
|
// }
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +194,21 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
|||||||
throw new ServiceException("物流计划不存在");
|
throw new ServiceException("物流计划不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BizShipmentTracking> trackingList = bizShipmentTrackingService.queryByPlanId(planVo.getShipmentId());
|
if (planVo.getShipmentStatus().equals("CLOSED")) {
|
||||||
|
throw new ServiceException("物流计划已关闭");
|
||||||
|
}
|
||||||
|
if (planVo.getIsClosed().equals("Y")) {
|
||||||
|
throw new ServiceException("物流计划已关闭");
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<BizLogisticsOrder> bizLogisticsOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
bizLogisticsOrderLambdaQueryWrapper.eq(BizLogisticsOrder::getFbaShipmentId, fbaShipmentId);
|
||||||
|
Long l = bizOrderMapper.selectCount(bizLogisticsOrderLambdaQueryWrapper);
|
||||||
|
if (l > 0) {
|
||||||
|
throw new ServiceException("物流订单已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<BizShipmentTracking> trackingList = bizShipmentTrackingService.queryByPlanId(planVo.getShipmentId());
|
||||||
|
|
||||||
List<BizShipmentItem> itemList = bizShipmentItemService.queryByPlanId(planVo.getShipmentId());
|
List<BizShipmentItem> itemList = bizShipmentItemService.queryByPlanId(planVo.getShipmentId());
|
||||||
long sum = itemList.stream().mapToLong(BizShipmentItem::getQuantityShipped).sum();
|
long sum = itemList.stream().mapToLong(BizShipmentItem::getQuantityShipped).sum();
|
||||||
@ -192,8 +221,9 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
|||||||
bizLogisticsOrder.setOrderId(SerialNoGenerator.generateOrderNo());
|
bizLogisticsOrder.setOrderId(SerialNoGenerator.generateOrderNo());
|
||||||
|
|
||||||
bizLogisticsOrder.setLogisticsProviderId(quoteVo.getUserId());
|
bizLogisticsOrder.setLogisticsProviderId(quoteVo.getUserId());
|
||||||
|
String nickName = remoteUserService.selectNicknameById(quoteVo.getUserId());
|
||||||
|
bizLogisticsOrder.setLogisticsProviderName(nickName);
|
||||||
|
|
||||||
// todo bizLogisticsOrderBo.setLogisticsProviderName(quoteVo.getUserName());
|
|
||||||
bizLogisticsOrder.setChannelName(quoteVo.getChannelName());
|
bizLogisticsOrder.setChannelName(quoteVo.getChannelName());
|
||||||
// 目的地
|
// 目的地
|
||||||
bizLogisticsOrder.setDestination(quoteVo.getDestination());
|
bizLogisticsOrder.setDestination(quoteVo.getDestination());
|
||||||
@ -212,7 +242,7 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
|||||||
detail.setOrderId(bizLogisticsOrder.getOrderId());
|
detail.setOrderId(bizLogisticsOrder.getOrderId());
|
||||||
detail.setFbaBoxNumber(bizShipmentTracking.getBoxId());
|
detail.setFbaBoxNumber(bizShipmentTracking.getBoxId());
|
||||||
detail.setLogisticsProviderId(quoteVo.getUserId());
|
detail.setLogisticsProviderId(quoteVo.getUserId());
|
||||||
// todo detail.setLogisticsProviderName(quoteVo.getUserName());
|
detail.setLogisticsProviderName(nickName);
|
||||||
detail.setChannelName(quoteVo.getChannelName());
|
detail.setChannelName(quoteVo.getChannelName());
|
||||||
detail.setDestination(quoteVo.getDestination());
|
detail.setDestination(quoteVo.getDestination());
|
||||||
detail.setPricePerKg(quoteVo.getPrice());
|
detail.setPricePerKg(quoteVo.getPrice());
|
||||||
|
@ -9,6 +9,7 @@ import org.asinkj.amz.domain.BizInquiryRequest;
|
|||||||
import org.asinkj.amz.domain.bo.BizLogisticsQuoteMostBo;
|
import org.asinkj.amz.domain.bo.BizLogisticsQuoteMostBo;
|
||||||
import org.asinkj.amz.domain.vo.InquiryQuoteStatusDTO;
|
import org.asinkj.amz.domain.vo.InquiryQuoteStatusDTO;
|
||||||
import org.asinkj.amz.mapper.BizInquiryRequestMapper;
|
import org.asinkj.amz.mapper.BizInquiryRequestMapper;
|
||||||
|
import org.asinkj.amz.mapper.BizLogisticsChannelMapper;
|
||||||
import org.asinkj.amz.service.IBizLogisticsChannelService;
|
import org.asinkj.amz.service.IBizLogisticsChannelService;
|
||||||
import org.asinkj.common.core.exception.ServiceException;
|
import org.asinkj.common.core.exception.ServiceException;
|
||||||
import org.asinkj.common.core.utils.MapstructUtils;
|
import org.asinkj.common.core.utils.MapstructUtils;
|
||||||
@ -55,6 +56,10 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BizInquiryRequestMapper bizInquiryRequestMapper;
|
private BizInquiryRequestMapper bizInquiryRequestMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizLogisticsChannelMapper bizLogisticsChannelMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteUserService remoteUserService ;
|
private RemoteUserService remoteUserService ;
|
||||||
|
|
||||||
@ -69,6 +74,20 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
return baseMapper.selectVoById(id);
|
return baseMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> generateReport() {
|
||||||
|
// 1. 获取所有渠道名称
|
||||||
|
List<String> channels = bizLogisticsChannelMapper.listAllChannels();
|
||||||
|
|
||||||
|
// 2. 调用动态报表查询
|
||||||
|
return baseMapper.selectDynamicReport(channels);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询物流报价列表
|
* 分页查询物流报价列表
|
||||||
*
|
*
|
||||||
@ -210,6 +229,7 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
BizLogisticsQuote bizLogisticsQuote = new BizLogisticsQuote();
|
BizLogisticsQuote bizLogisticsQuote = new BizLogisticsQuote();
|
||||||
bizLogisticsQuote.setDestination(bo.getDestination());
|
bizLogisticsQuote.setDestination(bo.getDestination());
|
||||||
bizLogisticsQuote.setUserId(LoginHelper.getUserId());
|
bizLogisticsQuote.setUserId(LoginHelper.getUserId());
|
||||||
|
bizLogisticsQuote.setLogisticsName(LoginHelper.getLoginUser().getNickname());
|
||||||
bizLogisticsQuote.setChannelName(bo.getChannelName());
|
bizLogisticsQuote.setChannelName(bo.getChannelName());
|
||||||
bizLogisticsQuote.setPrice(bo.getPrice());
|
bizLogisticsQuote.setPrice(bo.getPrice());
|
||||||
bizLogisticsQuote.setLeadTime(bo.getLeadTime());
|
bizLogisticsQuote.setLeadTime(bo.getLeadTime());
|
||||||
|
@ -33,7 +33,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.asinkj.common.redis.utils.RedisUtils;
|
import org.asinkj.common.redis.utils.RedisUtils;
|
||||||
import org.asinkj.common.satoken.utils.LoginHelper;
|
import org.asinkj.common.satoken.utils.LoginHelper;
|
||||||
import org.asinkj.resource.api.RemoteMessageService;
|
import org.asinkj.resource.api.RemoteMessageService;
|
||||||
import org.asinkj.system.api.model.LoginUser;
|
|
||||||
import org.asinkj.utils.HttpUtil;
|
import org.asinkj.utils.HttpUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@ -427,4 +426,87 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void testAmazonData() throws Exception {
|
||||||
|
Map<String, Object> queryParam = new HashMap<>();
|
||||||
|
queryParam.put("sid", 143);
|
||||||
|
queryParam.put("event_date", "2025-03-27");
|
||||||
|
queryParam.put("type",2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// HttpUtil.postWithUrlParams("/erp/sc/data/sales_report/asinList", queryParam, new Callback() {
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
||||||
|
//
|
||||||
|
// log.info("onFailure");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
|
||||||
|
//
|
||||||
|
// System.out.println(response.body().string());
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HttpUtil.postWithParams("/erp/sc/data/sales_report/asinDailyLists", queryParam, new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
|
||||||
|
System.out.println(response.body().string());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void testAmazonData2() throws Exception {
|
||||||
|
Map<String, Object> queryParam = new HashMap<>();
|
||||||
|
queryParam.put("sid", 143);
|
||||||
|
queryParam.put("start_date", "2025-03-26");
|
||||||
|
queryParam.put("end_date", "2025-03-27");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// HttpUtil.postWithUrlParams("/erp/sc/data/sales_report/asinList", queryParam, new Callback() {
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
||||||
|
//
|
||||||
|
// log.info("onFailure");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
|
||||||
|
//
|
||||||
|
// System.out.println(response.body().string());
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HttpUtil.postWithParams("/erp/sc/data/sales_report/asinList", queryParam, new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
|
||||||
|
System.out.println(response.body().string());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.asinkj.utils;
|
package org.asinkj.utils;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
@ -75,6 +76,38 @@ public class HttpUtil {
|
|||||||
buildAndSendRequest(url, queryParams, "POST", RequestBody.create(new byte[0], null), callback);
|
buildAndSendRequest(url, queryParams, "POST", RequestBody.create(new byte[0], null), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void postWithParams(String url, Map<String, Object> queryParams, Callback callback) {
|
||||||
|
|
||||||
|
|
||||||
|
checkInitialized();
|
||||||
|
Map<String, Object> signParams = new HashMap<>();
|
||||||
|
Map<String, String> baseParams = new HashMap<>();
|
||||||
|
|
||||||
|
// 动态获取最新access_token
|
||||||
|
baseParams.put("app_key", appId);
|
||||||
|
baseParams.put("access_token", RedisUtils.getCacheObject(ACCESS_TOKEN));
|
||||||
|
long l = System.currentTimeMillis() / 1000;
|
||||||
|
baseParams.put("timestamp", String.valueOf(l));
|
||||||
|
|
||||||
|
signParams.putAll(baseParams);
|
||||||
|
signParams.putAll(queryParams);
|
||||||
|
|
||||||
|
String sign = ApiSign.sign(signParams, appId);
|
||||||
|
baseParams.put("sign", sign);
|
||||||
|
|
||||||
|
|
||||||
|
// Map<String, String> queryParams = convertToStringMap(allParams);
|
||||||
|
String json = JSON.toJSONString(queryParams);
|
||||||
|
|
||||||
|
// 3. 创建 RequestBody(指定 MediaType 为 JSON)
|
||||||
|
RequestBody requestBody = RequestBody.create(
|
||||||
|
json,
|
||||||
|
MediaType.parse("application/json; charset=utf-8")
|
||||||
|
);
|
||||||
|
|
||||||
|
buildAndSendRequest(url, baseParams, "POST", requestBody, callback);
|
||||||
|
}
|
||||||
|
|
||||||
// POST JSON
|
// POST JSON
|
||||||
public static void postJson(String url, String jsonBody, Callback callback) {
|
public static void postJson(String url, String jsonBody, Callback callback) {
|
||||||
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json"));
|
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json"));
|
||||||
@ -89,7 +122,25 @@ public class HttpUtil {
|
|||||||
// 动态获取最新access_token
|
// 动态获取最新access_token
|
||||||
allParams.put("app_key", appId);
|
allParams.put("app_key", appId);
|
||||||
allParams.put("access_token", RedisUtils.getCacheObject(ACCESS_TOKEN));
|
allParams.put("access_token", RedisUtils.getCacheObject(ACCESS_TOKEN));
|
||||||
allParams.put("timestamp", System.currentTimeMillis() / 1000);
|
long l = System.currentTimeMillis() / 1000;
|
||||||
|
allParams.put("timestamp", String.valueOf(l));
|
||||||
|
|
||||||
|
String sign = ApiSign.sign(allParams, appId);
|
||||||
|
allParams.put("sign", sign);
|
||||||
|
return allParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static Map<String, Object> mergeSighParams(Map<String, Object> customParams) {
|
||||||
|
checkInitialized();
|
||||||
|
Map<String, Object> allParams = new HashMap<>();
|
||||||
|
if (customParams != null) allParams.putAll(customParams);
|
||||||
|
|
||||||
|
// 动态获取最新access_token
|
||||||
|
allParams.put("app_key", appId);
|
||||||
|
allParams.put("access_token", RedisUtils.getCacheObject(ACCESS_TOKEN));
|
||||||
|
long l = System.currentTimeMillis() / 1000;
|
||||||
|
allParams.put("timestamp", String.valueOf(l));
|
||||||
|
|
||||||
String sign = ApiSign.sign(allParams, appId);
|
String sign = ApiSign.sign(allParams, appId);
|
||||||
allParams.put("sign", sign);
|
allParams.put("sign", sign);
|
||||||
|
@ -4,4 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.asinkj.amz.mapper.BizLogisticsChannelMapper">
|
<mapper namespace="org.asinkj.amz.mapper.BizLogisticsChannelMapper">
|
||||||
|
|
||||||
|
<select id="listAllChannels" resultType="java.lang.String">
|
||||||
|
SELECT DISTINCT channel_name FROM biz_logistics_channel
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -15,4 +15,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectDynamicReport" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
logistics_name AS "供应商名称",
|
||||||
|
<foreach collection="channels" item="channel" separator=",">
|
||||||
|
MAX(CASE WHEN channel_name = #{channel} THEN price END) AS "${channel}"
|
||||||
|
</foreach>
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
logistics_name,
|
||||||
|
channel_name,
|
||||||
|
price,
|
||||||
|
ROW_NUMBER() OVER (
|
||||||
|
PARTITION BY logistics_name, channel_name
|
||||||
|
ORDER BY quote_date DESC
|
||||||
|
) AS rn
|
||||||
|
FROM biz_logistics_quote
|
||||||
|
WHERE del_flag = '0'
|
||||||
|
) AS latest_quotes
|
||||||
|
WHERE rn = 1
|
||||||
|
GROUP BY logistics_name
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
7
asinkj-biz/asinkj-amz/src/test/java/testAmzData.java
Normal file
7
asinkj-biz/asinkj-amz/src/test/java/testAmzData.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import org.asinkj.utils.HttpUtil;
|
||||||
|
|
||||||
|
public class testAmzData {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
HttpUtil.getAmzStoreTokenData();
|
||||||
|
}
|
||||||
|
}
|
@ -75,6 +75,11 @@
|
|||||||
<artifactId>asinkj-api-system</artifactId>
|
<artifactId>asinkj-api-system</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.asinkj</groupId>
|
||||||
|
<artifactId>asinkj-api-amz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
package org.asinkj.job.snailjob;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
|
||||||
|
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||||
|
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||||
|
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||||
|
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
import org.asinkj.amz.api.RemoteFBADataService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author opensnail
|
||||||
|
* @date 2024-05-17
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@JobExecutor(name = "amzPullFBAJobExecutor")
|
||||||
|
@Slf4j
|
||||||
|
public class AmzPullFBAJobExecutor {
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private RemoteFBADataService remoteFBADataService;
|
||||||
|
|
||||||
|
public ExecuteResult jobExecute(JobArgs jobArgs) throws Exception {
|
||||||
|
SnailJobLog.LOCAL.info("amzPullFBAJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
||||||
|
SnailJobLog.REMOTE.info("amzPullFBAJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
||||||
|
log.info("amzPullFBAJobExecutor {}", jobArgs.getJobParams());
|
||||||
|
//昨天的日期yyyy-MM-dd
|
||||||
|
// 获取昨天的日期
|
||||||
|
if ("yesterday".equals(jobArgs.getJobParams())) {
|
||||||
|
DateTime yesterday = DateUtil.yesterday();
|
||||||
|
String yesterdayString = yesterday.toString("yyyy-MM-dd");
|
||||||
|
SnailJobLog.LOCAL.info("yesterdayString. yesterdayString:{}", yesterdayString);
|
||||||
|
//获取今天的日期
|
||||||
|
DateTime today = DateUtil.date();
|
||||||
|
String todayString = today.toString("yyyy-MM-dd");
|
||||||
|
SnailJobLog.LOCAL.info("todayString. todayString:{}", todayString);
|
||||||
|
remoteFBADataService.pullAmzFbaDataToken(yesterdayString, todayString);
|
||||||
|
return ExecuteResult.success("获取从昨天开始的FBA货件数据");
|
||||||
|
} else if ("today".equals(jobArgs.getJobParams())) {
|
||||||
|
DateTime today = DateUtil.date();
|
||||||
|
String todayString = today.toString("yyyy-MM-dd");
|
||||||
|
SnailJobLog.LOCAL.info("todayString. todayString:{}", todayString);
|
||||||
|
remoteFBADataService.pullAmzFbaDataToken(todayString, todayString);
|
||||||
|
return ExecuteResult.success("获取今天的FBA货件数据");
|
||||||
|
}
|
||||||
|
return ExecuteResult.success("请指定参数yesterday或者today");
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user