5.9新需求修改
This commit is contained in:
parent
569fbf1bd4
commit
1c04030a08
@ -70,4 +70,7 @@ public class RemoteUserVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckRole;
|
import cn.dev33.satoken.annotation.SaCheckRole;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
@ -167,7 +168,7 @@ public class BizLogisticsQuoteController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SaCheckRole("yunying")
|
@SaCheckRole(value = {"superadmin", "yunying"}, mode = SaMode.OR)
|
||||||
@PostMapping("/report")
|
@PostMapping("/report")
|
||||||
public R<List<Map<String, Object>>> getInfo(@Valid @RequestBody BizLogisticsQuoteReportBo bo) {
|
public R<List<Map<String, Object>>> getInfo(@Valid @RequestBody BizLogisticsQuoteReportBo bo) {
|
||||||
List<Map<String, Object>> maps = bizLogisticsQuoteService.generateReport(bo);
|
List<Map<String, Object>> maps = bizLogisticsQuoteService.generateReport(bo);
|
||||||
|
|||||||
@ -48,8 +48,8 @@ public class BizPurchaseOrderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询采购单主列表
|
* 查询采购单主列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("amz:purchaseOrder:list")
|
// @SaCheckPermission("amz:purchaseOrder:list")
|
||||||
@SaCheckRole(value = {"gongying","gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gongying","gengdan", "superadmin","yunying"}, mode = SaMode.OR)
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<BizPurchaseOrderVo> list(BizPurchaseOrderBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BizPurchaseOrderVo> list(BizPurchaseOrderBo bo, PageQuery pageQuery) {
|
||||||
return bizPurchaseOrderService.queryPageList(bo, pageQuery);
|
return bizPurchaseOrderService.queryPageList(bo, pageQuery);
|
||||||
@ -69,13 +69,13 @@ public class BizPurchaseOrderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 获取采购单主详细信息
|
* 获取采购单主详细信息
|
||||||
*
|
*
|
||||||
* @param orderSn 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("amz:purchaseOrder:query")
|
@SaCheckPermission("amz:purchaseOrder:query")
|
||||||
@GetMapping("/{orderSn}")
|
@GetMapping("/{id}")
|
||||||
public R<BizPurchaseOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<BizPurchaseOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable String orderSn) {
|
@PathVariable Long id) {
|
||||||
return R.ok(bizPurchaseOrderService.queryById(orderSn));
|
return R.ok(bizPurchaseOrderService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,6 +100,14 @@ public class BizPurchaseOrderController extends BaseController {
|
|||||||
return toAjax(bizPurchaseOrderService.updateByBo(bo));
|
return toAjax(bizPurchaseOrderService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SaCheckPermission("amz:purchaseOrder:edit")
|
||||||
|
@Log(title = "采购单主", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
public R<Void> confirm(@Validated(EditGroup.class) @RequestBody BizPurchaseOrderBo bo) {
|
||||||
|
return toAjax(bizPurchaseOrderService.confirmByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除采购单主
|
* 删除采购单主
|
||||||
*
|
*
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public class BizSendOrderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询供应商创建的发货单列表
|
* 查询供应商创建的发货单列表
|
||||||
*/
|
*/
|
||||||
@SaCheckRole(value = {"gongying","gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<BizSendOrderVo> list(BizSendOrderBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BizSendOrderVo> list(BizSendOrderBo bo, PageQuery pageQuery) {
|
||||||
return bizSendOrderService.queryPageList(bo, pageQuery);
|
return bizSendOrderService.queryPageList(bo, pageQuery);
|
||||||
@ -51,7 +51,7 @@ public class BizSendOrderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 导出供应商创建的发货单列表
|
* 导出供应商创建的发货单列表
|
||||||
*/
|
*/
|
||||||
@SaCheckRole(value = {"gongying","gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gongying", "gengdan", "superadmin"}, mode = SaMode.OR)
|
||||||
@Log(title = "供应商创建的发货单", businessType = BusinessType.EXPORT)
|
@Log(title = "供应商创建的发货单", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(BizSendOrderBo bo, HttpServletResponse response) {
|
public void export(BizSendOrderBo bo, HttpServletResponse response) {
|
||||||
@ -64,7 +64,7 @@ public class BizSendOrderController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckRole(value = {"gongying","gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<BizSendOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<BizSendOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
@ -85,7 +85,7 @@ public class BizSendOrderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 修改供应商创建的发货单
|
* 修改供应商创建的发货单
|
||||||
*/
|
*/
|
||||||
@SaCheckRole(value = {"gongying","gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||||
@Log(title = "供应商创建的发货单", businessType = BusinessType.UPDATE)
|
@Log(title = "供应商创建的发货单", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
@ -94,13 +94,13 @@ public class BizSendOrderController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SaCheckRole(value = {"gongying","gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gongying", "gengdan", "superadmin"}, mode = SaMode.OR)
|
||||||
@Log(title = "供应商创建的发货单", businessType = BusinessType.UPDATE)
|
@Log(title = "供应商创建的发货单", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping("/link")
|
@PutMapping("/link")
|
||||||
public R<Void> link(@Validated(EditGroup.class) @RequestBody BizSendOrderBo bo) {
|
public R<Void> link(@Validated(EditGroup.class) @RequestBody BizSendOrderBo bo) {
|
||||||
bizSendOrderService.linkByBo(bo);
|
bizSendOrderService.linkByBo(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -86,7 +86,7 @@ public class BizShipForwardController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 修改货件转发
|
* 修改货件转发
|
||||||
*/
|
*/
|
||||||
@SaCheckRole(value = {"gengdan", "superadmin"}, mode = SaMode.OR)
|
@SaCheckRole(value = {"gengdan", "gongying", "superadmin"}, mode = SaMode.OR)
|
||||||
@Log(title = "货件转发", businessType = BusinessType.UPDATE)
|
@Log(title = "货件转发", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
|
|||||||
@ -0,0 +1,106 @@
|
|||||||
|
package org.asinkj.amz.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.asinkj.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.asinkj.common.log.annotation.Log;
|
||||||
|
import org.asinkj.common.web.core.BaseController;
|
||||||
|
import org.asinkj.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.asinkj.common.core.domain.R;
|
||||||
|
import org.asinkj.common.core.validate.AddGroup;
|
||||||
|
import org.asinkj.common.core.validate.EditGroup;
|
||||||
|
import org.asinkj.common.log.enums.BusinessType;
|
||||||
|
import org.asinkj.common.excel.utils.ExcelUtil;
|
||||||
|
import org.asinkj.amz.domain.vo.SysStatusHistoryVo;
|
||||||
|
import org.asinkj.amz.domain.bo.SysStatusHistoryBo;
|
||||||
|
import org.asinkj.amz.service.ISysStatusHistoryService;
|
||||||
|
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史
|
||||||
|
* 前端访问路由地址为:/amz/statusHistory
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/statusHistory")
|
||||||
|
public class SysStatusHistoryController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysStatusHistoryService sysStatusHistoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态历史列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:statusHistory:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysStatusHistoryVo> list(SysStatusHistoryBo bo, PageQuery pageQuery) {
|
||||||
|
return sysStatusHistoryService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出状态历史列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:statusHistory:export")
|
||||||
|
@Log(title = "状态历史", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SysStatusHistoryBo bo, HttpServletResponse response) {
|
||||||
|
List<SysStatusHistoryVo> list = sysStatusHistoryService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "状态历史", SysStatusHistoryVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态历史详细信息
|
||||||
|
*
|
||||||
|
* @param historyId 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:statusHistory:query")
|
||||||
|
@GetMapping("/{historyId}")
|
||||||
|
public R<SysStatusHistoryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long historyId) {
|
||||||
|
return R.ok(sysStatusHistoryService.queryById(historyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增状态历史
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:statusHistory:add")
|
||||||
|
@Log(title = "状态历史", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysStatusHistoryBo bo) {
|
||||||
|
return toAjax(sysStatusHistoryService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态历史
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:statusHistory:edit")
|
||||||
|
@Log(title = "状态历史", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysStatusHistoryBo bo) {
|
||||||
|
return toAjax(sysStatusHistoryService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除状态历史
|
||||||
|
*
|
||||||
|
* @param historyIds 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("amz:statusHistory:remove")
|
||||||
|
@Log(title = "状态历史", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{historyIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] historyIds) {
|
||||||
|
return toAjax(sysStatusHistoryService.deleteWithValidByIds(List.of(historyIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -99,6 +99,8 @@ public class BizInquiryRequest extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Date effectiveEndTime;
|
private Date effectiveEndTime;
|
||||||
|
|
||||||
|
private String customsFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报价目标日期
|
* 报价目标日期
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,10 +4,13 @@ import org.asinkj.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流订单对象 biz_logistics_order
|
* 物流订单对象 biz_logistics_order
|
||||||
@ -93,6 +96,9 @@ public class BizLogisticsOrder extends TenantEntity {
|
|||||||
private String podUrl;
|
private String podUrl;
|
||||||
|
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<BizLogisticsOrderDetail> details;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,9 @@ public class BizLogisticsQuote extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long leadTime;
|
private Long leadTime;
|
||||||
|
|
||||||
|
private Long minLeadTime;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附加费
|
* 附加费
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -5,7 +5,9 @@ import org.asinkj.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -27,7 +29,11 @@ public class BizPurchaseOrder extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 采购单号
|
* 采购单号
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableId
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -285,8 +291,14 @@ public class BizPurchaseOrder extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long dlvTimeVar;
|
private Long dlvTimeVar;
|
||||||
|
|
||||||
|
@AutoMapping(dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date divTime;
|
||||||
|
|
||||||
|
|
||||||
private String storeName;
|
private String storeName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,10 +5,13 @@ import org.asinkj.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商订单产品明细对象 biz_purchase_order_item
|
* 供应商订单产品明细对象 biz_purchase_order_item
|
||||||
@ -27,6 +30,7 @@ public class BizPurchaseOrderItem extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 采购单子项ID
|
* 采购单子项ID
|
||||||
*/
|
*/
|
||||||
|
@TableId
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -176,5 +180,17 @@ public class BizPurchaseOrderItem extends TenantEntity {
|
|||||||
@TableLogic
|
@TableLogic
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
|
private Long sfgAvlQty;
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<SysStatusHistory> sysStatusHistories;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String hasForward = "N";
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String hasSendOrder = "N";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,9 @@ import org.asinkj.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -39,6 +41,10 @@ public class BizSendOrder extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
|
|
||||||
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货日期
|
* 发货日期
|
||||||
*/
|
*/
|
||||||
@ -89,5 +95,17 @@ public class BizSendOrder extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private String sendStatus;
|
private String sendStatus;
|
||||||
|
|
||||||
|
private Long sendId;
|
||||||
|
|
||||||
|
private String sendName;
|
||||||
|
|
||||||
|
|
||||||
|
private String sendDetail;
|
||||||
|
|
||||||
|
private String logisticsProviderName;
|
||||||
|
|
||||||
|
private Long logisticsProviderId;
|
||||||
|
private String shipmentId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,9 @@ import org.asinkj.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -114,5 +116,21 @@ public class BizShipForward extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计到达时间
|
||||||
|
*/
|
||||||
|
private Date expDeliveryDate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际到达日期
|
||||||
|
*/
|
||||||
|
private Date deliveryDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱数
|
||||||
|
*/
|
||||||
|
private Long boxNum;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
package org.asinkj.amz.domain;
|
||||||
|
|
||||||
|
import org.asinkj.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史对象 sys_status_history
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sys_status_history")
|
||||||
|
public class SysStatusHistory extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private Long historyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private Long recordId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private String statusColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private String oldStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private String newStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常 1=删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private Date originalChangedAt;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -8,7 +8,9 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,12 +27,13 @@ public class BizLogisticsOrderBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 主键(应用层生成的全局唯一ID,如雪花算法)
|
* 主键(应用层生成的全局唯一ID,如雪花算法)
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FBA货件编号(亚马逊系统生成的唯一标识)
|
* FBA货件编号(亚马逊系统生成的唯一标识)
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "FBA货件编号(亚马逊系统生成的唯一标识)不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "FBA货件编号(亚马逊系统生成的唯一标识)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String fbaShipmentId;
|
private String fbaShipmentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,37 +44,37 @@ public class BizLogisticsOrderBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 物流商ID(关联物流商信息表)
|
* 物流商ID(关联物流商信息表)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "物流商ID(关联物流商信息表)不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "物流商ID(关联物流商信息表)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long logisticsProviderId;
|
private Long logisticsProviderId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流商名称(冗余存储,避免高频联表查询)
|
* 物流商名称(冗余存储,避免高频联表查询)
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "物流商名称(冗余存储,避免高频联表查询)不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "物流商名称(冗余存储,避免高频联表查询)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String logisticsProviderName;
|
private String logisticsProviderName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流渠道
|
* 物流渠道
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "物流渠道(如空运/海运/快递等)不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "物流渠道(如空运/海运/快递等)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String channelName;
|
private String channelName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 目的地仓库名称或编码
|
* 目的地仓库名称或编码
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "目的地仓库名称或编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "目的地仓库名称或编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String destination;
|
private String destination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总箱子数量(此订单包含的箱子总数)
|
* 总箱子数量(此订单包含的箱子总数)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "总箱子数量(此订单包含的箱子总数)不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "总箱子数量(此订单包含的箱子总数)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long boxQuantity;
|
private Long boxQuantity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总货件数量(商品件数总和)
|
* 总货件数量(商品件数总和)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "总货件数量(商品件数总和)不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "总货件数量(商品件数总和)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long shipmentQuantity;
|
private Long shipmentQuantity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,4 +91,7 @@ public class BizLogisticsOrderBo extends BaseEntity {
|
|||||||
private String podUrl;
|
private String podUrl;
|
||||||
|
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,96 @@
|
|||||||
|
package org.asinkj.amz.domain.bo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.asinkj.amz.domain.BizLogisticsOrder;
|
||||||
|
import org.asinkj.common.core.validate.AddGroup;
|
||||||
|
import org.asinkj.common.core.validate.EditGroup;
|
||||||
|
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流订单业务对象 biz_logistics_order
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-03-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = BizLogisticsOrder.class, reverseConvertGenerate = false)
|
||||||
|
public class BizLogisticsOrderStatusBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键(应用层生成的全局唯一ID,如雪花算法)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FBA货件编号(亚马逊系统生成的唯一标识)
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "FBA货件编号(亚马逊系统生成的唯一标识)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String fbaShipmentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号(应用层生成的唯一业务流水号)
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流商ID(关联物流商信息表)
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "物流商ID(关联物流商信息表)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long logisticsProviderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流商名称(冗余存储,避免高频联表查询)
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "物流商名称(冗余存储,避免高频联表查询)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String logisticsProviderName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流渠道
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "物流渠道(如空运/海运/快递等)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String channelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目的地仓库名称或编码
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "目的地仓库名称或编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String destination;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总箱子数量(此订单包含的箱子总数)
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "总箱子数量(此订单包含的箱子总数)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long boxQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总货件数量(商品件数总和)
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "总货件数量(商品件数总和)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long shipmentQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 亚马逊仓库实际上架日期
|
||||||
|
*/
|
||||||
|
private Date amazonShelfDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上架时效(单位:天,从发货到上架的总天数)
|
||||||
|
*/
|
||||||
|
private Long shelfTimeliness;
|
||||||
|
|
||||||
|
|
||||||
|
private String podUrl;
|
||||||
|
|
||||||
|
@NotNull(message = "状态不能为空")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -62,6 +62,9 @@ public class BizLogisticsQuoteBo extends BaseEntity {
|
|||||||
@NotNull(message = "时效(单位:天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "时效(单位:天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long leadTime;
|
private Long leadTime;
|
||||||
|
|
||||||
|
private Long minLeadTime;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附加费
|
* 附加费
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -64,6 +64,9 @@ public class BizLogisticsQuoteMostBo extends BaseEntity {
|
|||||||
@NotNull(message = "时效(单位:天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "时效(单位:天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long leadTime;
|
private Long leadTime;
|
||||||
|
|
||||||
|
@NotNull(message = "时效(单位:天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long minLeadTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附加费
|
* 附加费
|
||||||
*/
|
*/
|
||||||
@ -120,4 +123,6 @@ public class BizLogisticsQuoteMostBo extends BaseEntity {
|
|||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
|
|
||||||
|
private String backLogisticsType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.asinkj.amz.domain.bo;
|
package org.asinkj.amz.domain.bo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapping;
|
||||||
import org.asinkj.amz.domain.BizPurchaseOrder;
|
import org.asinkj.amz.domain.BizPurchaseOrder;
|
||||||
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.asinkj.common.core.validate.AddGroup;
|
import org.asinkj.common.core.validate.AddGroup;
|
||||||
@ -10,8 +11,10 @@ import lombok.EqualsAndHashCode;
|
|||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单主业务对象 biz_purchase_order
|
* 采购单主业务对象 biz_purchase_order
|
||||||
@ -24,10 +27,12 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
@AutoMapper(target = BizPurchaseOrder.class, reverseConvertGenerate = false)
|
@AutoMapper(target = BizPurchaseOrder.class, reverseConvertGenerate = false)
|
||||||
public class BizPurchaseOrderBo extends BaseEntity {
|
public class BizPurchaseOrderBo extends BaseEntity {
|
||||||
|
|
||||||
|
@NotNull(message = "采购单号ID不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单号
|
* 采购单号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "采购单号不能为空", groups = {AddGroup.class, EditGroup.class})
|
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -315,7 +320,8 @@ public class BizPurchaseOrderBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 交货时间
|
* 交货时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "交货时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date deliveryTime;
|
private Date deliveryTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -324,5 +330,15 @@ public class BizPurchaseOrderBo extends BaseEntity {
|
|||||||
// @NotNull(message = "订单交付变动天数不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "订单交付变动天数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long dlvTimeVar;
|
private Long dlvTimeVar;
|
||||||
|
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date divTime;
|
||||||
|
|
||||||
|
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,9 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,176 +27,180 @@ public class BizPurchaseOrderItemBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 采购单子项ID
|
* 采购单子项ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "采购单子项ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "采购单子项ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联采购单号
|
* 关联采购单号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "关联采购单号不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "关联采购单号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库ID
|
* 仓库ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "仓库ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long wid;
|
private Long wid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库名称
|
* 仓库名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "仓库名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "仓库名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String wareHouseName;
|
private String wareHouseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购计划号
|
* 采购计划号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "采购计划号不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "采购计划号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String planSn;
|
private String planSn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本地产品ID
|
* 本地产品ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "本地产品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "本地产品ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品名
|
* 品名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "品名不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "品名不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SKU
|
* SKU
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "SKU不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "SKU不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String sku;
|
private String sku;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FNSKU
|
* FNSKU
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "FNSKU不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "FNSKU不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String fnsku;
|
private String fnsku;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺ID
|
* 店铺ID
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "店铺ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "店铺ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String sid;
|
private String sid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 型号
|
* 型号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "型号不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "型号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String model;
|
private String model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 含税单价
|
* 含税单价
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "含税单价不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "含税单价不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long price;
|
private Long price;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 价税合计
|
* 价税合计
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "价税合计不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "价税合计不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long amount;
|
private Long amount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划采购量
|
* 计划采购量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "计划采购量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "计划采购量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityPlan;
|
private Long quantityPlan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实际采购量
|
* 实际采购量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "实际采购量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "实际采购量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityReal;
|
private Long quantityReal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 到货入库量
|
* 到货入库量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "到货入库量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "到货入库量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityEntry;
|
private Long quantityEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待到货量
|
* 待到货量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "待到货量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "待到货量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityReceive;
|
private Long quantityReceive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退货数
|
* 退货数
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "退货数不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "退货数不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityReturn;
|
private Long quantityReturn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 换货量
|
* 换货量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "换货量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "换货量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityExchange;
|
private Long quantityExchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质检量
|
* 质检量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "质检量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "质检量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityQc;
|
private Long quantityQc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待质检量
|
* 待质检量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "待质检量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "待质检量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityQcPrepare;
|
private Long quantityQcPrepare;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 期待到货时间
|
* 期待到货时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "期待到货时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "期待到货时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Date expectArriveTime;
|
private Date expectArriveTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "备注不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 箱数
|
* 箱数
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "箱数不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "箱数不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long casesNum;
|
private Long casesNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单箱数量
|
* 单箱数量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "单箱数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "单箱数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityPerCase;
|
private Long quantityPerCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除:0 否,1 是
|
* 是否删除:0 否,1 是
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "是否删除:0 否,1 是不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "是否删除:0 否,1 是不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long isDelete;
|
private Long isDelete;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 税率
|
* 税率
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "税率不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "税率不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String taxRate;
|
private String taxRate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SPU
|
* SPU
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "SPU不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "SPU不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String spu;
|
private String spu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 款名
|
* 款名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "款名不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "款名不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String spuName;
|
private String spuName;
|
||||||
|
|
||||||
|
|
||||||
|
private Long sfgAvlQty;
|
||||||
|
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,10 +35,14 @@ public class BizSendOrderBo extends BaseEntity {
|
|||||||
@NotBlank(message = "采购单号不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotBlank(message = "采购单号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
|
|
||||||
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货日期
|
* 发货日期
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "发货日期不能为空", groups = {AddGroup.class, EditGroup.class})
|
// @NotNull(message = "发货日期不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Date sendDate;
|
private Date sendDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,13 +60,13 @@ public class BizSendOrderBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 发货数量
|
* 发货数量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "发货数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
// @NotNull(message = "发货数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantitySend;
|
private Long quantitySend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单箱产品数量
|
* 单箱产品数量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "单箱产品数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
// @NotNull(message = "单箱产品数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantityPerBox;
|
private Long quantityPerBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,4 +100,18 @@ public class BizSendOrderBo extends BaseEntity {
|
|||||||
private String sendStatus;
|
private String sendStatus;
|
||||||
|
|
||||||
|
|
||||||
|
private String sendDetail;
|
||||||
|
|
||||||
|
|
||||||
|
private Long sendId;
|
||||||
|
|
||||||
|
private String sendName;
|
||||||
|
|
||||||
|
private String logisticsProviderName;
|
||||||
|
|
||||||
|
private Long logisticsProviderId;
|
||||||
|
|
||||||
|
private String shipmentId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,9 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
@ -32,13 +34,13 @@ public class BizShipForwardBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 采购单号
|
* 采购单号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "采购单号不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "采购单号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购店铺名称
|
* 采购店铺名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "采购店铺名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "采购店铺名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String storeName;
|
private String storeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,37 +58,37 @@ public class BizShipForwardBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 实际发货数量
|
* 实际发货数量
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "实际发货数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "实际发货数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long quantitySend;
|
private Long quantitySend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货供应商名称
|
* 发货供应商名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "发货供应商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "发货供应商名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String outSupplierName;
|
private String outSupplierName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货供应商系统ID
|
* 发货供应商系统ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "发货供应商系统ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "发货供应商系统ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long outSupplierId;
|
private Long outSupplierId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收货供应商名称
|
* 收货供应商名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "收货供应商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "收货供应商名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String inSupplierName;
|
private String inSupplierName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收货供应商系统ID
|
* 收货供应商系统ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "收货供应商系统ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "收货供应商系统ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long inSupplierId;
|
private Long inSupplierId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划发货起始时间
|
* 计划发货起始时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "计划发货起始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "计划发货起始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date shipmentStart;
|
private Date shipmentStart;
|
||||||
@ -94,7 +96,7 @@ public class BizShipForwardBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 计划发货截止时间
|
* 计划发货截止时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "计划发货截止时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "计划发货截止时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date shipmentEnd;
|
private Date shipmentEnd;
|
||||||
@ -121,13 +123,15 @@ public class BizShipForwardBo extends BaseEntity {
|
|||||||
* 发货时间
|
* 发货时间
|
||||||
*/
|
*/
|
||||||
// @NotNull(message = "发货时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "发货时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date sendTime;
|
private Date sendTime;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单子项ID
|
* 采购单子项ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "采购单子项ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "采购单子项ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
|
||||||
@ -135,4 +139,15 @@ public class BizShipForwardBo extends BaseEntity {
|
|||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计到达时间
|
||||||
|
*/
|
||||||
|
private Date expDeliveryDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱数
|
||||||
|
*/
|
||||||
|
private Long boxNum;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,9 @@ import lombok.EqualsAndHashCode;
|
|||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
@ -199,4 +201,6 @@ public class BizShipmentPlanBo extends BaseEntity {
|
|||||||
|
|
||||||
private String sellerName;
|
private String sellerName;
|
||||||
|
|
||||||
|
private Collection<Long> sidList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
package org.asinkj.amz.domain.bo;
|
||||||
|
|
||||||
|
import org.asinkj.amz.domain.SysStatusHistory;
|
||||||
|
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.asinkj.common.core.validate.AddGroup;
|
||||||
|
import org.asinkj.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史业务对象 sys_status_history
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = SysStatusHistory.class, reverseConvertGenerate = false)
|
||||||
|
public class SysStatusHistoryBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotNull(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long historyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotNull(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long recordId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String statusColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String oldStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String newStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@NotNull(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date originalChangedAt;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -110,5 +110,8 @@ public class BizLogisticsOrderVo implements Serializable {
|
|||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,6 +74,9 @@ public class BizLogisticsQuoteVo implements Serializable {
|
|||||||
@ExcelDictFormat(readConverterExp = "单=位:天")
|
@ExcelDictFormat(readConverterExp = "单=位:天")
|
||||||
private Long leadTime;
|
private Long leadTime;
|
||||||
|
|
||||||
|
private Long minLeadTime;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附加费
|
* 附加费
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -205,4 +205,11 @@ public class BizPurchaseOrderItemVo implements Serializable {
|
|||||||
private String spuName;
|
private String spuName;
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty(value = "半成品可发货数量")
|
||||||
|
private Long sfgAvlQty;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "订单状态", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "vendor_order_status")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.asinkj.amz.domain.vo;
|
package org.asinkj.amz.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
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.BizPurchaseOrder;
|
import org.asinkj.amz.domain.BizPurchaseOrder;
|
||||||
@ -7,10 +8,12 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import org.asinkj.amz.domain.BizPurchaseOrderItem;
|
import org.asinkj.amz.domain.BizPurchaseOrderItem;
|
||||||
import org.asinkj.amz.domain.BizShipForward;
|
import org.asinkj.amz.domain.BizShipForward;
|
||||||
|
import org.asinkj.amz.domain.SysStatusHistory;
|
||||||
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
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;
|
||||||
@ -35,6 +38,8 @@ public class BizPurchaseOrderVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 采购单号
|
* 采购单号
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
private Long id;
|
||||||
@ExcelProperty(value = "采购单号")
|
@ExcelProperty(value = "采购单号")
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
@ -337,6 +342,13 @@ public class BizPurchaseOrderVo implements Serializable {
|
|||||||
@ExcelProperty(value = "订单交付变动天数")
|
@ExcelProperty(value = "订单交付变动天数")
|
||||||
private Long dlvTimeVar;
|
private Long dlvTimeVar;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date divTime;
|
||||||
|
|
||||||
|
|
||||||
|
private BigDecimal remainingQuantity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -345,4 +357,6 @@ public class BizPurchaseOrderVo implements Serializable {
|
|||||||
private List<BizShipForward> forwardList;
|
private List<BizShipForward> forwardList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
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 org.asinkj.amz.domain.BizLogisticsOrder;
|
||||||
import org.asinkj.amz.domain.BizSendOrder;
|
import org.asinkj.amz.domain.BizSendOrder;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@ -12,8 +13,6 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,12 +41,18 @@ public class BizSendOrderVo implements Serializable {
|
|||||||
@ExcelProperty(value = "采购单号")
|
@ExcelProperty(value = "采购单号")
|
||||||
private String orderSn;
|
private String orderSn;
|
||||||
|
|
||||||
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货日期
|
* 发货日期
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "发货日期")
|
@ExcelProperty(value = "发货日期")
|
||||||
private Date sendDate;
|
private Date sendDate;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购店铺
|
* 采购店铺
|
||||||
*/
|
*/
|
||||||
@ -104,4 +109,22 @@ public class BizSendOrderVo implements Serializable {
|
|||||||
private String sendStatus;
|
private String sendStatus;
|
||||||
|
|
||||||
|
|
||||||
|
private String sendDetail;
|
||||||
|
|
||||||
|
private Long sendId;
|
||||||
|
|
||||||
|
private String sendName;
|
||||||
|
|
||||||
|
|
||||||
|
private String logisticsProviderName;
|
||||||
|
|
||||||
|
private Long logisticsProviderId;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String shipmentId;
|
||||||
|
|
||||||
|
private BizLogisticsOrder bizLogisticsOrder;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,4 +135,16 @@ public class BizShipForwardVo implements Serializable {
|
|||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计到达时间
|
||||||
|
*/
|
||||||
|
private Date expDeliveryDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱数
|
||||||
|
*/
|
||||||
|
private Long boxNum;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,9 @@ public class InquiryRequestItemVo implements Serializable {
|
|||||||
@ExcelProperty(value = "渠道ID")
|
@ExcelProperty(value = "渠道ID")
|
||||||
private Long channelId;
|
private Long channelId;
|
||||||
|
|
||||||
|
|
||||||
|
private String customsFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报价目标日期
|
* 报价目标日期
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,83 @@
|
|||||||
|
package org.asinkj.amz.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.asinkj.amz.domain.SysStatusHistory;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史视图对象 sys_status_history
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = SysStatusHistory.class)
|
||||||
|
public class SysStatusHistoryVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Long historyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Long recordId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private String statusColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private String oldStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private String newStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date originalChangedAt;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package org.asinkj.amz.mapper;
|
|||||||
import org.asinkj.amz.domain.BizLogisticsOrderQuotation;
|
import org.asinkj.amz.domain.BizLogisticsOrderQuotation;
|
||||||
import org.asinkj.amz.domain.vo.BizLogisticsOrderQuotationVo;
|
import org.asinkj.amz.domain.vo.BizLogisticsOrderQuotationVo;
|
||||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流订单确认Mapper接口
|
* 物流订单确认Mapper接口
|
||||||
@ -10,6 +11,7 @@ import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
* @author shuo hu
|
* @author shuo hu
|
||||||
* @date 2025-04-21
|
* @date 2025-04-21
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public interface BizLogisticsOrderQuotationMapper extends BaseMapperPlus<BizLogisticsOrderQuotation, BizLogisticsOrderQuotationVo> {
|
public interface BizLogisticsOrderQuotationMapper extends BaseMapperPlus<BizLogisticsOrderQuotation, BizLogisticsOrderQuotationVo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import org.asinkj.amz.domain.BizLogisticsQuote;
|
|||||||
import org.asinkj.amz.domain.vo.BizLogisticsQuoteVo;
|
import org.asinkj.amz.domain.vo.BizLogisticsQuoteVo;
|
||||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -18,6 +19,7 @@ import java.util.Map;
|
|||||||
* @author shuo hu
|
* @author shuo hu
|
||||||
* @date 2025-03-20
|
* @date 2025-03-20
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public interface BizLogisticsQuoteMapper extends BaseMapperPlus<BizLogisticsQuote, BizLogisticsQuoteVo> {
|
public interface BizLogisticsQuoteMapper extends BaseMapperPlus<BizLogisticsQuote, BizLogisticsQuoteVo> {
|
||||||
|
|
||||||
List<BizLogisticsQuote> selectQuotesByProvidersAndDate(
|
List<BizLogisticsQuote> selectQuotesByProvidersAndDate(
|
||||||
@ -29,10 +31,10 @@ public interface BizLogisticsQuoteMapper extends BaseMapperPlus<BizLogisticsQuot
|
|||||||
List<Map<String, Object>> selectDynamicReport(@Param("channels") List<String> channels);
|
List<Map<String, Object>> selectDynamicReport(@Param("channels") List<String> channels);
|
||||||
|
|
||||||
|
|
||||||
List<Map<String, Object>> getQuoteReport( @Param("columns") List<String> channels,
|
List<Map<String, Object>> getQuoteReport(@Param("columns") List<String> channels,
|
||||||
@Param("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
@Param("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
||||||
@Param("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate,
|
@Param("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate,
|
||||||
@Param("destination") @Size(max = 10) String destination);
|
@Param("destination") @Size(max = 10) String destination);
|
||||||
|
|
||||||
|
|
||||||
List<Map<String, Object>> getQuoteAvgDayReport(@Param("columns") List<String> channels);
|
List<Map<String, Object>> getQuoteAvgDayReport(@Param("columns") List<String> channels);
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package org.asinkj.amz.mapper;
|
|||||||
import org.asinkj.amz.domain.BizPurchaseOrder;
|
import org.asinkj.amz.domain.BizPurchaseOrder;
|
||||||
import org.asinkj.amz.domain.vo.BizPurchaseOrderVo;
|
import org.asinkj.amz.domain.vo.BizPurchaseOrderVo;
|
||||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单主Mapper接口
|
* 采购单主Mapper接口
|
||||||
@ -10,6 +11,7 @@ import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
* @author shuo hu
|
* @author shuo hu
|
||||||
* @date 2025-05-10
|
* @date 2025-05-10
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public interface BizPurchaseOrderMapper extends BaseMapperPlus<BizPurchaseOrder, BizPurchaseOrderVo> {
|
public interface BizPurchaseOrderMapper extends BaseMapperPlus<BizPurchaseOrder, BizPurchaseOrderVo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.asinkj.amz.mapper;
|
||||||
|
|
||||||
|
import org.asinkj.amz.domain.SysStatusHistory;
|
||||||
|
import org.asinkj.amz.domain.vo.SysStatusHistoryVo;
|
||||||
|
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史Mapper接口
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
public interface SysStatusHistoryMapper extends BaseMapperPlus<SysStatusHistory, SysStatusHistoryVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -20,10 +20,10 @@ public interface IBizPurchaseOrderService {
|
|||||||
/**
|
/**
|
||||||
* 查询采购单主
|
* 查询采购单主
|
||||||
*
|
*
|
||||||
* @param orderSn 主键
|
* @param id 主键
|
||||||
* @return 采购单主
|
* @return 采购单主
|
||||||
*/
|
*/
|
||||||
BizPurchaseOrderVo queryById(String orderSn);
|
BizPurchaseOrderVo queryById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询采购单主列表
|
* 分页查询采购单主列表
|
||||||
@ -66,4 +66,6 @@ public interface IBizPurchaseOrderService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||||
|
|
||||||
|
Boolean confirmByBo(BizPurchaseOrderBo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,5 +72,5 @@ public interface IBizSendOrderService {
|
|||||||
|
|
||||||
void linkByBo(BizSendOrderBo bo);
|
void linkByBo(BizSendOrderBo bo);
|
||||||
|
|
||||||
void updateStatus(Long sendOrderId, String completed);
|
void updateStatus(Long sendOrderId, String completed,String shipmentId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,69 @@
|
|||||||
|
package org.asinkj.amz.service;
|
||||||
|
|
||||||
|
import org.asinkj.amz.domain.SysStatusHistory;
|
||||||
|
import org.asinkj.amz.domain.vo.SysStatusHistoryVo;
|
||||||
|
import org.asinkj.amz.domain.bo.SysStatusHistoryBo;
|
||||||
|
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.asinkj.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史Service接口
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
public interface ISysStatusHistoryService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态历史
|
||||||
|
*
|
||||||
|
* @param historyId 主键
|
||||||
|
* @return 状态历史
|
||||||
|
*/
|
||||||
|
SysStatusHistoryVo queryById(Long historyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询状态历史列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 状态历史分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SysStatusHistoryVo> queryPageList(SysStatusHistoryBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的状态历史列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 状态历史列表
|
||||||
|
*/
|
||||||
|
List<SysStatusHistoryVo> queryList(SysStatusHistoryBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增状态历史
|
||||||
|
*
|
||||||
|
* @param bo 状态历史
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SysStatusHistoryBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态历史
|
||||||
|
*
|
||||||
|
* @param bo 状态历史
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SysStatusHistoryBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除状态历史信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -367,6 +367,7 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
|||||||
BizInquiryRequest bizInquiryRequest = new BizInquiryRequest();
|
BizInquiryRequest bizInquiryRequest = new BizInquiryRequest();
|
||||||
bizInquiryRequest.setDestination(request.getDestination());
|
bizInquiryRequest.setDestination(request.getDestination());
|
||||||
bizInquiryRequest.setChannelId(request.getChannelId());
|
bizInquiryRequest.setChannelId(request.getChannelId());
|
||||||
|
bizInquiryRequest.setCustomsFlag(request.getCustomsFlag());
|
||||||
bizInquiryRequest.setRequesterName(LoginHelper.getLoginUser().getNickname());
|
bizInquiryRequest.setRequesterName(LoginHelper.getLoginUser().getNickname());
|
||||||
bizInquiryRequest.setInquiryNo(SerialNoGenerator.generateInquiryNo());
|
bizInquiryRequest.setInquiryNo(SerialNoGenerator.generateInquiryNo());
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,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.asinkj.system.api.RemoteUserService;
|
import org.asinkj.system.api.RemoteUserService;
|
||||||
import org.asinkj.utils.SerialNoGenerator;
|
import org.asinkj.utils.SerialNoGenerator;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -27,10 +28,7 @@ import org.asinkj.amz.mapper.BizLogisticsOrderQuotationMapper;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物流订单确认Service业务层处理
|
* 物流订单确认Service业务层处理
|
||||||
@ -118,6 +116,10 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
|
|||||||
lqw.eq(bo.getBoxQuantity() != null, BizLogisticsOrderQuotation::getBoxQuantity, bo.getBoxQuantity());
|
lqw.eq(bo.getBoxQuantity() != null, BizLogisticsOrderQuotation::getBoxQuantity, bo.getBoxQuantity());
|
||||||
lqw.eq(bo.getShipmentQuantity() != null, BizLogisticsOrderQuotation::getShipmentQuantity, bo.getShipmentQuantity());
|
lqw.eq(bo.getShipmentQuantity() != null, BizLogisticsOrderQuotation::getShipmentQuantity, bo.getShipmentQuantity());
|
||||||
lqw.eq(bo.getQuoteOrderId() != null, BizLogisticsOrderQuotation::getQuoteOrderId, bo.getQuoteOrderId());
|
lqw.eq(bo.getQuoteOrderId() != null, BizLogisticsOrderQuotation::getQuoteOrderId, bo.getQuoteOrderId());
|
||||||
|
if (!LoginHelper.isSuperAdmin() && !LoginHelper.isManagerAdmin()) {
|
||||||
|
lqw.eq( BizLogisticsOrderQuotation::getLogisticsProviderId, LoginHelper.getUserId());
|
||||||
|
|
||||||
|
}
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,6 +242,8 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
|
|||||||
detail.setLogisticsProviderName(nickName);
|
detail.setLogisticsProviderName(nickName);
|
||||||
detail.setChannelName(quoteVo.getChannelName());
|
detail.setChannelName(quoteVo.getChannelName());
|
||||||
detail.setDestination(quoteVo.getDestination());
|
detail.setDestination(quoteVo.getDestination());
|
||||||
|
detail.setTimeliness(quoteVo.getLeadTime());
|
||||||
|
detail.setEstimatedDeliveryDate(DateUtil.offsetDay(new Date(), Math.toIntExact(quoteVo.getLeadTime())));
|
||||||
detail.setPricePerKg(quoteVo.getPrice());
|
detail.setPricePerKg(quoteVo.getPrice());
|
||||||
detail.setPlannedQuantity(bizShipmentTracking.getTotal());
|
detail.setPlannedQuantity(bizShipmentTracking.getTotal());
|
||||||
detail.setCarrierConfirmTime(DateUtil.date());
|
detail.setCarrierConfirmTime(DateUtil.date());
|
||||||
|
|||||||
@ -251,6 +251,8 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
bizLogisticsQuote.setLogisticsName(LoginHelper.getLoginUser().getNickname());
|
bizLogisticsQuote.setLogisticsName(LoginHelper.getLoginUser().getNickname());
|
||||||
bizLogisticsQuote.setChannelName(bo.getChannelName());
|
bizLogisticsQuote.setChannelName(bo.getChannelName());
|
||||||
bizLogisticsQuote.setPrice(bo.getPrice());
|
bizLogisticsQuote.setPrice(bo.getPrice());
|
||||||
|
bizLogisticsQuote.setMinLeadTime(bo.getMinLeadTime());
|
||||||
|
bizLogisticsQuote.setBackLogisticsType(bo.getBackLogisticsType());
|
||||||
bizLogisticsQuote.setLeadTime(bo.getLeadTime());
|
bizLogisticsQuote.setLeadTime(bo.getLeadTime());
|
||||||
bizLogisticsQuote.setSurcharge(bo.getSurcharge());
|
bizLogisticsQuote.setSurcharge(bo.getSurcharge());
|
||||||
bizLogisticsQuote.setQuoteDate(dateTime.toJdkDate());
|
bizLogisticsQuote.setQuoteDate(dateTime.toJdkDate());
|
||||||
@ -284,7 +286,7 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
||||||
.divide(new BigDecimal(bizLogisticsQuotes.size()), 2, RoundingMode.HALF_UP);
|
.divide(new BigDecimal(bizLogisticsQuotes.size()), 2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
if (average.compareTo(bo.getPrice()) > 0) {
|
if (average.compareTo(bo.getPrice()) < 0) {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
@ -294,6 +296,7 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
@Override
|
@Override
|
||||||
public List<InquiryQuoteStatusDTO> getTodayQuoteStatus() {
|
public List<InquiryQuoteStatusDTO> getTodayQuoteStatus() {
|
||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
List<BizInquiryRequest> inquiries = bizInquiryRequestMapper.selectOpenAndEffectiveInquiries(today);
|
List<BizInquiryRequest> inquiries = bizInquiryRequestMapper.selectOpenAndEffectiveInquiries(today);
|
||||||
|
|
||||||
Map<Long, List<Long>> inquiryProvidersMap = new HashMap<>();
|
Map<Long, List<Long>> inquiryProvidersMap = new HashMap<>();
|
||||||
@ -308,10 +311,9 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
|
|||||||
new ArrayList<>(allProviderIds), today
|
new ArrayList<>(allProviderIds), today
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<Pair<Long, Long>, BizLogisticsQuote> quoteMap = quotes.stream()
|
Map<Pair<Long, Long>, List<BizLogisticsQuote>> quoteMap = quotes.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.groupingBy(
|
||||||
quote -> Pair.of(quote.getInquiryId(), quote.getChannelId()),
|
quote -> Pair.of(quote.getInquiryId(), quote.getChannelId())
|
||||||
Function.identity()
|
|
||||||
));
|
));
|
||||||
|
|
||||||
List<InquiryQuoteStatusDTO> result = new ArrayList<>();
|
List<InquiryQuoteStatusDTO> result = new ArrayList<>();
|
||||||
|
|||||||
@ -2,10 +2,11 @@ package org.asinkj.amz.service.impl;
|
|||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import org.asinkj.amz.domain.BizPurchaseOrderItem;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.asinkj.amz.domain.BizShipForward;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.asinkj.amz.mapper.BizPurchaseOrderItemMapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import org.asinkj.amz.mapper.BizShipForwardMapper;
|
import org.asinkj.amz.domain.*;
|
||||||
|
import org.asinkj.amz.mapper.*;
|
||||||
import org.asinkj.amz.service.IBizPurchaseOrderItemService;
|
import org.asinkj.amz.service.IBizPurchaseOrderItemService;
|
||||||
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;
|
||||||
@ -19,11 +20,10 @@ import org.asinkj.common.satoken.utils.LoginHelper;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.asinkj.amz.domain.bo.BizPurchaseOrderBo;
|
import org.asinkj.amz.domain.bo.BizPurchaseOrderBo;
|
||||||
import org.asinkj.amz.domain.vo.BizPurchaseOrderVo;
|
import org.asinkj.amz.domain.vo.BizPurchaseOrderVo;
|
||||||
import org.asinkj.amz.domain.BizPurchaseOrder;
|
|
||||||
import org.asinkj.amz.mapper.BizPurchaseOrderMapper;
|
|
||||||
import org.asinkj.amz.service.IBizPurchaseOrderService;
|
import org.asinkj.amz.service.IBizPurchaseOrderService;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -44,17 +44,29 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BizShipForwardMapper bizForwardMapper;
|
private BizShipForwardMapper bizForwardMapper;
|
||||||
;
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizSendOrderMapper bizSendOrderMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysStatusHistoryMapper sysStatusHistoryMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizPurchaseOrderItemMapper bizPurchaseOrderItemMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询采购单主
|
* 查询采购单主
|
||||||
*
|
*
|
||||||
* @param orderSn 主键
|
* @param id 主键
|
||||||
* @return 采购单主
|
* @return 采购单主
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BizPurchaseOrderVo queryById(String orderSn) {
|
public BizPurchaseOrderVo queryById(Long id) {
|
||||||
return baseMapper.selectVoById(orderSn);
|
return baseMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,26 +82,75 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
|||||||
Page<BizPurchaseOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<BizPurchaseOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
List<BizPurchaseOrderVo> records = result.getRecords();
|
List<BizPurchaseOrderVo> records = result.getRecords();
|
||||||
Set<String> orderSnSet = records.stream().map(BizPurchaseOrderVo::getOrderSn).collect(Collectors.toSet());
|
Set<String> orderSnSet = records.stream().map(BizPurchaseOrderVo::getOrderSn).collect(Collectors.toSet());
|
||||||
|
Set<Long> orderIds = records.stream().map(BizPurchaseOrderVo::getId).collect(Collectors.toSet());
|
||||||
|
|
||||||
LambdaQueryWrapper<BizPurchaseOrderItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BizPurchaseOrderItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.in(CollectionUtil.isNotEmpty(orderSnSet), BizPurchaseOrderItem::getOrderSn, orderSnSet);
|
lambdaQueryWrapper.in(CollectionUtil.isNotEmpty(orderSnSet), BizPurchaseOrderItem::getOrderSn, orderSnSet);
|
||||||
Map<String, List<BizPurchaseOrderItem>> itemMaps = purchaseOrderItemMapper.selectList(lambdaQueryWrapper).stream().collect(Collectors.groupingBy(BizPurchaseOrderItem::getOrderSn));
|
Map<String, List<BizPurchaseOrderItem>> itemMaps = purchaseOrderItemMapper.selectList(lambdaQueryWrapper).stream().collect(Collectors.groupingBy(BizPurchaseOrderItem::getOrderSn));
|
||||||
|
HashSet<Long> itemIds = new HashSet<>();
|
||||||
|
itemMaps.values().forEach(itemList -> {
|
||||||
|
itemList.forEach(item -> {
|
||||||
|
itemIds.add(item.getId());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
LambdaQueryWrapper<BizShipForward> bizShipForwardWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BizShipForward> bizShipForwardWrapper = new LambdaQueryWrapper<>();
|
||||||
bizShipForwardWrapper.in(CollectionUtil.isNotEmpty(orderSnSet), BizShipForward::getOrderSn, orderSnSet);
|
bizShipForwardWrapper.in(CollectionUtil.isNotEmpty(orderSnSet), BizShipForward::getOrderSn, orderSnSet);
|
||||||
Map<String, List<BizShipForward>> bizShipForwardMap = bizForwardMapper.selectList(bizShipForwardWrapper).stream().collect(Collectors.groupingBy(BizShipForward::getOrderSn));
|
|
||||||
|
|
||||||
|
List<BizShipForward> bizShipForwards1 = bizForwardMapper.selectList(bizShipForwardWrapper);
|
||||||
|
Map<String, List<BizShipForward>> bizShipForwardMap = new HashMap<>();
|
||||||
|
Map<Long, List<BizShipForward>> bizShipForwardItemMap = new HashMap<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(bizShipForwards1)) {
|
||||||
|
bizShipForwardMap = bizShipForwards1.stream().collect(Collectors.groupingBy(BizShipForward::getOrderSn));
|
||||||
|
bizShipForwardItemMap = bizShipForwards1.stream().collect(Collectors.groupingBy(BizShipForward::getOrderDetailId));
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<BizSendOrder> bizSendOrderWrapper = new LambdaQueryWrapper<>();
|
||||||
|
bizSendOrderWrapper.in(CollectionUtil.isNotEmpty(orderSnSet), BizSendOrder::getOrderSn, orderSnSet);
|
||||||
|
List<BizSendOrder> bizSendOrders1 = bizSendOrderMapper.selectList(bizSendOrderWrapper);
|
||||||
|
Map<String, List<BizSendOrder>> BizSendOrderMap = new HashMap<>();
|
||||||
|
Map<Long, List<BizSendOrder>> BizSendOrderItemMap = new HashMap<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(bizSendOrders1)) {
|
||||||
|
BizSendOrderMap = bizSendOrders1.stream().collect(Collectors.groupingBy(BizSendOrder::getOrderSn));
|
||||||
|
BizSendOrderItemMap = bizSendOrders1.stream().filter(c -> ObjectUtil.isNotNull(c.getOrderDetailId())).collect(Collectors.groupingBy(BizSendOrder::getOrderDetailId));
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<SysStatusHistory> historyLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
historyLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(itemIds), SysStatusHistory::getRecordId, itemIds);
|
||||||
|
Map<Long, List<SysStatusHistory>> sysStatusHistoryMap = sysStatusHistoryMapper.selectList(historyLambdaQueryWrapper).stream().collect(Collectors.groupingBy(SysStatusHistory::getRecordId));
|
||||||
|
|
||||||
for (BizPurchaseOrderVo record : records) {
|
for (BizPurchaseOrderVo record : records) {
|
||||||
List<BizPurchaseOrderItem> bizPurchaseOrderItems = itemMaps.get(record.getOrderSn());
|
List<BizPurchaseOrderItem> bizPurchaseOrderItems = itemMaps.get(record.getOrderSn());
|
||||||
if (CollectionUtil.isNotEmpty(bizPurchaseOrderItems)) {
|
if (CollectionUtil.isNotEmpty(bizPurchaseOrderItems)) {
|
||||||
|
Map<Long, List<BizSendOrder>> finalBizSendOrderItemMap = BizSendOrderItemMap;
|
||||||
|
Map<Long, List<BizShipForward>> finalBizShipForwardItemMap = bizShipForwardItemMap;
|
||||||
|
bizPurchaseOrderItems.forEach(item -> {
|
||||||
|
item.setSysStatusHistories(sysStatusHistoryMap.get(item.getId()));
|
||||||
|
List<BizShipForward> bizShipForwards = finalBizShipForwardItemMap.get(item.getId());
|
||||||
|
List<BizSendOrder> bizSendOrders = finalBizSendOrderItemMap.get(item.getId());
|
||||||
|
if (CollectionUtil.isNotEmpty(bizShipForwards)) {
|
||||||
|
item.setHasForward("Y");
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(bizSendOrders)) {
|
||||||
|
item.setHasSendOrder("Y");
|
||||||
|
}
|
||||||
|
});
|
||||||
record.setItems(bizPurchaseOrderItems);
|
record.setItems(bizPurchaseOrderItems);
|
||||||
}
|
}
|
||||||
List<BizShipForward> bizShipForwards = bizShipForwardMap.get(record.getOrderSn());
|
List<BizShipForward> bizShipForwards = bizShipForwardMap.get(record.getOrderSn());
|
||||||
if (CollectionUtil.isNotEmpty(bizShipForwards)) {
|
if (CollectionUtil.isNotEmpty(bizShipForwards)) {
|
||||||
record.setForwardList(bizShipForwards);
|
record.setForwardList(bizShipForwards);
|
||||||
}
|
}
|
||||||
|
BigDecimal bizShipForwardDecimal = BigDecimal.ZERO;
|
||||||
|
if (CollectionUtil.isNotEmpty(bizShipForwards)) {
|
||||||
|
bizShipForwardDecimal = bizShipForwards.stream().map(bizShipForward -> new BigDecimal(bizShipForward.getQuantitySend())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
List<BizSendOrder> bizSendOrders = BizSendOrderMap.get(record.getOrderSn());
|
||||||
|
BigDecimal sendOrderDecimal = BigDecimal.ZERO;
|
||||||
|
if (CollectionUtil.isNotEmpty(bizSendOrders)) {
|
||||||
|
sendOrderDecimal = bizSendOrders.stream().map(bizSendOrder -> new BigDecimal(bizSendOrder.getQuantitySend())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
record.setRemainingQuantity(new BigDecimal(record.getQuantityReal()).subtract(bizShipForwardDecimal).subtract(sendOrderDecimal));
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
@ -155,15 +216,32 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getSettlementDescription()), BizPurchaseOrder::getSettlementDescription, bo.getSettlementDescription());
|
lqw.eq(StringUtils.isNotBlank(bo.getSettlementDescription()), BizPurchaseOrder::getSettlementDescription, bo.getSettlementDescription());
|
||||||
lqw.eq(bo.getPaymentMethod() != null, BizPurchaseOrder::getPaymentMethod, bo.getPaymentMethod());
|
lqw.eq(bo.getPaymentMethod() != null, BizPurchaseOrder::getPaymentMethod, bo.getPaymentMethod());
|
||||||
lqw.eq(bo.getEstDlvDays() != null, BizPurchaseOrder::getEstDlvDays, bo.getEstDlvDays());
|
lqw.eq(bo.getEstDlvDays() != null, BizPurchaseOrder::getEstDlvDays, bo.getEstDlvDays());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderStatus()), BizPurchaseOrder::getOrderStatus, bo.getOrderStatus());
|
lqw.in(StringUtils.isNotBlank(bo.getOrderStatus()), BizPurchaseOrder::getOrderStatus, StrUtil.split(bo.getOrderStatus(), ","));
|
||||||
lqw.eq(bo.getDeliveryTime() != null, BizPurchaseOrder::getDeliveryTime, bo.getDeliveryTime());
|
lqw.eq(bo.getDeliveryTime() != null, BizPurchaseOrder::getDeliveryTime, bo.getDeliveryTime());
|
||||||
lqw.eq(bo.getDlvTimeVar() != null, BizPurchaseOrder::getDlvTimeVar, bo.getDlvTimeVar());
|
lqw.eq(bo.getDlvTimeVar() != null, BizPurchaseOrder::getDlvTimeVar, bo.getDlvTimeVar());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getStoreName()), BizPurchaseOrder::getStoreName, bo.getStoreName());
|
||||||
|
|
||||||
lqw.orderBy(true, false, BizPurchaseOrder::getOrderTime);
|
lqw.orderBy(true, false, BizPurchaseOrder::getOrderTime);
|
||||||
|
// lqw.last("ORDER BY CASE status WHEN 2 THEN 1 ELSE 3 END ASC , order_time DESC");
|
||||||
|
// lqw.(true,true, "CASE status WHEN 2 THEN 1 WHEN 1 THEN 2 WHEN 3 THEN 3 ELSE 4 END");
|
||||||
|
|
||||||
if (StpUtil.hasRole("gongying")) {
|
if (StpUtil.hasRole("gongying")) {
|
||||||
|
|
||||||
lqw.eq(BizPurchaseOrder::getSupplierName, Objects.requireNonNull(LoginHelper.getLoginUser()).getNickname());
|
lqw.eq(BizPurchaseOrder::getSupplierName, Objects.requireNonNull(LoginHelper.getLoginUser()).getNickname());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (!LoginHelper.isSuperAdmin()) {
|
||||||
|
lqw.in(BizPurchaseOrder::getStatus, 2, 9);
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(bo.getSku())) {
|
||||||
|
LambdaQueryWrapper<BizPurchaseOrderItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(BizPurchaseOrderItem::getSku, StrUtil.split(bo.getSku(), ","));
|
||||||
|
|
||||||
|
List<BizPurchaseOrderItem> bizPurchaseOrderItems = purchaseOrderItemMapper.selectList(lambdaQueryWrapper);
|
||||||
|
List<String> orderSnList = bizPurchaseOrderItems.stream().map(BizPurchaseOrderItem::getOrderSn).collect(Collectors.toList());
|
||||||
|
lqw.in(BizPurchaseOrder::getOrderSn, orderSnList);
|
||||||
|
}
|
||||||
|
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,4 +296,15 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
|||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean confirmByBo(BizPurchaseOrderBo bo) {
|
||||||
|
BizPurchaseOrder update = MapstructUtils.convert(bo, BizPurchaseOrder.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
LambdaUpdateWrapper<BizPurchaseOrderItem> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
lambdaUpdateWrapper.in(BizPurchaseOrderItem::getOrderSn, update.getOrderSn());
|
||||||
|
lambdaUpdateWrapper.set(BizPurchaseOrderItem::getOrderStatus, "ord_confirmed");
|
||||||
|
purchaseOrderItemMapper.update(lambdaUpdateWrapper);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,15 @@
|
|||||||
package org.asinkj.amz.service.impl;
|
package org.asinkj.amz.service.impl;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import org.asinkj.amz.domain.SysAmazonStore;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
import org.asinkj.amz.domain.*;
|
||||||
|
import org.asinkj.amz.domain.bo.SysAmazonStoreBo;
|
||||||
|
import org.asinkj.amz.domain.vo.SysAmazonStoreVo;
|
||||||
|
import org.asinkj.amz.mapper.BizLogisticsOrderDetailMapper;
|
||||||
|
import org.asinkj.amz.mapper.BizLogisticsOrderMapper;
|
||||||
|
import org.asinkj.amz.service.ISysAmazonStoreService;
|
||||||
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;
|
||||||
@ -11,17 +18,22 @@ 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.asinkj.system.api.RemoteUserService;
|
||||||
|
import org.asinkj.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.asinkj.amz.domain.bo.BizSendOrderBo;
|
import org.asinkj.amz.domain.bo.BizSendOrderBo;
|
||||||
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
||||||
import org.asinkj.amz.domain.BizSendOrder;
|
|
||||||
import org.asinkj.amz.mapper.BizSendOrderMapper;
|
import org.asinkj.amz.mapper.BizSendOrderMapper;
|
||||||
import org.asinkj.amz.service.IBizSendOrderService;
|
import org.asinkj.amz.service.IBizSendOrderService;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商创建的发货单Service业务层处理
|
* 供应商创建的发货单Service业务层处理
|
||||||
@ -35,6 +47,19 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
|||||||
|
|
||||||
private final BizSendOrderMapper baseMapper;
|
private final BizSendOrderMapper baseMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysAmazonStoreService iSysAmazonStoreService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizLogisticsOrderMapper bizLogisticsOrderMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizLogisticsOrderDetailMapper bizLogisticsOrderDetailMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询供应商创建的发货单
|
* 查询供应商创建的发货单
|
||||||
*
|
*
|
||||||
@ -57,6 +82,36 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
|||||||
public TableDataInfo<BizSendOrderVo> queryPageList(BizSendOrderBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BizSendOrderVo> queryPageList(BizSendOrderBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<BizSendOrder> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BizSendOrder> lqw = buildQueryWrapper(bo);
|
||||||
Page<BizSendOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<BizSendOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
List<BizSendOrderVo> records = result.getRecords();
|
||||||
|
Set<String> shipmentIds = records.stream().map(BizSendOrderVo::getShipmentId).collect(Collectors.toSet());
|
||||||
|
LambdaQueryWrapper<BizLogisticsOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(CollectionUtil.isNotEmpty(shipmentIds), BizLogisticsOrder::getFbaShipmentId, shipmentIds);
|
||||||
|
List<BizLogisticsOrder> bizLogisticsOrders = bizLogisticsOrderMapper.selectList(lambdaQueryWrapper);
|
||||||
|
Set<String> collect = bizLogisticsOrders.stream().map(BizLogisticsOrder::getOrderId).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
LambdaQueryWrapper<BizLogisticsOrderDetail> orderDetailLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
orderDetailLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(collect), BizLogisticsOrderDetail::getOrderId, collect);
|
||||||
|
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails = bizLogisticsOrderDetailMapper.selectList(orderDetailLambdaQueryWrapper);
|
||||||
|
Map<String, List<BizLogisticsOrderDetail>> detailMap = bizLogisticsOrderDetails.stream().collect(Collectors.groupingBy(BizLogisticsOrderDetail::getOrderId));
|
||||||
|
|
||||||
|
for (BizLogisticsOrder bizLogisticsOrder : bizLogisticsOrders) {
|
||||||
|
bizLogisticsOrder.setDetails(detailMap.get(bizLogisticsOrder.getOrderId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, BizLogisticsOrder> logisticsOrderMap = bizLogisticsOrders.stream().collect(Collectors.toMap(BizLogisticsOrder::getFbaShipmentId, Function.identity()));
|
||||||
|
|
||||||
|
List<Long> logicIds = records.stream().map(BizSendOrderVo::getLogisticsProviderId).distinct().toList();
|
||||||
|
Map<Long, RemoteUserVo> remoteUserVoMap = remoteUserService.selectListByIds(logicIds).stream().collect(Collectors.toMap(RemoteUserVo::getUserId, Function.identity()));
|
||||||
|
for (BizSendOrderVo record : records) {
|
||||||
|
RemoteUserVo remoteUserVo = remoteUserVoMap.get(record.getLogisticsProviderId());
|
||||||
|
if (remoteUserVo != null) {
|
||||||
|
record.setAddress(remoteUserVo.getAddress());
|
||||||
|
}
|
||||||
|
BizLogisticsOrder bizLogisticsOrder = logisticsOrderMap.get(record.getShipmentId());
|
||||||
|
if (bizLogisticsOrder != null) {
|
||||||
|
record.setBizLogisticsOrder(bizLogisticsOrder);
|
||||||
|
}
|
||||||
|
}
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +141,18 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
|||||||
lqw.eq(bo.getWeightPerBox() != null, BizSendOrder::getWeightPerBox, bo.getWeightPerBox());
|
lqw.eq(bo.getWeightPerBox() != null, BizSendOrder::getWeightPerBox, bo.getWeightPerBox());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getRealStoreName()), BizSendOrder::getRealStoreName, bo.getRealStoreName());
|
lqw.like(StringUtils.isNotBlank(bo.getRealStoreName()), BizSendOrder::getRealStoreName, bo.getRealStoreName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSendStatus()), BizSendOrder::getSendStatus, bo.getSendStatus());
|
lqw.eq(StringUtils.isNotBlank(bo.getSendStatus()), BizSendOrder::getSendStatus, bo.getSendStatus());
|
||||||
|
if (StpUtil.hasRole("yunying")) {
|
||||||
|
SysAmazonStoreBo sysAmazonStoreBo = new SysAmazonStoreBo();
|
||||||
|
sysAmazonStoreBo.setUserId(LoginHelper.getUserId());
|
||||||
|
List<SysAmazonStoreVo> sysAmazonStoreVos = iSysAmazonStoreService.queryList(sysAmazonStoreBo);
|
||||||
|
Set<String> storeNameCollect = sysAmazonStoreVos.stream().map(SysAmazonStoreVo::getStoreName).collect(Collectors.toSet());
|
||||||
|
if (CollectionUtil.isNotEmpty(storeNameCollect)) {
|
||||||
|
lqw.and(queryWrapper -> queryWrapper.in(BizSendOrder::getStoreName, storeNameCollect).or().in(BizSendOrder::getRealStoreName, storeNameCollect));
|
||||||
|
}
|
||||||
|
} else if (StpUtil.hasRole("gongying")) {
|
||||||
|
lqw.eq(BizSendOrder::getSendId, LoginHelper.getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,6 +166,8 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
|||||||
public Boolean insertByBo(BizSendOrderBo bo) {
|
public Boolean insertByBo(BizSendOrderBo bo) {
|
||||||
BizSendOrder add = MapstructUtils.convert(bo, BizSendOrder.class);
|
BizSendOrder add = MapstructUtils.convert(bo, BizSendOrder.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
|
add.setSendId(LoginHelper.getUserId());
|
||||||
|
add.setSendName(LoginHelper.getLoginUser().getNickname());
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
@ -157,9 +226,9 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateStatus(Long sendOrderId, String completed) {
|
public void updateStatus(Long sendOrderId, String completed, String shipmentId) {
|
||||||
LambdaUpdateWrapper<BizSendOrder> queryWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<BizSendOrder> queryWrapper = new LambdaUpdateWrapper<>();
|
||||||
queryWrapper.eq(BizSendOrder::getId, sendOrderId).set(BizSendOrder::getSendStatus, completed);
|
queryWrapper.eq(BizSendOrder::getId, sendOrderId).set(BizSendOrder::getSendStatus, completed).set(BizSendOrder::getShipmentId, shipmentId);
|
||||||
baseMapper.update(queryWrapper);
|
baseMapper.update(queryWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package org.asinkj.amz.service.impl;
|
package org.asinkj.amz.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.asinkj.common.core.utils.MapstructUtils;
|
import org.asinkj.common.core.utils.MapstructUtils;
|
||||||
@ -171,10 +173,10 @@ public class BizShipForwardServiceImpl implements IBizShipForwardService {
|
|||||||
@Override
|
@Override
|
||||||
public void sendUpdateByBo(BizShipForwardBo bo) {
|
public void sendUpdateByBo(BizShipForwardBo bo) {
|
||||||
LambdaUpdateWrapper<BizShipForward> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<BizShipForward> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
|
||||||
updateWrapper.eq(BizShipForward::getId, bo.getId());
|
updateWrapper.eq(BizShipForward::getId, bo.getId());
|
||||||
updateWrapper.set(BizShipForward::getFwdStatus, bo.getFwdStatus());
|
updateWrapper.set(BizShipForward::getFwdStatus, bo.getFwdStatus());
|
||||||
|
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getExpDeliveryDate()), BizShipForward::getExpDeliveryDate, bo.getExpDeliveryDate());
|
||||||
|
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getBoxNum()), BizShipForward::getBoxNum, bo.getBoxNum());
|
||||||
baseMapper.update(updateWrapper);
|
baseMapper.update(updateWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,9 +101,9 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
|||||||
if (StrUtil.isNotBlank(bo.getSellerName())) {
|
if (StrUtil.isNotBlank(bo.getSellerName())) {
|
||||||
LambdaQueryWrapper<SysAmazonStore> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysAmazonStore> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(SysAmazonStore::getStoreName, bo.getSellerName());
|
queryWrapper.like(SysAmazonStore::getStoreName, bo.getSellerName());
|
||||||
SysAmazonStore sysAmazonStore = sysAmazonStoreMapper.selectOne(queryWrapper);
|
List<SysAmazonStore> sysAmazonStores = sysAmazonStoreMapper.selectList(queryWrapper);
|
||||||
if (sysAmazonStore != null) {
|
if (CollectionUtil.isNotEmpty(sysAmazonStores)) {
|
||||||
bo.setSid(sysAmazonStore.getSid());
|
bo.setSidList(sysAmazonStores.stream().map(SysAmazonStore::getSid).collect(Collectors.toSet()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<BizShipmentPlan> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BizShipmentPlan> lqw = buildQueryWrapper(bo);
|
||||||
@ -194,6 +194,7 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
|||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<BizShipmentPlan> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<BizShipmentPlan> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getSid() != null, BizShipmentPlan::getSid, bo.getSid());
|
lqw.eq(bo.getSid() != null, BizShipmentPlan::getSid, bo.getSid());
|
||||||
|
lqw.in(CollectionUtil.isNotEmpty(bo.getSidList()), BizShipmentPlan::getSid, bo.getSidList());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getShipmentId()), BizShipmentPlan::getShipmentId, bo.getShipmentId());
|
lqw.eq(StringUtils.isNotBlank(bo.getShipmentId()), BizShipmentPlan::getShipmentId, bo.getShipmentId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getShipmentName()), BizShipmentPlan::getShipmentName, bo.getShipmentName());
|
lqw.like(StringUtils.isNotBlank(bo.getShipmentName()), BizShipmentPlan::getShipmentName, bo.getShipmentName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getIsClosed()), BizShipmentPlan::getIsClosed, bo.getIsClosed());
|
lqw.eq(StringUtils.isNotBlank(bo.getIsClosed()), BizShipmentPlan::getIsClosed, bo.getIsClosed());
|
||||||
@ -454,7 +455,7 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
|||||||
public Boolean linkByBo(BizShipmentPlanBo bo) {
|
public Boolean linkByBo(BizShipmentPlanBo bo) {
|
||||||
BizShipmentPlan update = MapstructUtils.convert(bo, BizShipmentPlan.class);
|
BizShipmentPlan update = MapstructUtils.convert(bo, BizShipmentPlan.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
iSendOrderService.updateStatus(bo.getSendOrderId(), "completed");
|
iSendOrderService.updateStatus(bo.getSendOrderId(), "fba_created",update.getShipmentId());
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.alibaba.fastjson2.JSON;
|
|||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.alibaba.fastjson2.TypeReference;
|
import com.alibaba.fastjson2.TypeReference;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
@ -534,7 +535,10 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
|
|
||||||
JSONObject jsonObject = JSONObject.parse(string);
|
JSONObject jsonObject = JSONObject.parse(string);
|
||||||
JSONArray data = jsonObject.getJSONArray("data");
|
JSONArray data = jsonObject.getJSONArray("data");
|
||||||
|
if (ObjectUtil.isEmpty(data)) {
|
||||||
|
log.info("未获取到采购订单");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<PurchaseOrderResponse.OrderData> list = data.toList(PurchaseOrderResponse.OrderData.class);
|
List<PurchaseOrderResponse.OrderData> list = data.toList(PurchaseOrderResponse.OrderData.class);
|
||||||
log.info("list:{}", list);
|
log.info("list:{}", list);
|
||||||
@ -543,7 +547,10 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
list = list.stream().filter(c -> !"外采".equals(c.getSupplierName())).collect(Collectors.toList());
|
list = list.stream().filter(c -> !"外采".equals(c.getSupplierName())).collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
|
log.info("未获取非外采到采购订单");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Set<String> orderSns = list.stream().map(PurchaseOrderResponse.OrderData::getOrderSn).collect(Collectors.toSet());
|
Set<String> orderSns = list.stream().map(PurchaseOrderResponse.OrderData::getOrderSn).collect(Collectors.toSet());
|
||||||
Set<Long> storeList = new HashSet<>();
|
Set<Long> storeList = new HashSet<>();
|
||||||
for (PurchaseOrderResponse.OrderData orderData : list) {
|
for (PurchaseOrderResponse.OrderData orderData : list) {
|
||||||
@ -552,6 +559,7 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
storeList.add(itemListItem.getSid());
|
storeList.add(itemListItem.getSid());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LambdaQueryWrapper<SysAmazonStore> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysAmazonStore> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(SysAmazonStore::getSid, storeList);
|
queryWrapper.in(SysAmazonStore::getSid, storeList);
|
||||||
|
|
||||||
@ -585,7 +593,34 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(orders)) {
|
if (CollectionUtil.isNotEmpty(orders)) {
|
||||||
bizPurchaseOrderMapper.insertOrUpdateBatch(orders);
|
// 获取所有已存在的 order_sn 列表
|
||||||
|
LambdaQueryWrapper<BizPurchaseOrder> orderQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
orderQueryWrapper.select(BizPurchaseOrder::getOrderSn); // 仅查询标识字段
|
||||||
|
List<String> existSnList = bizPurchaseOrderMapper.selectList(orderQueryWrapper)
|
||||||
|
.stream()
|
||||||
|
.map(BizPurchaseOrder::getOrderSn)
|
||||||
|
.toList();
|
||||||
|
// bizPurchaseOrderMapper.insertOrUpdateBatch(orders);
|
||||||
|
Map<Boolean, List<BizPurchaseOrder>> groupMap = orders.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
order -> existSnList.contains(order.getOrderSn()) // true=需更新, false=需新增
|
||||||
|
));
|
||||||
|
|
||||||
|
List<BizPurchaseOrder> toUpdate = groupMap.get(true); // 需更新的数据
|
||||||
|
List<BizPurchaseOrder> toInsert = groupMap.get(false); // 需新增的数据
|
||||||
|
// 批量更新(根据非主键字段)
|
||||||
|
if (!CollectionUtil.isEmpty(toUpdate)) {
|
||||||
|
toUpdate.forEach(order -> {
|
||||||
|
LambdaQueryWrapper<BizPurchaseOrder> bpowrapper = new LambdaQueryWrapper<>();
|
||||||
|
bpowrapper.eq(BizPurchaseOrder::getOrderSn, order.getOrderSn()); // 按 order_sn 更新
|
||||||
|
bizPurchaseOrderMapper.update(order, bpowrapper);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量新增
|
||||||
|
if (!CollectionUtil.isEmpty(toInsert)) {
|
||||||
|
bizPurchaseOrderMapper.insertBatch(toInsert); // 高效批量插入[1](@ref)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(bizPurchaseOrderItems)) {
|
if (CollectionUtil.isNotEmpty(bizPurchaseOrderItems)) {
|
||||||
bizPurchaseOrderItemMapper.insertOrUpdateBatch(bizPurchaseOrderItems);
|
bizPurchaseOrderItemMapper.insertOrUpdateBatch(bizPurchaseOrderItems);
|
||||||
@ -876,7 +911,9 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
|
|
||||||
AmzShippingResponse amzShippingResponse = JSON.parseObject(shipmentString, new TypeReference<>() {
|
AmzShippingResponse amzShippingResponse = JSON.parseObject(shipmentString, new TypeReference<>() {
|
||||||
});
|
});
|
||||||
|
if (amzShippingResponse.getData() == null){
|
||||||
|
return bizShipmentPlans;
|
||||||
|
}
|
||||||
|
|
||||||
List<AmzShippingResponse.Shipment> shipmentList1 = amzShippingResponse.getData().getShipmentList();
|
List<AmzShippingResponse.Shipment> shipmentList1 = amzShippingResponse.getData().getShipmentList();
|
||||||
|
|
||||||
@ -893,6 +930,7 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
bizShipmentPlan.setShipmentStatus(shipment.getStatus());
|
bizShipmentPlan.setShipmentStatus(shipment.getStatus());
|
||||||
bizShipmentPlan.setDestination(shipment.getWarehouseId());
|
bizShipmentPlan.setDestination(shipment.getWarehouseId());
|
||||||
bizShipmentPlan.setStaShipmentDate(shipment.getShipingTime());
|
bizShipmentPlan.setStaShipmentDate(shipment.getShipingTime());
|
||||||
|
bizShipmentPlan.setSetTotal(Long.valueOf(shipment.getItemCount()));
|
||||||
FbaShipmentApiResponse.Address shipFromAddress = new FbaShipmentApiResponse.Address();
|
FbaShipmentApiResponse.Address shipFromAddress = new FbaShipmentApiResponse.Address();
|
||||||
shipFromAddress.setAddressLine1(shipment.getSendAddress().getAddressLine1());
|
shipFromAddress.setAddressLine1(shipment.getSendAddress().getAddressLine1());
|
||||||
shipFromAddress.setAddressLine2(shipment.getSendAddress().getAddressLine2());
|
shipFromAddress.setAddressLine2(shipment.getSendAddress().getAddressLine2());
|
||||||
@ -928,7 +966,7 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
|||||||
bizShipmentItem.setSku(item.getSku());
|
bizShipmentItem.setSku(item.getSku());
|
||||||
bizShipmentItem.setProductName(item.getProductName());
|
bizShipmentItem.setProductName(item.getProductName());
|
||||||
bizShipmentItem.setAsin(item.getAsin());
|
bizShipmentItem.setAsin(item.getAsin());
|
||||||
// bizShipmentItem.setQuantityShipped(item.getQuantity());
|
bizShipmentItem.setQuantityShipped(Long.valueOf(item.getQuantity()));
|
||||||
bizShipmentItems.add(bizShipmentItem);
|
bizShipmentItems.add(bizShipmentItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,135 @@
|
|||||||
|
package org.asinkj.amz.service.impl;
|
||||||
|
|
||||||
|
import org.asinkj.common.core.utils.MapstructUtils;
|
||||||
|
import org.asinkj.common.core.utils.StringUtils;
|
||||||
|
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.asinkj.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.asinkj.amz.domain.bo.SysStatusHistoryBo;
|
||||||
|
import org.asinkj.amz.domain.vo.SysStatusHistoryVo;
|
||||||
|
import org.asinkj.amz.domain.SysStatusHistory;
|
||||||
|
import org.asinkj.amz.mapper.SysStatusHistoryMapper;
|
||||||
|
import org.asinkj.amz.service.ISysStatusHistoryService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态历史Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shuo hu
|
||||||
|
* @date 2025-06-09
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SysStatusHistoryServiceImpl implements ISysStatusHistoryService {
|
||||||
|
|
||||||
|
private final SysStatusHistoryMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态历史
|
||||||
|
*
|
||||||
|
* @param historyId 主键
|
||||||
|
* @return 状态历史
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysStatusHistoryVo queryById(Long historyId){
|
||||||
|
return baseMapper.selectVoById(historyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询状态历史列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 状态历史分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SysStatusHistoryVo> queryPageList(SysStatusHistoryBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SysStatusHistory> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SysStatusHistoryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的状态历史列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 状态历史列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysStatusHistoryVo> queryList(SysStatusHistoryBo bo) {
|
||||||
|
LambdaQueryWrapper<SysStatusHistory> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SysStatusHistory> buildQueryWrapper(SysStatusHistoryBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SysStatusHistory> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getHistoryId() != null, SysStatusHistory::getHistoryId, bo.getHistoryId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getTableName()), SysStatusHistory::getTableName, bo.getTableName());
|
||||||
|
lqw.eq(bo.getRecordId() != null, SysStatusHistory::getRecordId, bo.getRecordId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatusColumn()), SysStatusHistory::getStatusColumn, bo.getStatusColumn());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getOldStatus()), SysStatusHistory::getOldStatus, bo.getOldStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getNewStatus()), SysStatusHistory::getNewStatus, bo.getNewStatus());
|
||||||
|
lqw.eq(bo.getOriginalChangedAt() != null, SysStatusHistory::getOriginalChangedAt, bo.getOriginalChangedAt());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增状态历史
|
||||||
|
*
|
||||||
|
* @param bo 状态历史
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SysStatusHistoryBo bo) {
|
||||||
|
SysStatusHistory add = MapstructUtils.convert(bo, SysStatusHistory.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setHistoryId(add.getHistoryId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态历史
|
||||||
|
*
|
||||||
|
* @param bo 状态历史
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SysStatusHistoryBo bo) {
|
||||||
|
SysStatusHistory update = MapstructUtils.convert(bo, SysStatusHistory.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SysStatusHistory entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除状态历史信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,9 +8,9 @@
|
|||||||
SELECT blo.*
|
SELECT blo.*
|
||||||
FROM biz_logistics_order blo
|
FROM biz_logistics_order blo
|
||||||
WHERE blo.logistics_provider_id = #{userId}
|
WHERE blo.logistics_provider_id = #{userId}
|
||||||
<!--
|
<!--
|
||||||
替换为实际物流商ID
|
替换为实际物流商ID
|
||||||
-->
|
-->
|
||||||
AND blo.del_flag = '0'
|
AND blo.del_flag = '0'
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
@ -19,7 +19,8 @@
|
|||||||
AND blod.del_flag = '0'
|
AND blod.del_flag = '0'
|
||||||
AND blod.estimated_delivery_date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '5 days'
|
AND blod.estimated_delivery_date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '5 days'
|
||||||
AND blod.logistics_status != 'delivered'
|
AND blod.logistics_status != 'delivered'
|
||||||
LIMIT 1 -- 明确只需判断存在至少一条符合条件的明细
|
LIMIT 1
|
||||||
|
|
||||||
);
|
);
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.asinkj.amz.mapper.SysStatusHistoryMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -74,6 +74,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope> <!-- 必须为provided或compile -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 自动生成YML配置关联JSON文件 -->
|
<!-- 自动生成YML配置关联JSON文件 -->
|
||||||
|
|||||||
@ -67,6 +67,9 @@ public class SseEmitterManager {
|
|||||||
* @param token 用户的唯一令牌,用于识别具体的连接
|
* @param token 用户的唯一令牌,用于识别具体的连接
|
||||||
*/
|
*/
|
||||||
public void disconnect(Long userId, String token) {
|
public void disconnect(Long userId, String token) {
|
||||||
|
if (userId == null || token == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Map<String, SseEmitter> emitters = USER_TOKEN_EMITTERS.get(userId);
|
Map<String, SseEmitter> emitters = USER_TOKEN_EMITTERS.get(userId);
|
||||||
if (emitters != null) {
|
if (emitters != null) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -105,6 +105,8 @@ public class SysUser extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
|
||||||
public SysUser(Long userId) {
|
public SysUser(Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
|
|||||||
@ -108,6 +108,10 @@ public class SysUserBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String excludeUserIds;
|
private String excludeUserIds;
|
||||||
|
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
|
||||||
public SysUserBo(Long userId) {
|
public SysUserBo(Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,12 @@ public class SysUserProfileBo extends BaseEntity {
|
|||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符")
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
|
||||||
|
// @Sensitive(strategy = SensitiveStrategy.EMAIL)
|
||||||
|
// @Email(message = "邮箱格式不正确")
|
||||||
|
@Size(min = 0, max = 500, message = "地址长度不能超过{max}个字符")
|
||||||
|
private String address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -141,4 +141,8 @@ public class SysUserVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package org.asinkj.system.dubbo;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.lang.Opt;
|
import cn.hutool.core.lang.Opt;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
|
|||||||
@ -26,10 +26,10 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
|||||||
})
|
})
|
||||||
Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||||
|
|
||||||
@DataPermission({
|
// @DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
// @DataColumn(key = "deptName", value = "dept_id")
|
||||||
@DataColumn(key = "userName", value = "user_id")
|
// @DataColumn(key = "userName", value = "user_id")
|
||||||
})
|
// })
|
||||||
List<SysUserVo> selectUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
List<SysUserVo> selectUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -185,7 +185,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
@Override
|
@Override
|
||||||
public List<SysUserVo> selectUserByIds(List<Long> userIds, Long deptId) {
|
public List<SysUserVo> selectUserByIds(List<Long> userIds, Long deptId) {
|
||||||
return baseMapper.selectUserList(new LambdaQueryWrapper<SysUser>()
|
return baseMapper.selectUserList(new LambdaQueryWrapper<SysUser>()
|
||||||
.select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName, SysUser::getEmail, SysUser::getPhonenumber) .eq(SysUser::getStatus, UserConstants.USER_NORMAL)
|
.select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName, SysUser::getEmail, SysUser::getPhonenumber, SysUser::getAddress).eq(SysUser::getStatus, UserConstants.USER_NORMAL)
|
||||||
.eq(ObjectUtil.isNotNull(deptId), SysUser::getDeptId, deptId)
|
.eq(ObjectUtil.isNotNull(deptId), SysUser::getDeptId, deptId)
|
||||||
.in(CollUtil.isNotEmpty(userIds), SysUser::getUserId, userIds));
|
.in(CollUtil.isNotEmpty(userIds), SysUser::getUserId, userIds));
|
||||||
}
|
}
|
||||||
@ -390,6 +390,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
.set(SysUser::getPhonenumber, user.getPhonenumber())
|
.set(SysUser::getPhonenumber, user.getPhonenumber())
|
||||||
.set(SysUser::getEmail, user.getEmail())
|
.set(SysUser::getEmail, user.getEmail())
|
||||||
.set(SysUser::getSex, user.getSex())
|
.set(SysUser::getSex, user.getSex())
|
||||||
|
.set(SysUser::getAddress, user.getAddress())
|
||||||
.eq(SysUser::getUserId, user.getUserId()));
|
.eq(SysUser::getUserId, user.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
79
asinkj-node/src/nacos-config.js
Normal file
79
asinkj-node/src/nacos-config.js
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// nacos-config.js
|
||||||
|
const NacosNamingClient = require('nacos').NacosNamingClient;
|
||||||
|
|
||||||
|
// 创建 Nacos 客户端
|
||||||
|
const nacosClient = new NacosNamingClient({
|
||||||
|
serverList: '112.74.106.216:8848', // 您的 Nacos 地址
|
||||||
|
namespace: 'dev', // 命名空间
|
||||||
|
username: 'nacos',
|
||||||
|
password: 'nacos',
|
||||||
|
logger: console
|
||||||
|
});
|
||||||
|
|
||||||
|
// 服务注册配置
|
||||||
|
const serviceConfig = {
|
||||||
|
serviceName: 'node-bff-service',
|
||||||
|
groupName: 'DEFAULT_GROUP',
|
||||||
|
ip: getContainerIP(), // 获取本机IP
|
||||||
|
port: 3000,
|
||||||
|
ephemeral: true, // 临时实例
|
||||||
|
metadata: {
|
||||||
|
type: 'nodejs',
|
||||||
|
version: '1.0'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取本机IP (适合 Docker 容器环境)
|
||||||
|
// 优化后的Node.js IP获取方案
|
||||||
|
function getContainerIP() {
|
||||||
|
// 1. 优先使用K8s/Docker设置的环境变量
|
||||||
|
if (process.env.POD_IP) return process.env.POD_IP;
|
||||||
|
if (process.env.HOST_IP) return process.env.HOST_IP;
|
||||||
|
|
||||||
|
// 2. 自动检测网络接口
|
||||||
|
const nets = require('os').networkInterfaces();
|
||||||
|
for (const name of Object.keys(nets)) {
|
||||||
|
for (const net of nets[name]) {
|
||||||
|
if (net.family === 'IPv4' && !net.internal) {
|
||||||
|
return net.address;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 使用服务名作为回退方案 (K8s中有效)
|
||||||
|
return require('os').hostname();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
nacosClient,
|
||||||
|
serviceConfig
|
||||||
|
};
|
||||||
|
|
||||||
|
// 初始化并注册服务
|
||||||
|
async function registerToNacos() {
|
||||||
|
await nacosClient.ready();
|
||||||
|
|
||||||
|
// 注册服务
|
||||||
|
await nacosClient.registerInstance(
|
||||||
|
serviceConfig.serviceName,
|
||||||
|
serviceConfig
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('✅ 服务成功注册到 Nacos:', serviceConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 启动时自动注册
|
||||||
|
registerToNacos().catch(err => {
|
||||||
|
console.error('❌ Nacos 注册失败:', err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 退出时注销服务
|
||||||
|
process.on('SIGINT', async () => {
|
||||||
|
await nacosClient.deregisterInstance(
|
||||||
|
serviceConfig.serviceName,
|
||||||
|
serviceConfig
|
||||||
|
);
|
||||||
|
console.log('🚪 服务已从 Nacos 注销');
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
0
asinkj-node/src/routes/bff.js
Normal file
0
asinkj-node/src/routes/bff.js
Normal file
68
asinkj-node/src/server.js
Normal file
68
asinkj-node/src/server.js
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const app = express();
|
||||||
|
const axios = require('axios');
|
||||||
|
const {nacosClient, serviceConfig} = require('./nacos-config');
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 3000;
|
||||||
|
|
||||||
|
// 中间件
|
||||||
|
app.use(express.json());
|
||||||
|
|
||||||
|
// 健康检查端点
|
||||||
|
app.get('/health', (req, res) => {
|
||||||
|
res.json({
|
||||||
|
status: 'UP',
|
||||||
|
service: 'node-bff',
|
||||||
|
timestamp: new Date()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// ================= 新增的测试接口 =================
|
||||||
|
// 简单的 hello 测试接口
|
||||||
|
app.get('/bff/hello', (req, res) => {
|
||||||
|
console.log('BFF 接收到请求:', req.method, req.url);
|
||||||
|
res.json({
|
||||||
|
message: 'Hello from Node.js BFF!',
|
||||||
|
serviceName: serviceConfig.serviceName,
|
||||||
|
clientIp: req.ip,
|
||||||
|
time: new Date().toISOString(),
|
||||||
|
tips: '访问此接口验证通过网关的路由是否生效'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// BFF 路由示例:聚合用户数据
|
||||||
|
app.get('/bff/users/:id', async (req, res) => {
|
||||||
|
try {
|
||||||
|
// 从 Nacos 获取 Java 用户服务实例
|
||||||
|
const javaService = 'java-user-service';
|
||||||
|
const instances = await nacosClient.getAllInstances(javaService, 'DEFAULT_GROUP');
|
||||||
|
|
||||||
|
if (!instances || instances.length === 0) {
|
||||||
|
return res.status(503).send('后端服务不可用');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择第一个可用实例
|
||||||
|
const targetInstance = instances[0];
|
||||||
|
const serviceUrl = `http://${targetInstance.ip}:${targetInstance.port}`;
|
||||||
|
|
||||||
|
// 调用 Java 服务
|
||||||
|
const userResponse = await axios.get(`${serviceUrl}/users/${req.params.id}`);
|
||||||
|
|
||||||
|
res.json({
|
||||||
|
source: 'Node.js BFF',
|
||||||
|
backend: targetInstance,
|
||||||
|
data: userResponse.data
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('BFF 服务错误:', error);
|
||||||
|
res.status(500).send('内部服务器错误');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 启动服务
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`🚀 Node BFF 服务运行中: http://localhost:${PORT}`);
|
||||||
|
console.log('✅ 注册在 Nacos 的服务名:', serviceConfig.serviceName);
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user