9月新需求修改
This commit is contained in:
parent
2f550fea64
commit
fc0bc4fa53
@ -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.BizPackingSpecsItemVo;
|
||||
import org.asinkj.amz.domain.bo.BizPackingSpecsItemBo;
|
||||
import org.asinkj.amz.service.IBizPackingSpecsItemService;
|
||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品装箱规格明细
|
||||
* 前端访问路由地址为:/amz/packingSpecsItem
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/packingSpecsItem")
|
||||
public class BizPackingSpecsItemController extends BaseController {
|
||||
|
||||
private final IBizPackingSpecsItemService bizPackingSpecsItemService;
|
||||
|
||||
/**
|
||||
* 查询产品装箱规格明细列表
|
||||
*/
|
||||
@SaCheckPermission("amz:packingSpecsItem:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BizPackingSpecsItemVo> list(BizPackingSpecsItemBo bo, PageQuery pageQuery) {
|
||||
return bizPackingSpecsItemService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品装箱规格明细列表
|
||||
*/
|
||||
@SaCheckPermission("amz:packingSpecsItem:export")
|
||||
@Log(title = "产品装箱规格明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BizPackingSpecsItemBo bo, HttpServletResponse response) {
|
||||
List<BizPackingSpecsItemVo> list = bizPackingSpecsItemService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "产品装箱规格明细", BizPackingSpecsItemVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品装箱规格明细详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("amz:packingSpecsItem:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BizPackingSpecsItemVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(bizPackingSpecsItemService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品装箱规格明细
|
||||
*/
|
||||
@SaCheckPermission("amz:packingSpecsItem:add")
|
||||
@Log(title = "产品装箱规格明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BizPackingSpecsItemBo bo) {
|
||||
return toAjax(bizPackingSpecsItemService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品装箱规格明细
|
||||
*/
|
||||
@SaCheckPermission("amz:packingSpecsItem:edit")
|
||||
@Log(title = "产品装箱规格明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BizPackingSpecsItemBo bo) {
|
||||
return toAjax(bizPackingSpecsItemService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品装箱规格明细
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("amz:packingSpecsItem:remove")
|
||||
@Log(title = "产品装箱规格明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(bizPackingSpecsItemService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,10 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.asinkj.amz.domain.BizShipmentPlan;
|
||||
import org.asinkj.amz.domain.bo.BizSendOrderMixBo;
|
||||
import org.asinkj.amz.domain.bo.BizSendOrderMixPackSpecsBo;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderPackVo;
|
||||
import org.asinkj.amz.domain.vo.BizShipmentPlanVo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -57,6 +61,18 @@ public class BizSendOrderController extends BaseController {
|
||||
return bizSendOrderService.coverSendOrder(bo, pageQuery);
|
||||
}
|
||||
|
||||
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||
@PostMapping("/link/list")
|
||||
public TableDataInfo<BizSendOrderPackVo> linkSendOrderList(@RequestBody BizSendOrderBo bo, PageQuery pageQuery) {
|
||||
return bizSendOrderService.linkSendOrderList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||
@PostMapping("/link/mix/list")
|
||||
public R<List<BizPackingSpecsVo>> linkMixSendOrderList(@RequestBody BizSendOrderBo bo, PageQuery pageQuery) {
|
||||
return R.ok(bizSendOrderService.linkMixSendOrderList(bo, pageQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应商创建的发货单列表
|
||||
*/
|
||||
@ -143,4 +159,24 @@ public class BizSendOrderController extends BaseController {
|
||||
bizSendOrderService.transfer(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||
@Log(title = "供应商创建的发货单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/create-mix-order")
|
||||
public R<Void> createMixedOrder(@RequestBody BizSendOrderMixBo bo) {
|
||||
bizSendOrderService.createMixedOrder(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@SaCheckRole(value = {"gongying", "gengdan", "superadmin", "yunying"}, mode = SaMode.OR)
|
||||
@Log(title = "供应商创建的发货单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/create-order-pack")
|
||||
public R<Void> createMixedOrderPackSpecs(@RequestBody BizSendOrderMixPackSpecsBo bo) {
|
||||
bizSendOrderService.createMixedOrderPackSpecs(bo);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
package org.asinkj.amz.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.asinkj.amz.domain.bo.BatchRelDTO;
|
||||
import org.asinkj.amz.domain.bo.BatchSendOrderPlanRelDTO;
|
||||
import org.asinkj.amz.domain.vo.BizSendPlanRelVo;
|
||||
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.BizSendShipmentPlanRelVo;
|
||||
import org.asinkj.amz.domain.bo.BizSendShipmentPlanRelBo;
|
||||
import org.asinkj.amz.service.IBizSendShipmentPlanRelService;
|
||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联
|
||||
* 前端访问路由地址为:/amz/sendShipmentPlanRel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/sendShipmentPlanRel")
|
||||
public class BizSendShipmentPlanRelController extends BaseController {
|
||||
|
||||
private final IBizSendShipmentPlanRelService bizSendShipmentPlanRelService;
|
||||
|
||||
/**
|
||||
* 查询发货单与货运计划多对多关联列表
|
||||
*/
|
||||
@SaCheckPermission("amz:sendShipmentPlanRel:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BizSendPlanRelVo> list(BizSendShipmentPlanRelBo bo, PageQuery pageQuery) {
|
||||
return bizSendShipmentPlanRelService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发货单与货运计划多对多关联列表
|
||||
*/
|
||||
@SaCheckPermission("amz:sendShipmentPlanRel:export")
|
||||
@Log(title = "发货单与货运计划多对多关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BizSendShipmentPlanRelBo bo, HttpServletResponse response) {
|
||||
List<BizSendShipmentPlanRelVo> list = bizSendShipmentPlanRelService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "发货单与货运计划多对多关联", BizSendShipmentPlanRelVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发货单与货运计划多对多关联详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("amz:sendShipmentPlanRel:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BizSendShipmentPlanRelVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(bizSendShipmentPlanRelService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发货单与货运计划多对多关联
|
||||
*/
|
||||
@SaCheckPermission("amz:sendShipmentPlanRel:add")
|
||||
@Log(title = "发货单与货运计划多对多关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BizSendShipmentPlanRelBo bo) {
|
||||
return toAjax(bizSendShipmentPlanRelService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货单与货运计划多对多关联
|
||||
*/
|
||||
@SaCheckPermission("amz:sendShipmentPlanRel:edit")
|
||||
@Log(title = "发货单与货运计划多对多关联", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BizSendShipmentPlanRelBo bo) {
|
||||
return toAjax(bizSendShipmentPlanRelService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发货单与货运计划多对多关联
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("amz:sendShipmentPlanRel:remove")
|
||||
@Log(title = "发货单与货运计划多对多关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(bizSendShipmentPlanRelService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
@PostMapping("/createBatchRelations")
|
||||
public R<Void> createBatchRelations(
|
||||
@Valid @RequestBody BatchSendOrderPlanRelDTO dto) {
|
||||
bizSendShipmentPlanRelService.batchCreateRelations(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/createMixBatchRelations")
|
||||
public R<Void> createMixBatchRelations(
|
||||
@Valid @RequestBody BatchSendOrderPlanRelDTO dto) {
|
||||
bizSendShipmentPlanRelService.createMixBatchRelations(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
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.asinkj.amz.domain.bo.BizStoreUserRelListBo;
|
||||
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.BizStoreUserRelVo;
|
||||
import org.asinkj.amz.domain.bo.BizStoreUserRelBo;
|
||||
import org.asinkj.amz.service.IBizStoreUserRelService;
|
||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户店铺关联
|
||||
* 前端访问路由地址为:/amz/storeUserRel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/storeUserRel")
|
||||
public class BizStoreUserRelController extends BaseController {
|
||||
|
||||
private final IBizStoreUserRelService bizStoreUserRelService;
|
||||
|
||||
/**
|
||||
* 查询用户店铺关联列表
|
||||
*/
|
||||
@SaCheckPermission("amz:storeUserRel:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BizStoreUserRelVo> list(BizStoreUserRelBo bo, PageQuery pageQuery) {
|
||||
return bizStoreUserRelService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户店铺关联列表
|
||||
*/
|
||||
@SaCheckPermission("amz:storeUserRel:export")
|
||||
@Log(title = "用户店铺关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BizStoreUserRelBo bo, HttpServletResponse response) {
|
||||
List<BizStoreUserRelVo> list = bizStoreUserRelService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "用户店铺关联", BizStoreUserRelVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户店铺关联详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("amz:storeUserRel:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BizStoreUserRelVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(bizStoreUserRelService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户店铺关联
|
||||
*/
|
||||
@SaCheckPermission("amz:storeUserRel:add")
|
||||
@Log(title = "用户店铺关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BizStoreUserRelBo bo) {
|
||||
return toAjax(bizStoreUserRelService.insertByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
@SaCheckPermission("amz:storeUserRel:add")
|
||||
@Log(title = "用户店铺关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/updateUsers")
|
||||
public R<Void> updateUsers(@Validated(AddGroup.class) @RequestBody BizStoreUserRelListBo bo) {
|
||||
|
||||
bizStoreUserRelService.updateUsers(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户店铺关联
|
||||
*/
|
||||
@SaCheckPermission("amz:storeUserRel:edit")
|
||||
@Log(title = "用户店铺关联", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BizStoreUserRelBo bo) {
|
||||
return toAjax(bizStoreUserRelService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户店铺关联
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("amz:storeUserRel:remove")
|
||||
@Log(title = "用户店铺关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(bizStoreUserRelService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -104,4 +104,8 @@ public class BizLogisticsOrder extends TenantEntity {
|
||||
@TableField(exist = false)
|
||||
private List<BizLogisticsOrderDetail> details;
|
||||
|
||||
|
||||
private BigDecimal logisticsPrice;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 产品装箱规格对象 biz_packing_specs
|
||||
@ -24,6 +25,7 @@ public class BizPackingSpecs extends TenantEntity {
|
||||
/**
|
||||
* 规格ID(主键)
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@ -39,7 +41,7 @@ public class BizPackingSpecs extends TenantEntity {
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
private Long cartonCount;
|
||||
private BigDecimal cartonCount;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
@ -49,22 +51,22 @@ public class BizPackingSpecs extends TenantEntity {
|
||||
/**
|
||||
* 箱子长度(单位:厘米)
|
||||
*/
|
||||
private Long length;
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 箱子宽度(单位:厘米)
|
||||
*/
|
||||
private Long width;
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 箱子高度(单位:厘米)
|
||||
*/
|
||||
private Long height;
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 单箱重量(单位:千克)
|
||||
*/
|
||||
private Long weight;
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 删除标志(0正常 2删除)
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
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.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 产品装箱规格明细对象 biz_packing_specs_item
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("biz_packing_specs_item")
|
||||
public class BizPackingSpecsItem extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规格ID(主键)
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联箱规明细项ID
|
||||
*/
|
||||
private Long packingSpecsId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
*/
|
||||
private BigDecimal piecesPerCarton;
|
||||
|
||||
/**
|
||||
* 删除标志(0正常 2删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
|
||||
}
|
||||
@ -38,6 +38,10 @@ public class BizSendOrder extends TenantEntity {
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
|
||||
private String completeFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
@ -87,6 +91,14 @@ public class BizSendOrder extends TenantEntity {
|
||||
*/
|
||||
private BigDecimal weightPerBox;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal piecesPerCarton;
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal quantityRelated;
|
||||
|
||||
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
|
||||
@ -65,7 +65,6 @@ public class BizSendOrderItem extends TenantEntity {
|
||||
|
||||
private Long mainOrderSn;
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal ratio;
|
||||
|
||||
private Long transferFromId;
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
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.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联对象 biz_send_shipment_plan_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("biz_send_shipment_plan_rel")
|
||||
public class BizSendShipmentPlanRel extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 发货单ID
|
||||
*/
|
||||
private Long sendOrderId;
|
||||
|
||||
/**
|
||||
* 货运计划ID
|
||||
*/
|
||||
private Long shipmentPlanId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 规格表id
|
||||
*/
|
||||
private Long packId;
|
||||
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
private BigDecimal cartonCount;
|
||||
|
||||
/**
|
||||
* 删除标志(0正常 2删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
|
||||
}
|
||||
@ -141,7 +141,7 @@ public class BizShipmentPlan extends TenantEntity {
|
||||
/**
|
||||
* 总箱子数量
|
||||
*/
|
||||
private Long boxQuantity;
|
||||
private BigDecimal boxQuantity;
|
||||
|
||||
/**
|
||||
* 箱子尺寸
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package org.asinkj.amz.domain;
|
||||
|
||||
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户店铺关联对象 biz_store_user_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("biz_store_user_rel")
|
||||
public class BizStoreUserRel {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private String storeName;
|
||||
|
||||
|
||||
}
|
||||
@ -26,6 +26,7 @@ public class SysStatusHistory extends TenantEntity {
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@TableId(value = "history_id", type = IdType.AUTO)
|
||||
private Long historyId;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderPackVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BatchSendOrderPlanRelDTO {
|
||||
// @NotNull(message = "关联关系不能为空")
|
||||
// private Long sendOrderId23;
|
||||
// @NotEmpty(message = "发货单列表不能为空")
|
||||
private List<BizSendOrderPackVo> sendOrderIds;
|
||||
|
||||
private List<BizPackingSpecsVo> packingSpecs;
|
||||
|
||||
@NotEmpty(message = "货运计划ID列表不能为空")
|
||||
private List<Long> shipmentIds;
|
||||
}
|
||||
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -96,5 +97,7 @@ public class BizLogisticsOrderBo extends BaseEntity {
|
||||
|
||||
private String storeName;
|
||||
|
||||
private BigDecimal logisticsPrice;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import org.asinkj.amz.domain.BizPackingSpecs;
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||
import org.asinkj.common.core.validate.AddGroup;
|
||||
import org.asinkj.common.core.validate.EditGroup;
|
||||
@ -9,6 +10,9 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品装箱规格业务对象 biz_packing_specs
|
||||
*
|
||||
@ -23,26 +27,26 @@ public class BizPackingSpecsBo extends BaseEntity {
|
||||
/**
|
||||
* 规格ID(主键)
|
||||
*/
|
||||
@NotNull(message = "规格ID(主键)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "规格ID(主键)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联采购单明细项ID
|
||||
*/
|
||||
@NotNull(message = "关联采购单明细项ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "关联采购单明细项ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long sendOrderId;
|
||||
|
||||
/**
|
||||
* 规格名称(如规格A)
|
||||
*/
|
||||
@NotBlank(message = "规格名称(如规格A)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "规格名称(如规格A)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String specName;
|
||||
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
@NotNull(message = "箱数(单位:箱)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long cartonCount;
|
||||
private BigDecimal cartonCount;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
@ -54,25 +58,28 @@ public class BizPackingSpecsBo extends BaseEntity {
|
||||
* 箱子长度(单位:厘米)
|
||||
*/
|
||||
@NotNull(message = "箱子长度(单位:厘米)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long length;
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 箱子宽度(单位:厘米)
|
||||
*/
|
||||
@NotNull(message = "箱子宽度(单位:厘米)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long width;
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 箱子高度(单位:厘米)
|
||||
*/
|
||||
@NotNull(message = "箱子高度(单位:厘米)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long height;
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 单箱重量(单位:千克)
|
||||
*/
|
||||
@NotNull(message = "单箱重量(单位:千克)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long weight;
|
||||
private BigDecimal weight;
|
||||
|
||||
|
||||
private List<BizPackingSpecsItemBo> children;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
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.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 产品装箱规格明细业务对象 biz_packing_specs_item
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizPackingSpecsItem.class, reverseConvertGenerate = false)
|
||||
public class BizPackingSpecsItemBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 规格ID(主键)
|
||||
*/
|
||||
// @NotNull(message = "规格ID(主键)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联箱规明细项ID
|
||||
*/
|
||||
// @NotNull(message = "关联箱规明细项ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long packingSpecsId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
@NotBlank(message = "sku不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
*/
|
||||
@NotNull(message = "每箱件数(单位:件)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private BigDecimal piecesPerCarton;
|
||||
|
||||
|
||||
}
|
||||
@ -56,7 +56,7 @@ public class BizSendOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
// @NotBlank(message = "产品名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String productName;
|
||||
|
||||
// @NotBlank(message = "sku不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@ -108,6 +108,8 @@ public class BizSendOrderBo extends BaseEntity {
|
||||
|
||||
private String sendDetail;
|
||||
|
||||
private String completeFlag;
|
||||
|
||||
|
||||
private Long sendId;
|
||||
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.vo.BizPurchaseOutOrderVo;
|
||||
import org.asinkj.common.core.validate.AddGroup;
|
||||
import org.asinkj.common.core.validate.EditGroup;
|
||||
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商创建的发货单业务对象 biz_send_order
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizSendOrder.class, reverseConvertGenerate = false)
|
||||
public class BizSendOrderMixBo extends BaseEntity {
|
||||
|
||||
|
||||
private String storeName;
|
||||
private List<BizPurchaseOutOrderVo> items;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.vo.BizPurchaseOutOrderVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
||||
import org.asinkj.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商创建的发货单业务对象 biz_send_order
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizSendOrder.class, reverseConvertGenerate = false)
|
||||
public class BizSendOrderMixPackSpecsBo extends BaseEntity {
|
||||
|
||||
BizSendOrderBo sendOrder;
|
||||
|
||||
List<BizPackingSpecsBo> items;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import org.asinkj.amz.domain.BizSendShipmentPlanRel;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联业务对象 biz_send_shipment_plan_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizSendShipmentPlanRel.class, reverseConvertGenerate = false)
|
||||
public class BizSendShipmentPlanRelBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@NotNull(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 发货单ID
|
||||
*/
|
||||
@NotNull(message = "发货单ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long sendOrderId;
|
||||
|
||||
/**
|
||||
* 货运计划ID
|
||||
*/
|
||||
@NotNull(message = "货运计划ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long shipmentPlanId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
@NotBlank(message = "sku不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 规格表id
|
||||
*/
|
||||
@NotNull(message = "规格表id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long packId;
|
||||
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
@NotNull(message = "箱数(单位:箱)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long cartonCount;
|
||||
|
||||
|
||||
}
|
||||
@ -163,7 +163,7 @@ public class BizShipmentPlanBo extends BaseEntity {
|
||||
* 总箱子数量
|
||||
*/
|
||||
// @NotNull(message = "总箱子数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long boxQuantity;
|
||||
private BigDecimal boxQuantity;
|
||||
|
||||
/**
|
||||
* 箱子尺寸
|
||||
@ -175,7 +175,7 @@ public class BizShipmentPlanBo extends BaseEntity {
|
||||
* 总的物流商计重(单位:KG,物流商实际测量值)
|
||||
*/
|
||||
// @NotNull(message = "总的物流商计重(单位:KG,物流商实际测量值)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long vendorWeight;
|
||||
private BigDecimal vendorWeight;
|
||||
|
||||
/**
|
||||
* 套数(系统中的申报量)
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import org.asinkj.amz.domain.BizStoreUserRel;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 用户店铺关联业务对象 biz_store_user_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizStoreUserRel.class, reverseConvertGenerate = false)
|
||||
public class BizStoreUserRelBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@NotNull(message = "$column.columnComment不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@NotNull(message = "店铺id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
|
||||
private String storeName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package org.asinkj.amz.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.asinkj.amz.domain.BizStoreUserRel;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* 用户店铺关联业务对象 biz_store_user_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Data
|
||||
public class BizStoreUserRelListBo {
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@NotNull(message = "店铺id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long storeId;
|
||||
|
||||
|
||||
private String storeName;
|
||||
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private List<Long> userId;
|
||||
|
||||
|
||||
}
|
||||
@ -131,7 +131,7 @@ public class BizInquiryRequestVo implements Serializable {
|
||||
|
||||
private String shipmentId;
|
||||
|
||||
private List<BizSendOrder> sendOrders;
|
||||
private List<BizSendOrderVo> sendOrders;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -105,7 +105,7 @@ public class BizLogisticsOrderDetailVo implements Serializable {
|
||||
/**
|
||||
* 实际货件数量(该箱子实际装载的商品数量)
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
// @ExcelProperty(value = "数量")
|
||||
// @ExcelDictFormat(readConverterExp = "该=箱子实际装载的商品数量")
|
||||
private Long shipmentQuantity;
|
||||
|
||||
@ -144,11 +144,11 @@ public class BizLogisticsOrderDetailVo implements Serializable {
|
||||
// @ExcelDictFormat(readConverterExp = "单=位:元/KG,由合同或报价确定")
|
||||
private Long pricePerKg;
|
||||
|
||||
|
||||
@ExcelProperty(value = "宽度")
|
||||
private BigDecimal length;
|
||||
|
||||
@ExcelProperty(value = "长度")
|
||||
private BigDecimal width;
|
||||
|
||||
@ExcelProperty(value = "高度")
|
||||
private BigDecimal height;
|
||||
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
@ -137,6 +137,9 @@ public class BizLogisticsOrderVo implements Serializable {
|
||||
|
||||
private BigDecimal volumeWeight;
|
||||
|
||||
private BigDecimal logisticsPrice;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -118,6 +118,10 @@ public class BizOrderOutItemVo implements Serializable {
|
||||
@ExcelProperty(value = "可转发数量")
|
||||
private BigDecimal quantityCanForward = BigDecimal.ZERO;
|
||||
|
||||
|
||||
private BigDecimal quantityForwardLeft = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 已入库数量
|
||||
*/
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 产品装箱规格明细视图对象 biz_packing_specs_item
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizPackingSpecsItem.class)
|
||||
public class BizPackingSpecsItemVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规格ID(主键)
|
||||
*/
|
||||
@ExcelProperty(value = "规格ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "主=键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联箱规明细项ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联箱规明细项ID")
|
||||
private Long packingSpecsId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
@ExcelProperty(value = "sku")
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ExcelProperty(value = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
*/
|
||||
@ExcelProperty(value = "每箱件数", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:件")
|
||||
private BigDecimal piecesPerCarton;
|
||||
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package org.asinkj.amz.domain.vo;
|
||||
import org.asinkj.amz.domain.BizPackingSpecs;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
@ -10,8 +11,9 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -53,7 +55,7 @@ public class BizPackingSpecsVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "箱数", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:箱")
|
||||
private Long cartonCount;
|
||||
private BigDecimal cartonCount;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
@ -67,28 +69,40 @@ public class BizPackingSpecsVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "箱子长度", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:厘米")
|
||||
private Long length;
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 箱子宽度(单位:厘米)
|
||||
*/
|
||||
@ExcelProperty(value = "箱子宽度", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:厘米")
|
||||
private Long width;
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 箱子高度(单位:厘米)
|
||||
*/
|
||||
@ExcelProperty(value = "箱子高度", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:厘米")
|
||||
private Long height;
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 单箱重量(单位:千克)
|
||||
*/
|
||||
@ExcelProperty(value = "单箱重量", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:千克")
|
||||
private Long weight;
|
||||
private BigDecimal weight;
|
||||
|
||||
private BizSendOrderVo sendOrder;
|
||||
|
||||
|
||||
private List<BizPackingSpecsItemVo> items;
|
||||
|
||||
|
||||
private BigDecimal linkCount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal linkCartonCount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal leftLinkCount = BigDecimal.ZERO;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -112,6 +112,10 @@ public class BizPurchaseOutOrderVo implements Serializable {
|
||||
@ExcelProperty(value = "剩余数量")
|
||||
private BigDecimal quantityLeft;
|
||||
|
||||
private BigDecimal canSendLeft;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 实收数量
|
||||
*/
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.asinkj.amz.domain.BizSendOrderItem;
|
||||
@ -13,7 +14,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -64,10 +65,14 @@ public class BizSendOrderItemVo implements Serializable {
|
||||
* 发货日期
|
||||
*/
|
||||
@ExcelProperty(value = "发货日期")
|
||||
private Long quantitySend;
|
||||
private BigDecimal quantitySend;
|
||||
|
||||
|
||||
private String sku;
|
||||
|
||||
private BigDecimal ratio;
|
||||
|
||||
private List<BizOrderOutItemVo> items;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,207 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.asinkj.amz.domain.BizLogisticsOrder;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.BizSendOrderItem;
|
||||
import org.asinkj.amz.domain.BizShipmentPlan;
|
||||
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 供应商创建的发货单视图对象 biz_send_order
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizSendOrder.class)
|
||||
public class BizSendOrderPackVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long pkid;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
@ExcelProperty(value = "采购单号")
|
||||
private String orderSn;
|
||||
|
||||
private Long orderDetailId;
|
||||
|
||||
|
||||
/**
|
||||
* 发货日期
|
||||
*/
|
||||
@ExcelProperty(value = "发货日期")
|
||||
private Date sendDate;
|
||||
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 采购店铺
|
||||
*/
|
||||
@ExcelProperty(value = "采购店铺")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ExcelProperty(value = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
@ExcelProperty(value = "发货数量")
|
||||
private BigDecimal quantitySend;
|
||||
|
||||
/**
|
||||
* 单箱产品数量
|
||||
*/
|
||||
@ExcelProperty(value = "单箱产品数量")
|
||||
private Long quantityPerBox;
|
||||
|
||||
/**
|
||||
* 箱数
|
||||
*/
|
||||
@ExcelProperty(value = "箱数")
|
||||
private Long boxCount;
|
||||
|
||||
/**
|
||||
* 箱子尺寸
|
||||
*/
|
||||
@ExcelProperty(value = "箱子尺寸")
|
||||
private String boxDimensions;
|
||||
|
||||
/**
|
||||
* 单箱重量
|
||||
*/
|
||||
@ExcelProperty(value = "单箱重量")
|
||||
private BigDecimal weightPerBox;
|
||||
|
||||
/**
|
||||
* 实际采购店铺
|
||||
*/
|
||||
@ExcelProperty(value = "实际采购店铺")
|
||||
private String realStoreName;
|
||||
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 发货状态(pending=未发货,confirm=确认发货, processing=发货中,completed=发货完成)
|
||||
*/
|
||||
@ExcelProperty(value = "发货状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "send_status")
|
||||
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;
|
||||
|
||||
private List<BizShipmentPlan> bizShipmentPlans;
|
||||
|
||||
private List<BizSendOrderItem> items;
|
||||
|
||||
private String type;
|
||||
|
||||
private String createName;
|
||||
|
||||
private Long transferFromId;
|
||||
|
||||
|
||||
@ExcelProperty(value = "规格名称", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "如=规格A")
|
||||
private String specName;
|
||||
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
@ExcelProperty(value = "箱数", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:箱")
|
||||
private BigDecimal cartonCount;
|
||||
|
||||
/**
|
||||
* 每箱件数(单位:件)
|
||||
*/
|
||||
@ExcelProperty(value = "每箱件数", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:件")
|
||||
private BigDecimal piecesPerCarton;
|
||||
|
||||
/**
|
||||
* 箱子长度(单位:厘米)
|
||||
*/
|
||||
@ExcelProperty(value = "箱子长度", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:厘米")
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 箱子宽度(单位:厘米)
|
||||
*/
|
||||
@ExcelProperty(value = "箱子宽度", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:厘米")
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 箱子高度(单位:厘米)
|
||||
*/
|
||||
@ExcelProperty(value = "箱子高度", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:厘米")
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 单箱重量(单位:千克)
|
||||
*/
|
||||
@ExcelProperty(value = "单箱重量", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:千克")
|
||||
private BigDecimal weight;
|
||||
|
||||
// 关联的箱数
|
||||
private BigDecimal linkCartonCount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal leftLinkCount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal linkCount = BigDecimal.ZERO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.asinkj.common.tenant.core.TenantEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 供应商创建的发货单对象 biz_send_order
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("biz_send_order")
|
||||
public class BizSendOrderPlanVo extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0正常 2删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
|
||||
private String completeFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
private String orderSn;
|
||||
|
||||
|
||||
private Long orderDetailId;
|
||||
|
||||
|
||||
/**
|
||||
* 发货日期
|
||||
*/
|
||||
private Date sendDate;
|
||||
|
||||
/**
|
||||
* 采购店铺
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
private BigDecimal quantitySend;
|
||||
|
||||
/**
|
||||
* 单箱产品数量
|
||||
*/
|
||||
private Long quantityPerBox;
|
||||
|
||||
/**
|
||||
* 箱数
|
||||
*/
|
||||
private Long boxCount;
|
||||
|
||||
/**
|
||||
* 箱子尺寸
|
||||
*/
|
||||
private String boxDimensions;
|
||||
|
||||
/**
|
||||
* 单箱重量
|
||||
*/
|
||||
private BigDecimal weightPerBox;
|
||||
|
||||
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 实际采购店铺
|
||||
*/
|
||||
private String realStoreName;
|
||||
|
||||
/**
|
||||
* 发货状态(pending=未发货,confirm=确认发货, processing=发货中,completed=发货完成)
|
||||
*/
|
||||
private String sendStatus;
|
||||
|
||||
private Long sendId;
|
||||
|
||||
private String sendName;
|
||||
|
||||
|
||||
private String sendDetail;
|
||||
|
||||
private String logisticsProviderName;
|
||||
|
||||
private Long logisticsProviderId;
|
||||
|
||||
private String shipmentId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String shipmentIdKey;
|
||||
|
||||
private String type;
|
||||
|
||||
private String createName;
|
||||
|
||||
private Long transferFromId;
|
||||
|
||||
private BigDecimal piecesPerCarton;
|
||||
|
||||
|
||||
}
|
||||
@ -3,12 +3,9 @@ package org.asinkj.amz.domain.vo;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import org.asinkj.amz.domain.BizLogisticsOrder;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.*;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.asinkj.amz.domain.BizSendOrderItem;
|
||||
import org.asinkj.amz.domain.BizShipmentPlan;
|
||||
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
@ -63,6 +60,9 @@ public class BizSendOrderVo implements Serializable {
|
||||
@ExcelProperty(value = "采购店铺")
|
||||
private String storeName;
|
||||
|
||||
private String completeFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ -73,7 +73,13 @@ public class BizSendOrderVo implements Serializable {
|
||||
* 发货数量
|
||||
*/
|
||||
@ExcelProperty(value = "发货数量")
|
||||
private BigDecimal quantitySend;
|
||||
private BigDecimal quantitySend = BigDecimal.ZERO;
|
||||
|
||||
@ExcelProperty(value = "关联数量")
|
||||
private BigDecimal quantityLink = BigDecimal.ZERO;
|
||||
|
||||
@ExcelProperty(value = "剩余数量")
|
||||
private BigDecimal quantityLeft = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 单箱产品数量
|
||||
@ -134,7 +140,10 @@ public class BizSendOrderVo implements Serializable {
|
||||
|
||||
private List<BizShipmentPlan> bizShipmentPlans;
|
||||
|
||||
private List<BizSendOrderItem> items;
|
||||
private List<BizSendOrderItemVo> items;
|
||||
|
||||
|
||||
private List<BizSendPlanRelVo> sendPlansRelVos;
|
||||
|
||||
private String type;
|
||||
|
||||
@ -143,5 +152,7 @@ public class BizSendOrderVo implements Serializable {
|
||||
private Long transferFromId;
|
||||
|
||||
|
||||
private List<BizPackingSpecsVo> packingSpecs;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,110 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
import org.asinkj.amz.domain.BizSendShipmentPlanRel;
|
||||
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联视图对象 biz_send_shipment_plan_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizSendShipmentPlanRel.class)
|
||||
public class BizSendPlanRelVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* bso.order_sn,
|
||||
* bso.product_name,
|
||||
* bsspr.sku,
|
||||
* bps.length,
|
||||
* bps.width,
|
||||
* bps.height,
|
||||
* bps.weight,
|
||||
* bsspr.carton_count
|
||||
*/
|
||||
// @ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||
// @ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||
// private Long id;
|
||||
/**
|
||||
* 发货单ID
|
||||
*/
|
||||
private Long sendOrderId;
|
||||
private Long shipmentPlanId;
|
||||
|
||||
private Long packId;
|
||||
|
||||
|
||||
private String logisticsProviderName;
|
||||
|
||||
private String address;
|
||||
|
||||
|
||||
@ExcelProperty(value = "订单号")
|
||||
private String orderSn;
|
||||
|
||||
@ExcelProperty(value = "FBA货件号")
|
||||
private String shipmentId;
|
||||
|
||||
/**
|
||||
* 货运计划ID
|
||||
*/
|
||||
@ExcelProperty(value = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
@ExcelProperty(value = "sku")
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 规格表id
|
||||
*/
|
||||
@ExcelProperty(value = "长")
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
@ExcelProperty(value = "宽")
|
||||
private BigDecimal width;
|
||||
|
||||
@ExcelProperty(value = "高")
|
||||
private BigDecimal height;
|
||||
|
||||
@ExcelProperty(value = "单箱重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
|
||||
@ExcelProperty(value = "箱数")
|
||||
private BigDecimal cartonCount = BigDecimal.ZERO;
|
||||
|
||||
@ExcelProperty(value = "单箱数量")
|
||||
private BigDecimal piecesPerCarton = BigDecimal.ZERO;
|
||||
|
||||
|
||||
@ExcelProperty(value = "时间")
|
||||
private Date createTime;
|
||||
|
||||
private List<BizPackingSpecsItemVo> items;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import org.asinkj.amz.domain.BizSendShipmentPlanRel;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联视图对象 biz_send_shipment_plan_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizSendShipmentPlanRel.class)
|
||||
public class BizSendShipmentPlanRelVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 发货单ID
|
||||
*/
|
||||
@ExcelProperty(value = "发货单ID")
|
||||
private Long sendOrderId;
|
||||
|
||||
/**
|
||||
* 货运计划ID
|
||||
*/
|
||||
@ExcelProperty(value = "货运计划ID")
|
||||
private Long shipmentPlanId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
@ExcelProperty(value = "sku")
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 规格表id
|
||||
*/
|
||||
@ExcelProperty(value = "规格表id")
|
||||
private Long packId;
|
||||
|
||||
/**
|
||||
* 箱数(单位:箱)
|
||||
*/
|
||||
@ExcelProperty(value = "箱数", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位:箱")
|
||||
private Long cartonCount;
|
||||
|
||||
|
||||
}
|
||||
@ -176,13 +176,28 @@ public class BizShipmentPlanVo implements Serializable {
|
||||
* 总箱子数量
|
||||
*/
|
||||
@ExcelProperty(value = "总箱子数量")
|
||||
private Long boxQuantity;
|
||||
private BigDecimal boxQuantity = BigDecimal.ZERO;
|
||||
|
||||
|
||||
@ExcelProperty(value = "关联箱子数量")
|
||||
private BigDecimal boxQuantityLink = BigDecimal.ZERO;
|
||||
|
||||
|
||||
@ExcelProperty(value = "剩余箱子数量")
|
||||
private BigDecimal boxQuantityLeft = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
@ExcelProperty(value = "发货数量")
|
||||
private BigDecimal quantityShipped;
|
||||
private BigDecimal quantityShipped = BigDecimal.ZERO;
|
||||
|
||||
@ExcelProperty(value = "关联数量")
|
||||
private BigDecimal quantityLink = BigDecimal.ZERO;
|
||||
|
||||
@ExcelProperty(value = "剩余数量")
|
||||
private BigDecimal quantityLeft = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 箱子尺寸
|
||||
@ -226,13 +241,15 @@ public class BizShipmentPlanVo implements Serializable {
|
||||
private Long sendOrderId;
|
||||
|
||||
private BizSendOrder sendOrder;
|
||||
private List<BizSendOrder> sendOrders;
|
||||
private List<BizSendOrderVo> sendOrders;
|
||||
|
||||
private BizLogisticsQuote quote;
|
||||
|
||||
|
||||
private List<BizShipmentItem> itemVoList;
|
||||
|
||||
private List<BizSendPlanRelVo> sendPlansRelVos;
|
||||
|
||||
|
||||
// 显式添加 Setter(即使使用 @Data)
|
||||
public void setShipFromAddress(FbaShipmentApiResponse.Address shipFromAddress) {
|
||||
|
||||
@ -0,0 +1,59 @@
|
||||
package org.asinkj.amz.domain.vo;
|
||||
|
||||
import org.asinkj.amz.domain.BizStoreUserRel;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.asinkj.amz.domain.SysUser;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用户店铺关联视图对象 biz_store_user_rel
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizStoreUserRel.class)
|
||||
public class BizStoreUserRelVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@ExcelProperty(value = "店铺id")
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
|
||||
private String storeName;
|
||||
|
||||
|
||||
private SysUser user;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package org.asinkj.amz.domain.vo;
|
||||
import org.asinkj.amz.domain.SysAmazonStore;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.asinkj.amz.domain.SysUser;
|
||||
import org.asinkj.common.excel.annotation.ExcelDictFormat;
|
||||
import org.asinkj.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
@ -11,7 +12,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -113,5 +114,9 @@ public class SysAmazonStoreVo implements Serializable {
|
||||
|
||||
private String nickName;
|
||||
|
||||
private List<SysUser> users;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package org.asinkj.amz.mapper;
|
||||
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsItemVo;
|
||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
/**
|
||||
* 产品装箱规格明细Mapper接口
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizPackingSpecsItemMapper extends BaseMapperPlus<BizPackingSpecsItem, BizPackingSpecsItemVo> {
|
||||
|
||||
}
|
||||
@ -1,7 +1,13 @@
|
||||
package org.asinkj.amz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.asinkj.amz.domain.BizPurchaseOrder;
|
||||
import org.asinkj.amz.domain.BizPurchaseOutOrder;
|
||||
import org.asinkj.amz.domain.vo.BizPurchaseOrderVo;
|
||||
import org.asinkj.amz.domain.vo.BizPurchaseOutOrderVo;
|
||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -14,4 +20,8 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public interface BizPurchaseOrderMapper extends BaseMapperPlus<BizPurchaseOrder, BizPurchaseOrderVo> {
|
||||
|
||||
Page<BizPurchaseOrderVo> selectCustomPage(
|
||||
@Param("page") Page<BizPurchaseOrder> page,
|
||||
@Param(Constants.WRAPPER) Wrapper<BizPurchaseOrder> wrapper
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import org.asinkj.amz.domain.BizInquiryRequest;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.OrderWithShipment;
|
||||
import org.asinkj.amz.domain.vo.BizInquiryRequestVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderPackVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
@ -29,7 +30,15 @@ public interface BizSendOrderMapper extends BaseMapperPlus<BizSendOrder, BizSend
|
||||
|
||||
|
||||
Page<BizSendOrderVo> selectCustomPage(
|
||||
@Param("page") Page<BizInquiryRequestVo> page,
|
||||
@Param(Constants.WRAPPER) Wrapper<BizSendOrder> wrapper,
|
||||
@Param("finish") Boolean finish
|
||||
);
|
||||
|
||||
Page<BizSendOrderPackVo> selectCustomPackPage(
|
||||
@Param("page") Page<BizInquiryRequestVo> page,
|
||||
@Param(Constants.WRAPPER) Wrapper<BizSendOrder> wrapper
|
||||
);
|
||||
|
||||
List<BizSendOrderPackVo> selectLinkMixSendOrderList(List<String> skus, List<String> storeNames);
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package org.asinkj.amz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.BizSendShipmentPlanRel;
|
||||
import org.asinkj.amz.domain.vo.BizInquiryRequestVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendPlanRelVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendShipmentPlanRelVo;
|
||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联Mapper接口
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizSendShipmentPlanRelMapper extends BaseMapperPlus<BizSendShipmentPlanRel, BizSendShipmentPlanRelVo> {
|
||||
|
||||
|
||||
|
||||
Page<BizSendPlanRelVo> selectCustomPage(
|
||||
@Param("page") Page<BizSendPlanRelVo> page,
|
||||
@Param(Constants.WRAPPER) Wrapper<BizSendShipmentPlanRel> wrapper
|
||||
);
|
||||
|
||||
List<BizSendPlanRelVo> querySendPlanRelVo(@Param("sendIds")Set<Long> sendIds);
|
||||
|
||||
List<BizSendPlanRelVo> querySendOrderPlanRelVo(@Param("planIds")Set<Long> planIds);
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package org.asinkj.amz.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.asinkj.amz.domain.BizStoreUserRel;
|
||||
import org.asinkj.amz.domain.vo.BizStoreUserRelVo;
|
||||
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户店铺关联Mapper接口
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizStoreUserRelMapper extends BaseMapperPlus<BizStoreUserRel, BizStoreUserRelVo> {
|
||||
|
||||
List<BizStoreUserRelVo> selectCustom(@Param("storeIds") List<Long> storeIds);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.asinkj.amz.service;
|
||||
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsItemVo;
|
||||
import org.asinkj.amz.domain.bo.BizPackingSpecsItemBo;
|
||||
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-09-09
|
||||
*/
|
||||
public interface IBizPackingSpecsItemService {
|
||||
|
||||
/**
|
||||
* 查询产品装箱规格明细
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 产品装箱规格明细
|
||||
*/
|
||||
BizPackingSpecsItemVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询产品装箱规格明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 产品装箱规格明细分页列表
|
||||
*/
|
||||
TableDataInfo<BizPackingSpecsItemVo> queryPageList(BizPackingSpecsItemBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的产品装箱规格明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 产品装箱规格明细列表
|
||||
*/
|
||||
List<BizPackingSpecsItemVo> queryList(BizPackingSpecsItemBo bo);
|
||||
|
||||
/**
|
||||
* 新增产品装箱规格明细
|
||||
*
|
||||
* @param bo 产品装箱规格明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BizPackingSpecsItemBo bo);
|
||||
|
||||
/**
|
||||
* 修改产品装箱规格明细
|
||||
*
|
||||
* @param bo 产品装箱规格明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BizPackingSpecsItemBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除产品装箱规格明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -1,6 +1,10 @@
|
||||
package org.asinkj.amz.service;
|
||||
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.bo.BizSendOrderMixBo;
|
||||
import org.asinkj.amz.domain.bo.BizSendOrderMixPackSpecsBo;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderPackVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
||||
import org.asinkj.amz.domain.bo.BizSendOrderBo;
|
||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||
@ -79,4 +83,12 @@ public interface IBizSendOrderService {
|
||||
TableDataInfo<BizSendOrderVo> coverSendOrder(BizSendOrderBo bo, PageQuery pageQuery);
|
||||
|
||||
void transfer(BizSendOrderVo bo);
|
||||
|
||||
TableDataInfo<BizSendOrderPackVo> linkSendOrderList(BizSendOrderBo bo, PageQuery pageQuery);
|
||||
|
||||
void createMixedOrder(BizSendOrderMixBo bo);
|
||||
|
||||
void createMixedOrderPackSpecs(BizSendOrderMixPackSpecsBo bo);
|
||||
|
||||
List<BizPackingSpecsVo> linkMixSendOrderList(BizSendOrderBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package org.asinkj.amz.service;
|
||||
|
||||
import org.asinkj.amz.domain.BizSendShipmentPlanRel;
|
||||
import org.asinkj.amz.domain.bo.BatchSendOrderPlanRelDTO;
|
||||
import org.asinkj.amz.domain.vo.BizSendPlanRelVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendShipmentPlanRelVo;
|
||||
import org.asinkj.amz.domain.bo.BizSendShipmentPlanRelBo;
|
||||
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-08-30
|
||||
*/
|
||||
public interface IBizSendShipmentPlanRelService {
|
||||
|
||||
/**
|
||||
* 查询发货单与货运计划多对多关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 发货单与货运计划多对多关联
|
||||
*/
|
||||
BizSendShipmentPlanRelVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询发货单与货运计划多对多关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 发货单与货运计划多对多关联分页列表
|
||||
*/
|
||||
TableDataInfo<BizSendPlanRelVo> queryPageList(BizSendShipmentPlanRelBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的发货单与货运计划多对多关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 发货单与货运计划多对多关联列表
|
||||
*/
|
||||
List<BizSendShipmentPlanRelVo> queryList(BizSendShipmentPlanRelBo bo);
|
||||
|
||||
/**
|
||||
* 新增发货单与货运计划多对多关联
|
||||
*
|
||||
* @param bo 发货单与货运计划多对多关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BizSendShipmentPlanRelBo bo);
|
||||
|
||||
/**
|
||||
* 修改发货单与货运计划多对多关联
|
||||
*
|
||||
* @param bo 发货单与货运计划多对多关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BizSendShipmentPlanRelBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除发货单与货运计划多对多关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
void batchCreateRelations(BatchSendOrderPlanRelDTO dto);
|
||||
|
||||
void createMixBatchRelations(BatchSendOrderPlanRelDTO dto);
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package org.asinkj.amz.service;
|
||||
|
||||
import org.asinkj.amz.domain.BizStoreUserRel;
|
||||
import org.asinkj.amz.domain.bo.BizStoreUserRelListBo;
|
||||
import org.asinkj.amz.domain.vo.BizStoreUserRelVo;
|
||||
import org.asinkj.amz.domain.bo.BizStoreUserRelBo;
|
||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||
import org.asinkj.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 用户店铺关联Service接口
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface IBizStoreUserRelService {
|
||||
|
||||
/**
|
||||
* 查询用户店铺关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 用户店铺关联
|
||||
*/
|
||||
BizStoreUserRelVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询用户店铺关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 用户店铺关联分页列表
|
||||
*/
|
||||
TableDataInfo<BizStoreUserRelVo> queryPageList(BizStoreUserRelBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的用户店铺关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 用户店铺关联列表
|
||||
*/
|
||||
List<BizStoreUserRelVo> queryList(BizStoreUserRelBo bo);
|
||||
|
||||
/**
|
||||
* 新增用户店铺关联
|
||||
*
|
||||
* @param bo 用户店铺关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BizStoreUserRelBo bo);
|
||||
|
||||
/**
|
||||
* 修改用户店铺关联
|
||||
*
|
||||
* @param bo 用户店铺关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BizStoreUserRelBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除用户店铺关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
void updateUsers(BizStoreUserRelListBo bo);
|
||||
|
||||
Set<String> queryStoreName(Long userId);
|
||||
}
|
||||
@ -8,11 +8,11 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.asinkj.amz.domain.BizLogisticsQuote;
|
||||
import org.asinkj.amz.domain.BizSendOrder;
|
||||
import org.asinkj.amz.domain.vo.BizLogisticsChannelVo;
|
||||
import org.asinkj.amz.domain.vo.InquiryRequestItemVo;
|
||||
import org.asinkj.amz.domain.*;
|
||||
import org.asinkj.amz.domain.vo.*;
|
||||
import org.asinkj.amz.mapper.BizLogisticsQuoteMapper;
|
||||
import org.asinkj.amz.mapper.BizPackingSpecsItemMapper;
|
||||
import org.asinkj.amz.mapper.BizPackingSpecsMapper;
|
||||
import org.asinkj.amz.service.IBizInquiryBlacklistService;
|
||||
import org.asinkj.amz.service.IBizLogisticsChannelService;
|
||||
import org.asinkj.amz.service.IBizShipmentPlanService;
|
||||
@ -34,8 +34,6 @@ import org.asinkj.utils.SerialNoGenerator;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.asinkj.amz.domain.bo.BizInquiryRequestBo;
|
||||
import org.asinkj.amz.domain.vo.BizInquiryRequestVo;
|
||||
import org.asinkj.amz.domain.BizInquiryRequest;
|
||||
import org.asinkj.amz.mapper.BizInquiryRequestMapper;
|
||||
import org.asinkj.amz.service.IBizInquiryRequestService;
|
||||
|
||||
@ -92,6 +90,12 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
||||
@Resource
|
||||
private IBizShipmentPlanService shipmentPlanService;
|
||||
|
||||
@Resource
|
||||
private BizPackingSpecsMapper bizPackingSpecsMapper;
|
||||
|
||||
@Resource
|
||||
private BizPackingSpecsItemMapper bizPackingSpecsItemMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询物流询价
|
||||
@ -120,7 +124,9 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
||||
String sqlSegment = lqw.getSqlSegment();
|
||||
log.info("sqlSegment: {}", sqlSegment);
|
||||
Page<BizInquiryRequestVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
|
||||
|
||||
if (CollectionUtil.isEmpty(result.getRecords())) {
|
||||
return TableDataInfo.build();
|
||||
}
|
||||
List<String> shipmentIds = result.getRecords().stream()
|
||||
.map(BizInquiryRequestVo::getShipmentId)
|
||||
.filter(Objects::nonNull)
|
||||
@ -129,13 +135,48 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
|
||||
|
||||
// 3. 单个查询获取所有发货单数据(按 shipmentId 分组)
|
||||
List<BizSendOrder> bizSendOrders = shipmentPlanService.batchGetSendOrdersByShipmentIds(shipmentIds);
|
||||
Set<Long> mixIds = bizSendOrders.stream().filter(c -> "mix".equals(c.getType())).map(BizSendOrder::getId).collect(Collectors.toSet());
|
||||
|
||||
Map<Long, List<BizPackingSpecs>> bizPackingSpecsMap = new HashMap<>();
|
||||
Map<Long, List<BizPackingSpecsItem>> bizPackingSpecsItemMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(mixIds)) {
|
||||
List<BizPackingSpecs> bizPackingSpecs = bizPackingSpecsMapper.selectList(new LambdaQueryWrapper<BizPackingSpecs>().in(BizPackingSpecs::getSendOrderId, mixIds));
|
||||
bizPackingSpecsMap = bizPackingSpecs.stream().collect(Collectors.groupingBy(BizPackingSpecs::getSendOrderId));
|
||||
Set<Long> packSpecsIds = bizPackingSpecs.stream().map(BizPackingSpecs::getId).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isNotEmpty(packSpecsIds)) {
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems = bizPackingSpecsItemMapper.selectList(new LambdaQueryWrapper<BizPackingSpecsItem>().in(BizPackingSpecsItem::getPackingSpecsId, packSpecsIds));
|
||||
|
||||
bizPackingSpecsItemMap = bizPackingSpecsItems.stream().collect(Collectors.groupingBy(BizPackingSpecsItem::getPackingSpecsId));
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(bizSendOrders)) {
|
||||
Map<String, List<BizSendOrder>> ordersMap = bizSendOrders.stream().collect(Collectors.groupingBy(BizSendOrder::getShipmentIdKey));
|
||||
// 4. 组装发货单数据到结果对象
|
||||
|
||||
for (BizInquiryRequestVo record : result.getRecords()) {
|
||||
// if ("weight".equals(record.getType())) {
|
||||
record.setSendOrders(ordersMap.getOrDefault(record.getShipmentId(), Collections.emptyList()));
|
||||
List<BizSendOrder> orDefault = ordersMap.getOrDefault(record.getShipmentId(), Collections.emptyList());
|
||||
if (CollectionUtil.isNotEmpty(orDefault)) {
|
||||
List<BizSendOrderVo> convert = MapstructUtils.convert(orDefault, BizSendOrderVo.class);
|
||||
for (BizSendOrderVo bizSendOrderVo : convert) {
|
||||
|
||||
if ("mix".equals(bizSendOrderVo.getType())) {
|
||||
List<BizPackingSpecs> bizPackingSpecs1 = bizPackingSpecsMap.get(bizSendOrderVo.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizPackingSpecs1)) {
|
||||
List<BizPackingSpecsVo> convertPackList = MapstructUtils.convert(bizPackingSpecs1, BizPackingSpecsVo.class);
|
||||
bizSendOrderVo.setPackingSpecs(convertPackList);
|
||||
assert convertPackList != null;
|
||||
for (BizPackingSpecsVo bizPackingSpecsVo : convertPackList) {
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems1 = bizPackingSpecsItemMap.get(bizPackingSpecsVo.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizPackingSpecsItems1)) {
|
||||
bizPackingSpecsVo.setItems(MapstructUtils.convert(bizPackingSpecsItems1, BizPackingSpecsItemVo.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
record.setSendOrders(convert);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,6 +214,28 @@ public class BizLogisticsOrderDetailServiceImpl implements IBizLogisticsOrderDet
|
||||
checkData(bizLogisticsOrderDetailVos);
|
||||
log.info("导入数据条数:{}", JSONObject.toJSONString(bizLogisticsOrderDetailVos));
|
||||
|
||||
for (BizLogisticsOrderDetailVo item : bizLogisticsOrderDetailVos) {
|
||||
item.setTotalVolume(item.getLength().multiply(item.getWidth()).multiply(item.getHeight()));
|
||||
if ("BOOKED".equals(item.getLogisticsStatus())){
|
||||
// item.setCarrierConfirmTime(DateUtil.date());
|
||||
}else if ("PICKED_UP".equals(item.getLogisticsStatus())){
|
||||
item.setGoodsReceiptTime(DateUtil.date());
|
||||
}else if ("IN_TRANSIT".equals(item.getLogisticsStatus())){
|
||||
item.setTransferStartTime(DateUtil.date());
|
||||
}else if ("DELIVERED".equals(item.getLogisticsStatus())){
|
||||
item.setSignedTime(DateUtil.date());
|
||||
}else if ("SCHEDULING".equals(item.getLogisticsStatus())){
|
||||
item.setScheduleTime(DateUtil.date());
|
||||
}else if ("VESSEL_DEPARTED".equals(item.getLogisticsStatus())){
|
||||
item.setVesselDepartTime(DateUtil.date());
|
||||
}else if ("PORT_ARRIVED".equals(item.getLogisticsStatus())){
|
||||
item.setPortArrivalTime(DateUtil.date());
|
||||
}else if ("CUSTOMS_CLEARANCE".equals(item.getLogisticsStatus())){
|
||||
item.setInspectionTime(DateUtil.date());
|
||||
}else if ("CARGO_RELEASED".equals(item.getLogisticsStatus())){
|
||||
item.setDeliveryPickupTime(DateUtil.date());
|
||||
}
|
||||
}
|
||||
baseMapper.updateByBoxId(bizLogisticsOrderDetailVos);
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.asinkj.amz.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -146,7 +147,7 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
||||
BigDecimal totalVolume = bizLogisticsOrderDetails1.stream().filter(item -> item.getTotalVolume() != null).map(BizLogisticsOrderDetail::getTotalVolume).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
record.setTotalVolume(totalVolume);
|
||||
BigDecimal divide = record.getTotalVolume().divide(record.getQuote().getVolumeRatio(),3, RoundingMode.HALF_UP);
|
||||
BigDecimal divide = record.getTotalVolume().divide(record.getQuote().getVolumeRatio(), 3, RoundingMode.HALF_UP);
|
||||
record.setVolumeWeight(divide);
|
||||
if ("weight".equals(record.getQuote().getType())) {
|
||||
record.setSettlementPrice(record.getQuote().getPrice().multiply(divide.max(record.getLogisticsWeight())).add(record.getQuote().getSurcharge()).add(record.getQuote().getCustomsDeclarationFee()));
|
||||
@ -185,7 +186,7 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
|
||||
lqw.eq(bo.getShipmentQuantity() != null, BizLogisticsOrder::getShipmentQuantity, bo.getShipmentQuantity());
|
||||
lqw.eq(bo.getAmazonShelfDate() != null, BizLogisticsOrder::getAmazonShelfDate, bo.getAmazonShelfDate());
|
||||
lqw.eq(bo.getShelfTimeliness() != null, BizLogisticsOrder::getShelfTimeliness, bo.getShelfTimeliness());
|
||||
if (!LoginHelper.isSuperAdmin() && !LoginHelper.isManagerAdmin()) {
|
||||
if (!LoginHelper.isSuperAdmin() && !LoginHelper.isManagerAdmin() && !StpUtil.hasRole("gengdan")) {
|
||||
lqw.and(wrapper -> wrapper.eq(BizLogisticsOrder::getCreateBy, LoginHelper.getUserId()).or().eq(BizLogisticsOrder::getLogisticsProviderId, LoginHelper.getUserId()));
|
||||
}
|
||||
// Set<Long> roleIdSet = LoginHelper.getLoginUser().getRoles().stream().map(RoleDTO::getRoleId).collect(Collectors.toSet());
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
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.BizPackingSpecsItemBo;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsItemVo;
|
||||
import org.asinkj.amz.domain.BizPackingSpecsItem;
|
||||
import org.asinkj.amz.mapper.BizPackingSpecsItemMapper;
|
||||
import org.asinkj.amz.service.IBizPackingSpecsItemService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 产品装箱规格明细Service业务层处理
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BizPackingSpecsItemServiceImpl implements IBizPackingSpecsItemService {
|
||||
|
||||
private final BizPackingSpecsItemMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询产品装箱规格明细
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 产品装箱规格明细
|
||||
*/
|
||||
@Override
|
||||
public BizPackingSpecsItemVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询产品装箱规格明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 产品装箱规格明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BizPackingSpecsItemVo> queryPageList(BizPackingSpecsItemBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizPackingSpecsItem> lqw = buildQueryWrapper(bo);
|
||||
Page<BizPackingSpecsItemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的产品装箱规格明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 产品装箱规格明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<BizPackingSpecsItemVo> queryList(BizPackingSpecsItemBo bo) {
|
||||
LambdaQueryWrapper<BizPackingSpecsItem> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizPackingSpecsItem> buildQueryWrapper(BizPackingSpecsItemBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BizPackingSpecsItem> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getPackingSpecsId() != null, BizPackingSpecsItem::getPackingSpecsId, bo.getPackingSpecsId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSku()), BizPackingSpecsItem::getSku, bo.getSku());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductName()), BizPackingSpecsItem::getProductName, bo.getProductName());
|
||||
lqw.eq(bo.getPiecesPerCarton() != null, BizPackingSpecsItem::getPiecesPerCarton, bo.getPiecesPerCarton());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品装箱规格明细
|
||||
*
|
||||
* @param bo 产品装箱规格明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BizPackingSpecsItemBo bo) {
|
||||
BizPackingSpecsItem add = MapstructUtils.convert(bo, BizPackingSpecsItem.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品装箱规格明细
|
||||
*
|
||||
* @param bo 产品装箱规格明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BizPackingSpecsItemBo bo) {
|
||||
BizPackingSpecsItem update = MapstructUtils.convert(bo, BizPackingSpecsItem.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BizPackingSpecsItem entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除产品装箱规格明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,7 @@ import org.asinkj.amz.domain.vo.BizPurchaseOrderItemVo;
|
||||
import org.asinkj.amz.domain.vo.SysAmazonStoreVo;
|
||||
import org.asinkj.amz.mapper.*;
|
||||
import org.asinkj.amz.service.IBizPurchaseOrderItemService;
|
||||
import org.asinkj.amz.service.IBizStoreUserRelService;
|
||||
import org.asinkj.amz.service.ISysAmazonStoreService;
|
||||
import org.asinkj.common.core.utils.MapstructUtils;
|
||||
import org.asinkj.common.core.utils.StringUtils;
|
||||
@ -77,6 +78,9 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
||||
@Resource
|
||||
private ISysAmazonStoreService iSysAmazonStoreService;
|
||||
|
||||
@Resource
|
||||
private IBizStoreUserRelService iBizStoreUserRelService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询采购单主
|
||||
@ -99,7 +103,7 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
||||
@Override
|
||||
public TableDataInfo<BizPurchaseOrderVo> queryPageList(BizPurchaseOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizPurchaseOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<BizPurchaseOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<BizPurchaseOrderVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
|
||||
List<BizPurchaseOrderVo> records = result.getRecords();
|
||||
|
||||
if (result.getTotal() == 0) {
|
||||
@ -290,13 +294,17 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
|
||||
}
|
||||
|
||||
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());
|
||||
Set<String> storeNameCollect = iBizStoreUserRelService.queryStoreName(LoginHelper.getUserId());
|
||||
|
||||
// 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.in(BizPurchaseOrder::getStoreName, storeNameCollect);
|
||||
// lqw.and(queryWrapper -> queryWrapper.in(BizPurchaseOrder::getStoreName, storeNameCollect).or().in(BizPurchaseOrder::getRealStoreName, storeNameCollect));
|
||||
} else {
|
||||
lqw.apply("1 = 0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package org.asinkj.amz.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.asinkj.amz.domain.*;
|
||||
import org.asinkj.amz.domain.vo.BizOrderOutItemVo;
|
||||
import org.asinkj.amz.mapper.*;
|
||||
import org.asinkj.amz.service.IBizStoreUserRelService;
|
||||
import org.asinkj.common.core.utils.MapstructUtils;
|
||||
import org.asinkj.common.core.utils.StringUtils;
|
||||
import org.asinkj.common.mybatis.core.page.TableDataInfo;
|
||||
@ -64,6 +66,9 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Resource
|
||||
private IBizStoreUserRelService iBizStoreUserRelService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询组合订单
|
||||
@ -119,6 +124,11 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
|
||||
List<BizSendOrderItem> bizSendOrderItems = bizSendOrderItemMapper.selectList(sendOrderItemWrapper);
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizSendOrderItem> sendOrderItemQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sendOrderItemQueryWrapper.in(BizSendOrderItem::getOrderSn, collect);
|
||||
List<BizSendOrderItem> bizSendOrderItemOrderItems = bizSendOrderItemMapper.selectList(sendOrderItemQueryWrapper);
|
||||
Map<String, List<BizSendOrderItem>> collect4 = bizSendOrderItemOrderItems.stream().collect(Collectors.groupingBy(BizSendOrderItem::getOrderSn));
|
||||
|
||||
LambdaQueryWrapper<BizSendOrder> sendOrderWrapper = new LambdaQueryWrapper<>();
|
||||
sendOrderWrapper.in(BizSendOrder::getOrderSn, collect);
|
||||
List<BizSendOrder> bizSendOrders = bizSendOrderMapper.selectList(sendOrderWrapper);
|
||||
@ -147,12 +157,22 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
|
||||
for (BizPurchaseOutOrderVo record : records) {
|
||||
List<BizOrderOutItem> bizOrderOutItems1 = itemMap.get(record.getOrderSn());
|
||||
List<BizOrderOutItemVo> convert = MapstructUtils.convert(bizOrderOutItems1, BizOrderOutItemVo.class);
|
||||
record.setQuantityShipped(Optional.ofNullable(collect3.get(record.getOrderSn())).orElse(BigDecimal.ZERO));
|
||||
BigDecimal orderQuantity = collect3.get(record.getOrderSn());
|
||||
|
||||
record.setQuantityLeft(record.getOutsourceQuantity().subtract(Optional.ofNullable(collect3.get(record.getOrderSn())).orElse(BigDecimal.ZERO)));
|
||||
if (CollectionUtil.isEmpty(convert)) {
|
||||
continue;
|
||||
}
|
||||
List<BizSendOrderItem> bizSendOrderItems1 = collect4.get(record.getOrderSn());
|
||||
BigDecimal reduce1 = BigDecimal.ZERO;
|
||||
if (CollectionUtil.isNotEmpty(bizSendOrderItems1)) {
|
||||
reduce1 = bizSendOrderItems1.stream().map(BizSendOrderItem::getQuantitySend).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
BigDecimal quantityShipped = Optional.ofNullable(collect3.get(record.getOrderSn())).orElse(BigDecimal.ZERO).add(reduce1);
|
||||
record.setQuantityShipped(quantityShipped);
|
||||
record.setQuantityLeft(record.getOutsourceQuantity().subtract(record.getQuantityShipped()));
|
||||
|
||||
BigDecimal canSendLeft = record.getQuantityLeft();
|
||||
for (BizOrderOutItemVo item : convert) {
|
||||
BizPurchaseOrder bizPurchaseOrder = purchaseOrderMap.get(item.getPurchaseOrderSn());
|
||||
item.setOrder(bizPurchaseOrder);
|
||||
@ -181,11 +201,20 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
|
||||
// if (CollectionUtil.isNotEmpty(bizShipForwards)) {
|
||||
// item.setForwards(bizShipForwards);
|
||||
// }
|
||||
item.setQuantityShipped(Optional.ofNullable(collect2.get(item.getPurchaseOrderSn() + "_" + item.getSku())).orElse(BigDecimal.ZERO));
|
||||
item.setQuantityLeft(item.getQuantityReal().subtract(Optional.ofNullable(item.getQuantityShipped()).orElse(BigDecimal.ZERO)));
|
||||
BigDecimal ratio = item.getQuantityReal().divide(record.getOutsourceQuantity(), 2, RoundingMode.HALF_UP);
|
||||
item.setRatio(ratio);
|
||||
|
||||
item.setQuantityShipped(Optional.ofNullable(collect2.get(item.getPurchaseOrderSn() + "_" + item.getSku())).orElse(BigDecimal.ZERO).add(reduce1.multiply(ratio)));
|
||||
item.setQuantityLeft(item.getQuantityReal().subtract(Optional.ofNullable(item.getQuantityShipped()).orElse(BigDecimal.ZERO)));
|
||||
|
||||
if (item.getForwardType().equals("other")) {
|
||||
BigDecimal divide = item.getQuantityForward().divide(ratio, 0, RoundingMode.DOWN);
|
||||
if (divide.compareTo(canSendLeft) < 0) {
|
||||
canSendLeft = divide;
|
||||
}
|
||||
}
|
||||
}
|
||||
record.setCanSendLeft(canSendLeft);
|
||||
record.setItems(convert);
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
@ -223,8 +252,20 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getExpectArriveTime()), BizPurchaseOutOrder::getExpectArriveTime, bo.getExpectArriveTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMsku()), BizPurchaseOutOrder::getMsku, bo.getMsku());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlanSn()), BizPurchaseOutOrder::getPlanSn, bo.getPlanSn());
|
||||
// lqw.eq(BizPurchaseOutOrder::getDelFlag, '0');
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSellerName()), BizPurchaseOutOrder::getSellerName, bo.getSellerName());
|
||||
|
||||
|
||||
if (StpUtil.hasRole("yunying")) {
|
||||
Set<String> storeNameCollect = iBizStoreUserRelService.queryStoreName(LoginHelper.getUserId());
|
||||
if (CollectionUtil.isNotEmpty(storeNameCollect)) {
|
||||
lqw.in(BizPurchaseOutOrder::getSellerName, storeNameCollect);
|
||||
} else {
|
||||
lqw.apply("1 = 0");
|
||||
}
|
||||
}
|
||||
lqw.orderByDesc(BizPurchaseOutOrder::getBizCreateTime);
|
||||
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
package org.asinkj.amz.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.generator.SnowflakeGenerator;
|
||||
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.incrementer.IdentifierGenerator;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.asinkj.amz.domain.*;
|
||||
import org.asinkj.amz.domain.bo.BizPackingSpecsBo;
|
||||
import org.asinkj.amz.domain.bo.SysAmazonStoreBo;
|
||||
import org.asinkj.amz.domain.vo.SysAmazonStoreVo;
|
||||
import org.asinkj.amz.domain.bo.*;
|
||||
import org.asinkj.amz.domain.vo.*;
|
||||
import org.asinkj.amz.mapper.*;
|
||||
import org.asinkj.amz.service.IBizShipmentPlanService;
|
||||
import org.asinkj.amz.service.IBizStoreUserRelService;
|
||||
import org.asinkj.amz.service.ISysAmazonStoreService;
|
||||
import org.asinkj.common.core.utils.MapstructUtils;
|
||||
import org.asinkj.common.core.utils.StringUtils;
|
||||
@ -23,10 +27,11 @@ 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.asinkj.utils.SerialNoGenerator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.asinkj.amz.domain.bo.BizSendOrderBo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderVo;
|
||||
import org.asinkj.amz.service.IBizSendOrderService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -35,6 +40,7 @@ import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.LongStream;
|
||||
|
||||
/**
|
||||
* 供应商创建的发货单Service业务层处理
|
||||
@ -46,6 +52,7 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BizSendOrderServiceImpl.class);
|
||||
private final BizSendOrderMapper baseMapper;
|
||||
|
||||
@Resource
|
||||
@ -65,12 +72,33 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
@Resource
|
||||
private BizShipmentPlanMapper bizShipmentPlanMapper;
|
||||
|
||||
@Resource
|
||||
private BizSendShipmentPlanRelMapper bizSendShipmentPlanRelMapper;
|
||||
|
||||
@Resource
|
||||
private BizShipmentItemMapper bizShipmentItemMapper;
|
||||
|
||||
@Resource
|
||||
private BizSendOrderItemMapper bizSendOrderItemMapper;
|
||||
|
||||
@Resource
|
||||
private BizPackingSpecsMapper bizPackingSpecsMapper;
|
||||
|
||||
@Resource
|
||||
private BizPackingSpecsItemMapper bizPackingSpecsItemMapper;
|
||||
@Autowired
|
||||
private BizSendShipmentRelMapper bizSendShipmentRelMapper;
|
||||
@Autowired
|
||||
private BizPurchaseOrderMapper bizPurchaseOrderMapper;
|
||||
@Autowired
|
||||
private BizPurchaseOutOrderMapper bizPurchaseOutOrderMapper;
|
||||
@Autowired
|
||||
private BizOrderOutItemMapper bizOrderOutItemMapper;
|
||||
|
||||
@Resource
|
||||
private IBizStoreUserRelService iBizStoreUserRelService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询供应商创建的发货单
|
||||
*
|
||||
@ -92,18 +120,43 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
@Override
|
||||
public TableDataInfo<BizSendOrderVo> queryPageList(BizSendOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizSendOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<BizSendOrderVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
|
||||
Page<BizSendOrderVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw, null);
|
||||
List<BizSendOrderVo> records = result.getRecords();
|
||||
// Set<String> shipmentIds = records.stream().map(BizSendOrderVo::getShipmentId).collect(Collectors.toSet());
|
||||
Set<Long> ids = records.stream().map(BizSendOrderVo::getId).collect(Collectors.toSet());
|
||||
Set<Long> transferIds = records.stream().map(BizSendOrderVo::getTransferFromId).collect(Collectors.toSet());
|
||||
|
||||
Set<Long> mixIds = records.stream().filter(c -> "mix".equals(c.getType())).map(BizSendOrderVo::getId).collect(Collectors.toSet());
|
||||
Map<Long, List<BizPackingSpecs>> bizPackingSpecsMap = new HashMap<>();
|
||||
Map<Long, List<BizPackingSpecsItem>> bizPackingSpecsItemMap = new HashMap<>();
|
||||
Map<String, List<BizOrderOutItem>> bizOrderOutOrdersMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(mixIds)) {
|
||||
List<BizPackingSpecs> bizPackingSpecs = bizPackingSpecsMapper.selectList(new LambdaQueryWrapper<BizPackingSpecs>().in(BizPackingSpecs::getSendOrderId, mixIds));
|
||||
bizPackingSpecsMap = bizPackingSpecs.stream().collect(Collectors.groupingBy(BizPackingSpecs::getSendOrderId));
|
||||
|
||||
Set<Long> packSpecsIds = bizPackingSpecs.stream().map(BizPackingSpecs::getId).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isNotEmpty(packSpecsIds)) {
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems = bizPackingSpecsItemMapper.selectList(new LambdaQueryWrapper<BizPackingSpecsItem>().in(BizPackingSpecsItem::getPackingSpecsId, packSpecsIds));
|
||||
|
||||
bizPackingSpecsItemMap = bizPackingSpecsItems.stream().collect(Collectors.groupingBy(BizPackingSpecsItem::getPackingSpecsId));
|
||||
}
|
||||
LambdaQueryWrapper<BizSendOrderItem> sendOrderItemWrapper = new LambdaQueryWrapper<>();
|
||||
sendOrderItemWrapper.in(BizSendOrderItem::getMainOrderSn, mixIds);
|
||||
List<BizSendOrderItem> bizSendOrderItems = bizSendOrderItemMapper.selectList(sendOrderItemWrapper);
|
||||
Set<String> itemOrderSns = bizSendOrderItems.stream().map(BizSendOrderItem::getOrderSn).collect(Collectors.toSet());
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizOrderOutItem> purchaseOutOrderWrapper = new LambdaQueryWrapper<>();
|
||||
purchaseOutOrderWrapper.in(BizOrderOutItem::getOutOrderSn, itemOrderSns);
|
||||
List<BizOrderOutItem> bizPurchaseOutOrders = bizOrderOutItemMapper.selectList(purchaseOutOrderWrapper);
|
||||
bizOrderOutOrdersMap = bizPurchaseOutOrders.stream().collect(Collectors.groupingBy(BizOrderOutItem::getOutOrderSn));
|
||||
|
||||
}
|
||||
LambdaQueryWrapper<BizSendOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(CollectionUtil.isNotEmpty(transferIds), BizSendOrder::getTransferFromId, transferIds);
|
||||
List<BizSendOrder> bizSendOrders = baseMapper.selectList(queryWrapper);
|
||||
|
||||
Map<Long, List<BizSendOrder>> transferMap = bizSendOrders.stream().collect(Collectors.groupingBy(BizSendOrder::getTransferFromId));
|
||||
Map<Long, List<BizSendOrder>> transferMap = bizSendOrders.stream().filter(c -> ObjectUtil.isNotEmpty(c.getTransferFromId())).collect(Collectors.groupingBy(BizSendOrder::getTransferFromId));
|
||||
Map<String, List<BizSendOrderItem>> transferItemMap = new HashMap<>();
|
||||
Set<Long> transferDataIds = bizSendOrders.stream().map(BizSendOrder::getId).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isNotEmpty(transferDataIds)) {
|
||||
@ -138,6 +191,9 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
|
||||
Map<Long, List<BizShipmentPlan>> shipmentsByOrderIdsMap = getShipmentsByOrderIds(ids);
|
||||
|
||||
Map<Long, List<BizSendPlanRelVo>> sendPlanRelationIdsMap = getSendPlanRel(ids);
|
||||
|
||||
|
||||
List<BizShipmentPlan> collect = shipmentsByOrderIdsMap.values().stream().flatMap(Collection::stream).toList();
|
||||
Set<String> shipmentIds = collect.stream().map(BizShipmentPlan::getShipmentId).collect(Collectors.toSet());
|
||||
Map<String, List<BizShipmentItem>> shipmentItemsMap = new HashMap<>();
|
||||
@ -152,12 +208,15 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
Map<Long, RemoteUserVo> remoteUserVoMap = remoteUserService.selectListByIds(logicIds).stream().collect(Collectors.toMap(RemoteUserVo::getUserId, Function.identity()));
|
||||
Set<Long> recordIds = records.stream().map(BizSendOrderVo::getId).collect(Collectors.toSet());
|
||||
Map<Long, List<BizSendOrderItem>> sendOrderItemMap = new HashMap<>();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(recordIds)) {
|
||||
LambdaQueryWrapper<BizSendOrderItem> sendOrderItemWrapper = new LambdaQueryWrapper<>();
|
||||
sendOrderItemWrapper.in(BizSendOrderItem::getMainOrderSn, recordIds);
|
||||
List<BizSendOrderItem> bizSendOrderItems = bizSendOrderItemMapper.selectList(sendOrderItemWrapper);
|
||||
|
||||
sendOrderItemMap = bizSendOrderItems.stream().collect(Collectors.groupingBy(BizSendOrderItem::getMainOrderSn));
|
||||
|
||||
|
||||
}
|
||||
for (BizSendOrderVo record : records) {
|
||||
RemoteUserVo remoteUserVo = remoteUserVoMap.get(record.getLogisticsProviderId());
|
||||
@ -176,6 +235,20 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
// if (bizLogisticsOrder != null) {
|
||||
// record.setBizLogisticsOrder(bizLogisticsOrder);
|
||||
// }
|
||||
if ("mix".equals(record.getType())) {
|
||||
List<BizPackingSpecs> bizPackingSpecs1 = bizPackingSpecsMap.get(record.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizPackingSpecs1)) {
|
||||
List<BizPackingSpecsVo> convertPackList = MapstructUtils.convert(bizPackingSpecs1, BizPackingSpecsVo.class);
|
||||
record.setPackingSpecs(convertPackList);
|
||||
assert convertPackList != null;
|
||||
for (BizPackingSpecsVo bizPackingSpecsVo : convertPackList) {
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems1 = bizPackingSpecsItemMap.get(bizPackingSpecsVo.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizPackingSpecsItems1)) {
|
||||
bizPackingSpecsVo.setItems(MapstructUtils.convert(bizPackingSpecsItems1, BizPackingSpecsItemVo.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<BizShipmentPlan> bizShipmentPlans = shipmentsByOrderIdsMap.get(record.getId());
|
||||
record.setBizShipmentPlans(bizShipmentPlans);
|
||||
@ -191,29 +264,57 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
}
|
||||
}
|
||||
|
||||
List<BizSendPlanRelVo> relVos = sendPlanRelationIdsMap.get(record.getId());
|
||||
record.setSendPlansRelVos(relVos);
|
||||
if (CollectionUtil.isNotEmpty(relVos)) {
|
||||
BigDecimal quantityLink = relVos.stream().map(c -> c.getPiecesPerCarton().multiply(c.getCartonCount())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
record.setQuantityLink(quantityLink);
|
||||
}
|
||||
record.setQuantityLeft(record.getQuantitySend().subtract(record.getQuantityLink()));
|
||||
|
||||
|
||||
List<BizSendOrderItem> bizSendOrderItems1 = sendOrderItemMap.get(record.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizSendOrderItems1)) {
|
||||
for (BizSendOrderItem item : bizSendOrderItems1) {
|
||||
BigDecimal ratio = item.getQuantitySend().divide(record.getQuantitySend(), 2, RoundingMode.HALF_UP);
|
||||
item.setRatio(ratio);
|
||||
|
||||
List<BizSendOrderItemVo> convertBizSendOrderItems1 = MapstructUtils.convert(bizSendOrderItems1, BizSendOrderItemVo.class);
|
||||
assert convertBizSendOrderItems1 != null;
|
||||
for (BizSendOrderItemVo item : convertBizSendOrderItems1) {
|
||||
List<BizSendOrderItem> bizSendOrderItems2 = transferItemMap.get(item.getId() + "_" + item.getSku());
|
||||
if (CollectionUtil.isNotEmpty(bizSendOrderItems2)) {
|
||||
BigDecimal reduce = bizSendOrderItems2.stream().map(BizSendOrderItem::getQuantitySend).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
item.setQuantitySend(item.getQuantitySend().subtract(reduce));
|
||||
}
|
||||
|
||||
try {
|
||||
BigDecimal ratio = item.getQuantitySend().divide(record.getQuantitySend(), 2, RoundingMode.HALF_UP);
|
||||
item.setRatio(ratio);
|
||||
} catch (Exception e) {
|
||||
item.setRatio(BigDecimal.ONE);
|
||||
}
|
||||
if (record.getType().equals("mix")) {
|
||||
List<BizOrderOutItem> bizOrderOutItems = bizOrderOutOrdersMap.get(item.getOrderSn());
|
||||
List<BizOrderOutItemVo> convert = MapstructUtils.convert(bizOrderOutItems, BizOrderOutItemVo.class);
|
||||
item.setItems(convert);
|
||||
}
|
||||
|
||||
}
|
||||
record.setItems(convertBizSendOrderItems1);
|
||||
}
|
||||
|
||||
|
||||
record.setItems(bizSendOrderItems1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private Map<Long, List<BizSendPlanRelVo>> getSendPlanRel(Set<Long> ids) {
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<BizSendPlanRelVo> relVos = bizSendShipmentPlanRelMapper.querySendPlanRelVo(ids);
|
||||
return relVos.stream().collect(Collectors.groupingBy(BizSendPlanRelVo::getSendOrderId));
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, List<BizShipmentPlan>> getShipmentsByOrderIds(Collection<Long> sendOrderIds) {
|
||||
if (CollectionUtil.isEmpty(sendOrderIds)) {
|
||||
@ -266,17 +367,26 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
lqw.eq(bo.getQuantitySend() != null, BizSendOrder::getQuantitySend, bo.getQuantitySend());
|
||||
lqw.eq(bo.getQuantityPerBox() != null, BizSendOrder::getQuantityPerBox, bo.getQuantityPerBox());
|
||||
lqw.eq(bo.getBoxCount() != null, BizSendOrder::getBoxCount, bo.getBoxCount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCompleteFlag()), BizSendOrder::getCompleteFlag, bo.getCompleteFlag());
|
||||
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBoxDimensions()), BizSendOrder::getBoxDimensions, bo.getBoxDimensions());
|
||||
// lqw.eq(BizSendOrder::getDelFlag, '0');
|
||||
lqw.eq(bo.getWeightPerBox() != null, BizSendOrder::getWeightPerBox, bo.getWeightPerBox());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRealStoreName()), BizSendOrder::getRealStoreName, bo.getRealStoreName());
|
||||
|
||||
lqw.in(StringUtils.isNotBlank(bo.getSendStatus()), BizSendOrder::getSendStatus, StrUtil.split(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());
|
||||
Set<String> storeNameCollect = iBizStoreUserRelService.queryStoreName(LoginHelper.getUserId());
|
||||
// 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));
|
||||
lqw.in(BizSendOrder::getStoreName, storeNameCollect);
|
||||
}else {
|
||||
lqw.apply("1 = 0");
|
||||
}
|
||||
} else if (StpUtil.hasRole("gongying")) {
|
||||
lqw.eq(BizSendOrder::getSendId, LoginHelper.getUserId());
|
||||
@ -296,8 +406,6 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
|
||||
@Resource
|
||||
private BizPackingSpecsMapper bizPackingSpecsMapper;
|
||||
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
@ -374,7 +482,12 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
|
||||
boolean b = baseMapper.deleteByIds(ids) > 0;
|
||||
LambdaQueryWrapper<BizSendOrderItem> itemLambdaQueryWrapper = new LambdaQueryWrapper<BizSendOrderItem>().in(BizSendOrderItem::getMainOrderSn, ids);
|
||||
bizSendOrderItemMapper.delete(itemLambdaQueryWrapper);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -403,13 +516,27 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
public int updateDataByBo(BizSendOrderBo bo) {
|
||||
BizSendOrder update = MapstructUtils.convert(bo, BizSendOrder.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update);
|
||||
int result = baseMapper.updateById(update);
|
||||
|
||||
// BizPackingSpecs bizPackingSpecs = new BizPackingSpecs();
|
||||
// bizPackingSpecs.setSendOrderId(update.getId());
|
||||
if (CollectionUtil.isNotEmpty(bo.getPackingSpecsList())) {
|
||||
List<BizPackingSpecsBo> packingSpecsList = bo.getPackingSpecsList();
|
||||
List<BizPackingSpecs> bizPackingSpecsList = MapstructUtils.convert(packingSpecsList, BizPackingSpecs.class);
|
||||
for (BizPackingSpecs bizPackingSpecs : bizPackingSpecsList) {
|
||||
bizPackingSpecs.setSendOrderId(update.getId());
|
||||
}
|
||||
bizPackingSpecsMapper.insertBatch(bizPackingSpecsList);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BizSendOrderVo> coverSendOrder(BizSendOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizSendOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<BizSendOrderVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
|
||||
Page<BizSendOrderVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw, null);
|
||||
List<BizSendOrderVo> records = result.getRecords();
|
||||
Set<String> shipmentIds = records.stream().map(BizSendOrderVo::getShipmentId).collect(Collectors.toSet());
|
||||
Set<Long> ids = records.stream().map(BizSendOrderVo::getId).collect(Collectors.toSet());
|
||||
@ -456,7 +583,8 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
record.setBizShipmentPlans(bizShipmentPlans);
|
||||
// if (record.getType().equals("com")) {
|
||||
List<BizSendOrderItem> bizSendOrderItems1 = sendOrderItemMap.get(record.getId());
|
||||
record.setItems(bizSendOrderItems1);
|
||||
List<BizSendOrderItemVo> convert = MapstructUtils.convert(bizSendOrderItems1, BizSendOrderItemVo.class);
|
||||
record.setItems(convert);
|
||||
// }
|
||||
}
|
||||
|
||||
@ -469,6 +597,9 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
//调拨
|
||||
// BizSendOrder add = MapstructUtils.convert(bo, BizSendOrder.class);
|
||||
// validEntityBeforeSave(add);
|
||||
if (bo.getType().equals("mix")) {
|
||||
throw new RuntimeException("混合订单无法进行调拨");
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<BizSendOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BizSendOrder::getId, bo.getId());
|
||||
@ -489,15 +620,17 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
add.setProductName(bo.getProductName());
|
||||
add.setQuantitySend(bo.getQuantitySend());
|
||||
add.setQuantityPerBox(bo.getQuantityPerBox());
|
||||
add.setBoxCount(bo.getBoxCount());
|
||||
// add.setBoxCount(bo.getBoxCount());
|
||||
add.setBoxDimensions(bo.getBoxDimensions());
|
||||
add.setWeightPerBox(bo.getWeightPerBox());
|
||||
add.setRealStoreName(bo.getRealStoreName());
|
||||
add.setSendStatus("unconfirm");
|
||||
add.setSendDetail(bo.getSendDetail());
|
||||
// add.setSendDetail(bo.getSendDetail());
|
||||
add.setLogisticsProviderName(bo.getLogisticsProviderName());
|
||||
add.setLogisticsProviderId(bo.getLogisticsProviderId());
|
||||
add.setTransferFromId(bo.getId());
|
||||
add.setSendId(bo.getSendId());
|
||||
add.setSendName(bo.getSendName());
|
||||
add.setType("tra");
|
||||
|
||||
// LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -520,7 +653,7 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
|
||||
List<BizSendOrderItem> bizSendOrderItems = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(bo.getItems())) {
|
||||
for (BizSendOrderItem item : bo.getItems()) {
|
||||
for (BizSendOrderItemVo item : bo.getItems()) {
|
||||
BizSendOrderItem bizSendOrderItem = new BizSendOrderItem();
|
||||
bizSendOrderItem.setQuantitySend(item.getQuantitySend());
|
||||
bizSendOrderItem.setOrderSn(item.getOrderSn());
|
||||
@ -536,5 +669,193 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BizSendOrderPackVo> linkSendOrderList(BizSendOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizSendOrder> lqw = Wrappers.lambdaQuery();
|
||||
lqw.apply("1 = 1");
|
||||
lqw.in(BizSendOrder::getSendStatus, Arrays.asList("confirm", "completed", "set_store"));
|
||||
lqw.in(BizSendOrder::getSku, bo.getSkus());
|
||||
Set<String> storeNameCollect = iBizStoreUserRelService.queryStoreName(LoginHelper.getUserId());
|
||||
// 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) && !StpUtil.hasRole("superadmin")) {
|
||||
lqw.in(BizSendOrder::getStoreName, storeNameCollect);
|
||||
}else {
|
||||
lqw.apply("1 = 0");
|
||||
}
|
||||
Page<BizSendOrderPackVo> page = baseMapper.selectCustomPackPage(pageQuery.build(), lqw);
|
||||
List<BizSendOrderPackVo> records = page.getRecords();
|
||||
Set<Long> pakIds = records.stream().map(BizSendOrderPackVo::getPkid).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isEmpty(pakIds)) {
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
List<BizSendShipmentPlanRel> bizSendShipmentPlanRels = bizSendShipmentPlanRelMapper.selectList(new LambdaQueryWrapper<BizSendShipmentPlanRel>().in(BizSendShipmentPlanRel::getPackId, pakIds));
|
||||
Map<Long, List<BizSendShipmentPlanRel>> bizSendShipmentPlanRelMap = bizSendShipmentPlanRels.stream().collect(Collectors.groupingBy(BizSendShipmentPlanRel::getPackId));
|
||||
for (BizSendOrderPackVo record : records) {
|
||||
List<BizSendShipmentPlanRel> bizSendShipmentPlanRels1 = bizSendShipmentPlanRelMap.get(record.getPkid());
|
||||
if (CollectionUtil.isNotEmpty(bizSendShipmentPlanRels1)) {
|
||||
BigDecimal collect = bizSendShipmentPlanRels1.stream().map(BizSendShipmentPlanRel::getCartonCount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
record.setLinkCartonCount(collect);
|
||||
}
|
||||
|
||||
record.setLeftLinkCount(record.getCartonCount().subtract(record.getLinkCartonCount()));
|
||||
}
|
||||
records.removeIf(record -> record.getLeftLinkCount().compareTo(BigDecimal.ZERO) <= 0);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BizPackingSpecsVo> linkMixSendOrderList(BizSendOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizSendOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BizSendOrder::getSendStatus, "confirmed", "set_store", "confirm");
|
||||
queryWrapper.eq(BizSendOrder::getType, "mix");
|
||||
Set<String> storeNameCollect = iBizStoreUserRelService.queryStoreName(LoginHelper.getUserId());
|
||||
// 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) && !StpUtil.hasRole("superadmin")) {
|
||||
queryWrapper.in(BizSendOrder::getStoreName, storeNameCollect);
|
||||
}else {
|
||||
queryWrapper.apply("1 = 0");
|
||||
}
|
||||
List<BizSendOrder> bizSendOrders = baseMapper.selectList(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(bizSendOrders)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Set<Long> sendOrderIds = bizSendOrders.stream().map(BizSendOrder::getId).collect(Collectors.toSet());
|
||||
|
||||
Map<Long, BizSendOrder> sendOrderMap = bizSendOrders.stream().collect(Collectors.toMap(BizSendOrder::getId, Function.identity()));
|
||||
|
||||
LambdaQueryWrapper<BizPackingSpecs> packWrapper = new LambdaQueryWrapper<>();
|
||||
packWrapper.in(BizPackingSpecs::getSendOrderId, sendOrderIds);
|
||||
List<BizPackingSpecs> bizPackingSpecses = bizPackingSpecsMapper.selectList(packWrapper);
|
||||
Set<Long> packIds = bizPackingSpecses.stream().map(BizPackingSpecs::getId).collect(Collectors.toSet());
|
||||
|
||||
List<BizSendShipmentPlanRel> bizSendShipmentPlanRels = bizSendShipmentPlanRelMapper.selectList(new LambdaQueryWrapper<BizSendShipmentPlanRel>().in(BizSendShipmentPlanRel::getPackId, packIds));
|
||||
Map<Long, List<BizSendShipmentPlanRel>> bizSendShipmentPlanRelMap = bizSendShipmentPlanRels.stream().collect(Collectors.groupingBy(BizSendShipmentPlanRel::getPackId));
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizPackingSpecsItem> packItemWrapper = new LambdaQueryWrapper<>();
|
||||
packItemWrapper.in(BizPackingSpecsItem::getPackingSpecsId, packIds);
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems = bizPackingSpecsItemMapper.selectList(packItemWrapper);
|
||||
Map<Long, List<BizPackingSpecsItem>> packItemsMap = bizPackingSpecsItems.stream().collect(Collectors.groupingBy(BizPackingSpecsItem::getPackingSpecsId));
|
||||
ArrayList<BizPackingSpecsVo> returnDatas = new ArrayList<>();
|
||||
for (BizPackingSpecs bizPackingSpecs : bizPackingSpecses) {
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems1 = packItemsMap.get(bizPackingSpecs.getId());
|
||||
if (CollectionUtil.isEmpty(bizPackingSpecsItems1)) {
|
||||
continue;
|
||||
}
|
||||
Set<String> skus = bizPackingSpecsItems1.stream().map(BizPackingSpecsItem::getSku).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isNotEmpty(skus) && CollUtil.containsAll(bo.getSkus(), skus)) {
|
||||
BizPackingSpecsVo convert = MapstructUtils.convert(bizPackingSpecs, BizPackingSpecsVo.class);
|
||||
convert.setSendOrder(MapstructUtils.convert(sendOrderMap.get(bizPackingSpecs.getSendOrderId()), BizSendOrderVo.class));
|
||||
convert.setItems(MapstructUtils.convert(bizPackingSpecsItems1, BizPackingSpecsItemVo.class));
|
||||
|
||||
List<BizSendShipmentPlanRel> bizSendShipmentPlanRels1 = bizSendShipmentPlanRelMap.get(convert.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizSendShipmentPlanRels1)) {
|
||||
BigDecimal collect = bizSendShipmentPlanRels1.stream().map(BizSendShipmentPlanRel::getCartonCount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
convert.setLinkCartonCount(collect);
|
||||
}
|
||||
convert.setLeftLinkCount(convert.getCartonCount().subtract(convert.getLinkCartonCount()));
|
||||
if (convert.getLeftLinkCount().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
continue;
|
||||
}
|
||||
returnDatas.add(convert);
|
||||
}
|
||||
}
|
||||
return returnDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMixedOrder(BizSendOrderMixBo bo) {
|
||||
System.out.println(bo);
|
||||
// String s = SerialNoGenerator.generateMixOrderNo();
|
||||
// System.out.println(s);
|
||||
|
||||
if (CollectionUtil.isEmpty(bo.getItems())) {
|
||||
throw new RuntimeException("请选择要合并的订单");
|
||||
}
|
||||
BizPurchaseOutOrderVo outOrderVo = bo.getItems().get(0);
|
||||
BizSendOrder add = new BizSendOrder();
|
||||
add.setOrderSn(SerialNoGenerator.generateMixOrderNo());
|
||||
add.setType("mix");
|
||||
add.setStoreName(bo.getStoreName());
|
||||
add.setCreateName(LoginHelper.getLoginUser().getNickname());
|
||||
add.setSku(bo.getItems().stream().map(BizPurchaseOutOrderVo::getSku).collect(Collectors.joining(",")));
|
||||
BigDecimal reduce = bo.getItems().stream().map(BizPurchaseOutOrderVo::getQuantityShipped).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
for (BizPurchaseOutOrderVo item : bo.getItems()) {
|
||||
if (item.getQuantityShipped().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new RuntimeException("数量不能为0");
|
||||
}
|
||||
}
|
||||
add.setQuantitySend(reduce);
|
||||
// add.setStoreName(bizPurchaseOutOrderVo.getStoreName());
|
||||
// add.setProductName(bizPurchaseOutOrderVo.getProductName());
|
||||
// add.setQuantitySend(bizPurchaseOutOrderVo.getQuantityLeft());
|
||||
// add.setQuantityPerBox(bizPurchaseOutOrderVo.getQuantityPerBox());
|
||||
// add.setBoxCount(bizPurchaseOutOrderVo.getBoxCount());
|
||||
// add.setBoxDimensions(bizPurchaseOutOrderVo.getBoxDimensions());
|
||||
// add.setWeightPerBox(bizPurchaseOutOrderVo.getWeightPerBox());
|
||||
// add.setRealStoreName(bizPurchaseOutOrderVo.getRealStoreName());
|
||||
add.setSendStatus("unconfirm");
|
||||
add.setSendName(outOrderVo.getSupplierName());
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysUser::getNickName, outOrderVo.getSupplierName());
|
||||
List<SysUser> sysUsers = sysUserMapper.selectList(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(sysUsers)) {
|
||||
add.setSendId(sysUsers.get(0).getUserId());
|
||||
}
|
||||
|
||||
baseMapper.insert(add);
|
||||
ArrayList<BizSendOrderItem> items = new ArrayList<>();
|
||||
for (BizPurchaseOutOrderVo item : bo.getItems()) {
|
||||
BizSendOrderItem bizSendOrderItem = new BizSendOrderItem();
|
||||
bizSendOrderItem.setOrderSn(item.getOrderSn());
|
||||
bizSendOrderItem.setMainOrderSn(add.getId());
|
||||
bizSendOrderItem.setProductName(item.getProductName());
|
||||
bizSendOrderItem.setSku(item.getSku());
|
||||
bizSendOrderItem.setQuantitySend(item.getQuantityShipped());
|
||||
items.add(bizSendOrderItem);
|
||||
}
|
||||
bizSendOrderItemMapper.insertBatch(items);
|
||||
}
|
||||
|
||||
@Resource
|
||||
private IdentifierGenerator identifierGenerator;
|
||||
|
||||
|
||||
@Override
|
||||
public void createMixedOrderPackSpecs(BizSendOrderMixPackSpecsBo bo) {
|
||||
System.out.println(bo);
|
||||
ArrayList<BizPackingSpecsBo> packList = new ArrayList<>();
|
||||
ArrayList<BizPackingSpecsItemBo> packItemList = new ArrayList<>();
|
||||
|
||||
for (BizPackingSpecsBo item : bo.getItems()) {
|
||||
long packId = identifierGenerator.nextId(null).longValue();
|
||||
item.setId(packId);
|
||||
item.setSendOrderId(bo.getSendOrder().getId());
|
||||
packList.add(item);
|
||||
for (BizPackingSpecsItemBo child : item.getChildren()) {
|
||||
child.setPackingSpecsId(packId);
|
||||
packItemList.add(child);
|
||||
}
|
||||
}
|
||||
BigDecimal sum = bo.getItems().stream().map(BizPackingSpecsBo::getCartonCount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal reduce = bo.getItems().stream().map(c -> c.getCartonCount().multiply(c.getWeight())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
LambdaUpdateWrapper<BizSendOrder> queryWrapper = new LambdaUpdateWrapper<>();
|
||||
queryWrapper.eq(BizSendOrder::getId, bo.getSendOrder().getId());
|
||||
queryWrapper.set(BizSendOrder::getSendStatus, "confirmed");
|
||||
queryWrapper.set(BizSendOrder::getBoxCount, sum);
|
||||
queryWrapper.set(BizSendOrder::getWeightPerBox, reduce);
|
||||
baseMapper.update(queryWrapper);
|
||||
|
||||
bizPackingSpecsMapper.insertBatch(MapstructUtils.convert(packList, BizPackingSpecs.class));
|
||||
bizPackingSpecsItemMapper.insertBatch(MapstructUtils.convert(packItemList, BizPackingSpecsItem.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,179 @@
|
||||
package org.asinkj.amz.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import org.asinkj.amz.domain.bo.BatchSendOrderPlanRelDTO;
|
||||
import org.asinkj.amz.domain.vo.BizPackingSpecsVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendOrderPackVo;
|
||||
import org.asinkj.amz.domain.vo.BizSendPlanRelVo;
|
||||
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.BizSendShipmentPlanRelBo;
|
||||
import org.asinkj.amz.domain.vo.BizSendShipmentPlanRelVo;
|
||||
import org.asinkj.amz.domain.BizSendShipmentPlanRel;
|
||||
import org.asinkj.amz.mapper.BizSendShipmentPlanRelMapper;
|
||||
import org.asinkj.amz.service.IBizSendShipmentPlanRelService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 发货单与货运计划多对多关联Service业务层处理
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BizSendShipmentPlanRelServiceImpl implements IBizSendShipmentPlanRelService {
|
||||
|
||||
private final BizSendShipmentPlanRelMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询发货单与货运计划多对多关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 发货单与货运计划多对多关联
|
||||
*/
|
||||
@Override
|
||||
public BizSendShipmentPlanRelVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询发货单与货运计划多对多关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 发货单与货运计划多对多关联分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BizSendPlanRelVo> queryPageList(BizSendShipmentPlanRelBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizSendShipmentPlanRel> lqw = buildQueryWrapper(bo);
|
||||
Page<BizSendPlanRelVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的发货单与货运计划多对多关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 发货单与货运计划多对多关联列表
|
||||
*/
|
||||
@Override
|
||||
public List<BizSendShipmentPlanRelVo> queryList(BizSendShipmentPlanRelBo bo) {
|
||||
LambdaQueryWrapper<BizSendShipmentPlanRel> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizSendShipmentPlanRel> buildQueryWrapper(BizSendShipmentPlanRelBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BizSendShipmentPlanRel> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getSendOrderId() != null, BizSendShipmentPlanRel::getSendOrderId, bo.getSendOrderId());
|
||||
lqw.eq(bo.getShipmentPlanId() != null, BizSendShipmentPlanRel::getShipmentPlanId, bo.getShipmentPlanId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSku()), BizSendShipmentPlanRel::getSku, bo.getSku());
|
||||
lqw.eq(bo.getPackId() != null, BizSendShipmentPlanRel::getPackId, bo.getPackId());
|
||||
lqw.eq(bo.getCartonCount() != null, BizSendShipmentPlanRel::getCartonCount, bo.getCartonCount());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发货单与货运计划多对多关联
|
||||
*
|
||||
* @param bo 发货单与货运计划多对多关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BizSendShipmentPlanRelBo bo) {
|
||||
BizSendShipmentPlanRel add = MapstructUtils.convert(bo, BizSendShipmentPlanRel.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货单与货运计划多对多关联
|
||||
*
|
||||
* @param bo 发货单与货运计划多对多关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BizSendShipmentPlanRelBo bo) {
|
||||
BizSendShipmentPlanRel update = MapstructUtils.convert(bo, BizSendShipmentPlanRel.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BizSendShipmentPlanRel entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除发货单与货运计划多对多关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchCreateRelations(BatchSendOrderPlanRelDTO dto) {
|
||||
if (CollectionUtil.isEmpty(dto.getShipmentIds())) {
|
||||
return;
|
||||
}
|
||||
List<BizSendOrderPackVo> sendOrderIds = dto.getSendOrderIds();
|
||||
Long shipmentId = dto.getShipmentIds().get(0);
|
||||
List<BizSendShipmentPlanRel> relations = new ArrayList<>();
|
||||
for (BizSendOrderPackVo item : sendOrderIds) {
|
||||
BizSendShipmentPlanRel bizSendShipmentPlanRel = new BizSendShipmentPlanRel();
|
||||
bizSendShipmentPlanRel.setSendOrderId(item.getId());
|
||||
bizSendShipmentPlanRel.setShipmentPlanId(shipmentId);
|
||||
bizSendShipmentPlanRel.setPackId(item.getPkid());
|
||||
bizSendShipmentPlanRel.setCartonCount(item.getLinkCount());
|
||||
bizSendShipmentPlanRel.setSku(item.getSku());
|
||||
relations.add(bizSendShipmentPlanRel);
|
||||
}
|
||||
baseMapper.insertBatch(relations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMixBatchRelations(BatchSendOrderPlanRelDTO dto) {
|
||||
if (CollectionUtil.isEmpty(dto.getShipmentIds())) {
|
||||
return;
|
||||
}
|
||||
List<BizPackingSpecsVo> sendOrderIds = dto.getPackingSpecs();
|
||||
Long shipmentId = dto.getShipmentIds().get(0);
|
||||
List<BizSendShipmentPlanRel> relations = new ArrayList<>();
|
||||
for (BizPackingSpecsVo item : sendOrderIds) {
|
||||
BizSendShipmentPlanRel bizSendShipmentPlanRel = new BizSendShipmentPlanRel();
|
||||
bizSendShipmentPlanRel.setSendOrderId(item.getSendOrderId());
|
||||
bizSendShipmentPlanRel.setShipmentPlanId(shipmentId);
|
||||
bizSendShipmentPlanRel.setPackId(item.getId());
|
||||
bizSendShipmentPlanRel.setCartonCount(item.getLinkCount());
|
||||
// bizSendShipmentPlanRel.setSku(item.getSku());
|
||||
relations.add(bizSendShipmentPlanRel);
|
||||
}
|
||||
baseMapper.insertBatch(relations);
|
||||
}
|
||||
}
|
||||
@ -76,6 +76,9 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
@Resource
|
||||
private BizShipmentItemMapper bizShipmentItemMapper;
|
||||
|
||||
@Resource
|
||||
private BizSendShipmentPlanRelMapper bizSendShipmentPlanRelMapper;
|
||||
|
||||
@DubboReference(stub = "true")
|
||||
private RemoteMessageService remoteMessageService;
|
||||
|
||||
@ -88,6 +91,8 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
|
||||
@Resource
|
||||
private BizLogisticsQuoteMapper bizLogisticsQuoteMapper;
|
||||
@Autowired
|
||||
private BizPackingSpecsItemMapper bizPackingSpecsItemMapper;
|
||||
|
||||
/**
|
||||
* 查询货件计划
|
||||
@ -134,6 +139,10 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
|
||||
Map<Long, List<BizSendOrder>> resultOrderMap = getOrdersGroupedByShipmentId(ids);
|
||||
|
||||
|
||||
Map<Long, List<BizSendPlanRelVo>> sendPlanRelationIdsMap = getSendPlanRel(ids);
|
||||
|
||||
|
||||
Set<Long> sids = result.getRecords().stream().map(BizShipmentPlanVo::getSid).collect(Collectors.toSet());
|
||||
Map<Long, String> storeNameMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(sids)) {
|
||||
@ -173,11 +182,13 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
// bizShipmentPlanVo.setSendOrder(sendOrderMap.get(bizShipmentPlanVo.getSendOrderId()));
|
||||
// }
|
||||
List<BizSendOrder> bizSendOrders = resultOrderMap.get(bizShipmentPlanVo.getId());
|
||||
bizShipmentPlanVo.setSendOrders(bizSendOrders);
|
||||
List<BizSendOrderVo> convert = MapstructUtils.convert(bizSendOrders, BizSendOrderVo.class);
|
||||
|
||||
bizShipmentPlanVo.setSendOrders(convert);
|
||||
Long count = collect.get(bizShipmentPlanVo.getShipmentId());
|
||||
// bizShipmentPlanVo.setBoxQuantity(count);
|
||||
List<BizShipmentItem> bizShipmentItems1 = collect1.get(bizShipmentPlanVo.getShipmentId());
|
||||
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO,BigDecimal::add);
|
||||
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setQuantityShipped(sum);
|
||||
bizShipmentPlanVo.setItemVoList(bizShipmentItems1);
|
||||
|
||||
@ -190,6 +201,26 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
if (bizLogisticsQuote != null) {
|
||||
bizShipmentPlanVo.setQuote(bizLogisticsQuote);
|
||||
}
|
||||
|
||||
List<BizSendPlanRelVo> relVos = sendPlanRelationIdsMap.get(bizShipmentPlanVo.getId());
|
||||
bizShipmentPlanVo.setSendPlansRelVos(relVos);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(relVos)) {
|
||||
BigDecimal quantityLink = relVos.stream().map(c -> c.getPiecesPerCarton().multiply(c.getCartonCount())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setQuantityLink(quantityLink);
|
||||
|
||||
BigDecimal boxQuantityLink = relVos.stream().map(BizSendPlanRelVo::getCartonCount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setBoxQuantityLink(boxQuantityLink);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// if (CollectionUtil.isNotEmpty(bizSendOrders)) {
|
||||
// bizShipmentPlanVo.setQuantityLink(bizSendOrders.stream().map(BizSendOrder::getQuantitySend).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
// }
|
||||
bizShipmentPlanVo.setBoxQuantityLeft(bizShipmentPlanVo.getBoxQuantity().subtract(bizShipmentPlanVo.getBoxQuantityLink()));
|
||||
bizShipmentPlanVo.setQuantityLeft(bizShipmentPlanVo.getQuantityShipped().subtract(bizShipmentPlanVo.getQuantityLink()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,6 +228,162 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BizShipmentPlanOrderVo> queryPageListOrder(BizShipmentPlanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizShipmentPlan> lqw = buildQueryWrapper(bo);
|
||||
Page<BizShipmentPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
Set<String> shipmentIds = result.getRecords().stream().map(BizShipmentPlanVo::getShipmentId).collect(Collectors.toSet());
|
||||
|
||||
|
||||
List<BizShipmentPlanOrderVo> convert = MapstructUtils.convert(result.getRecords(), BizShipmentPlanOrderVo.class);
|
||||
|
||||
Page<BizShipmentPlanOrderVo> bizShipmentPlanOrderVoPage = new Page<>(result.getCurrent(), result.getSize(), result.getTotal());
|
||||
bizShipmentPlanOrderVoPage.setRecords(convert);
|
||||
|
||||
|
||||
Set<Long> sids = result.getRecords().stream().map(BizShipmentPlanVo::getSid).collect(Collectors.toSet());
|
||||
Map<Long, String> storeNameMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(sids)) {
|
||||
storeNameMap = iSysAmazonStoreService.queryBySidList(sids).stream().collect(Collectors.toMap(SysAmazonStore::getSid, SysAmazonStore::getStoreName));
|
||||
}
|
||||
|
||||
|
||||
// Set<Long> senOrderIds = result.getRecords().stream().map(BizShipmentPlanVo::getSendOrderId).collect(Collectors.toSet());
|
||||
// Map<Long, BizSendOrder> sendOrderMap = new HashMap<>();
|
||||
// if (CollectionUtil.isNotEmpty(senOrderIds)) {
|
||||
// sendOrderMap = iSendOrderService.queryBySidList(senOrderIds).stream().collect(Collectors.toMap(BizSendOrder::getId, Function.identity()));
|
||||
// }
|
||||
Set<Long> ids = result.getRecords().stream().map(BizShipmentPlanVo::getId).collect(Collectors.toSet());
|
||||
|
||||
Map<Long, List<BizSendOrder>> resultOrderMap = getOrdersGroupedByShipmentId(ids);
|
||||
|
||||
|
||||
Map<Long, List<BizSendPlanRelVo>> sendPlanRelationIdsMap = getSendPlanRel(ids);
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(shipmentIds)) {
|
||||
LambdaQueryWrapper<BizShipmentTracking> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BizShipmentTracking::getShipmentId, shipmentIds);
|
||||
List<BizShipmentTracking> bizShipmentTrackings = bizShipmentTrackingMapper.selectList(queryWrapper);
|
||||
Map<String, Long> collect = bizShipmentTrackings.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
BizShipmentTracking::getShipmentId,
|
||||
Collectors.counting()
|
||||
));
|
||||
|
||||
LambdaQueryWrapper<BizLogisticsOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(BizLogisticsOrder::getFbaShipmentId, shipmentIds);
|
||||
List<BizLogisticsOrder> bizLogisticsOrders = bizLogisticsOrderMapper.selectList(lambdaQueryWrapper);
|
||||
Set<Long> quoteIds = bizLogisticsOrders.stream().map(BizLogisticsOrder::getQuoteOrderId).collect(Collectors.toSet());
|
||||
List<BizLogisticsQuote> quotes = iLogisticsQuoteService.queryQuoteWithQuoteId(quoteIds);
|
||||
Map<Long, BizLogisticsQuote> quoteMap = quotes.stream().collect(Collectors.toMap(BizLogisticsQuote::getId, Function.identity()));
|
||||
|
||||
|
||||
Map<String, BizLogisticsOrder> orderMap = bizLogisticsOrders.stream().collect(Collectors.toMap(BizLogisticsOrder::getFbaShipmentId, Function.identity(),
|
||||
(existing, replacement) -> existing));
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizLogisticsOrderDetail> orderDetailLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
orderDetailLambdaQueryWrapper.in(BizLogisticsOrderDetail::getFbaShipmentId, shipmentIds);
|
||||
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails = bizLogisticsOrderDetailMapper.selectList(orderDetailLambdaQueryWrapper);
|
||||
Map<String, List<BizLogisticsOrderDetail>> detailMap = bizLogisticsOrderDetails.stream().collect(Collectors.groupingBy(BizLogisticsOrderDetail::getFbaShipmentId));
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizShipmentItem> bizShipmentItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
bizShipmentItemLambdaQueryWrapper.in(BizShipmentItem::getShipmentId, shipmentIds);
|
||||
List<BizShipmentItem> bizShipmentItems = bizShipmentItemMapper.selectList(bizShipmentItemLambdaQueryWrapper);
|
||||
Map<String, List<BizShipmentItem>> collect1 = bizShipmentItems.stream().collect(Collectors.groupingBy(BizShipmentItem::getShipmentId, Collectors.toList()));
|
||||
|
||||
|
||||
for (BizShipmentPlanOrderVo bizShipmentPlanVo : bizShipmentPlanOrderVoPage.getRecords()) {
|
||||
Long count = collect.get(bizShipmentPlanVo.getShipmentId());
|
||||
BizLogisticsOrder bizLogisticsOrder = orderMap.get(bizShipmentPlanVo.getShipmentId());
|
||||
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails1 = detailMap.get(bizShipmentPlanVo.getShipmentId());
|
||||
|
||||
List<BizShipmentItem> bizShipmentItems1 = collect1.get(bizShipmentPlanVo.getShipmentId());
|
||||
bizShipmentPlanVo.setItemVoList(bizShipmentItems1);
|
||||
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setQuantityShipped(sum);
|
||||
|
||||
|
||||
// BizSendOrder bizSendOrder = sendOrderMap.get(bizShipmentPlanVo.getSendOrderId());
|
||||
// if (bizSendOrder != null) {
|
||||
// bizShipmentPlanVo.setSendOrder(sendOrderMap.get(bizShipmentPlanVo.getSendOrderId()));
|
||||
// }
|
||||
|
||||
List<BizSendOrder> bizSendOrders = resultOrderMap.get(bizShipmentPlanVo.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizSendOrders)) {
|
||||
bizShipmentPlanVo.setSendOrders(bizSendOrders);
|
||||
BigDecimal reduce = bizSendOrders.stream().filter(bizSendOrder -> ObjectUtil.isNotEmpty(bizSendOrder.getWeightPerBox())).map(BizSendOrder::getWeightPerBox).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setVendorWeight(reduce);
|
||||
|
||||
BigDecimal quantityRelated = bizSendOrders.stream().filter(bizSendOrder -> ObjectUtil.isNotEmpty(bizSendOrder.getQuantityRelated())).map(BizSendOrder::getQuantityRelated).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setQuantityRelated(quantityRelated);
|
||||
bizShipmentPlanVo.setQuantityRemain(bizShipmentPlanVo.getQuantityShipped().subtract(quantityRelated));
|
||||
}
|
||||
bizShipmentPlanVo.setDetailList(bizLogisticsOrderDetails1);
|
||||
if (CollectionUtil.isNotEmpty(bizLogisticsOrderDetails1)) {
|
||||
BizLogisticsOrderDetail bizLogisticsOrderDetail = bizLogisticsOrderDetails1.get(0);
|
||||
bizShipmentPlanVo.setTrackingNumber(bizLogisticsOrderDetail.getTrackingNumber());
|
||||
BigDecimal collect2 = bizLogisticsOrderDetails1.stream().filter(item -> item.getLogisticsWeight() != null).map(BizLogisticsOrderDetail::getLogisticsWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
|
||||
bizShipmentPlanVo.setLogisticWeight(collect2);
|
||||
|
||||
BigDecimal totalVolume = bizLogisticsOrderDetails1.stream().filter(item -> item.getTotalVolume() != null).map(BizLogisticsOrderDetail::getTotalVolume).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setTotalVolume(totalVolume);
|
||||
|
||||
|
||||
BigDecimal l = Optional.ofNullable(bizShipmentPlanVo.getLogisticWeight()).orElse(BigDecimal.ZERO).subtract(Optional.ofNullable(bizShipmentPlanVo.getVendorWeight()).orElse(BigDecimal.ZERO));
|
||||
bizShipmentPlanVo.setWeightDiff(l);
|
||||
}
|
||||
bizShipmentPlanVo.setBoxQuantity(count);
|
||||
bizShipmentPlanVo.setOrder(bizLogisticsOrder);
|
||||
if (bizLogisticsOrder != null) {
|
||||
BizLogisticsQuote bizLogisticsQuote = quoteMap.get(bizLogisticsOrder.getQuoteOrderId());
|
||||
bizShipmentPlanVo.setQuote(bizLogisticsQuote);
|
||||
|
||||
if ("weight".equals(bizShipmentPlanVo.getQuote().getType())) {
|
||||
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(bizShipmentPlanVo.getLogisticWeight()).add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
|
||||
} else if ("total".equals(bizLogisticsQuote.getType())) {
|
||||
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
|
||||
|
||||
} else if ("volume".equals(bizLogisticsQuote.getType())) {
|
||||
bizShipmentPlanVo.setAmountPrice(bizShipmentPlanVo.getQuote().getPrice().multiply(bizShipmentPlanVo.getTotalVolume()).multiply(new BigDecimal("0.000001")).add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
|
||||
}
|
||||
// bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(bizShipmentPlanVo.getLogisticWeight()).add(bizLogisticsQuote.getSurcharge()));
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(sids)) {
|
||||
String storeName = storeNameMap.get(bizShipmentPlanVo.getSid());
|
||||
bizShipmentPlanVo.setSellerName(storeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TableDataInfo.build(bizShipmentPlanOrderVoPage);
|
||||
}
|
||||
|
||||
|
||||
private Map<Long, List<BizSendPlanRelVo>> getSendPlanRel(Set<Long> ids) {
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<BizSendPlanRelVo> relVos = bizSendShipmentPlanRelMapper.querySendOrderPlanRelVo(ids);
|
||||
Set<Long> packIds = relVos.stream().map(BizSendPlanRelVo::getPackId).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isNotEmpty(packIds)) {
|
||||
List<BizPackingSpecsItem> bizPackingSpecsItems = bizPackingSpecsItemMapper.selectList(new LambdaQueryWrapper<BizPackingSpecsItem>().in(BizPackingSpecsItem::getPackingSpecsId, packIds));
|
||||
if (CollectionUtil.isNotEmpty(bizPackingSpecsItems)) {
|
||||
Map<Long, List<BizPackingSpecsItem>> collect = bizPackingSpecsItems.stream().collect(Collectors.groupingBy(BizPackingSpecsItem::getPackingSpecsId));
|
||||
for (BizSendPlanRelVo relVo : relVos) {
|
||||
relVo.setItems(MapstructUtils.convert(collect.get(relVo.getPackId()), BizPackingSpecsItemVo.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
return relVos.stream().collect(Collectors.groupingBy(BizSendPlanRelVo::getShipmentPlanId));
|
||||
}
|
||||
|
||||
@Resource
|
||||
private BizSendOrderMapper orderMapper;
|
||||
|
||||
@ -230,16 +417,16 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
Set<String> shipmentIds = bizShipmentPlanVos.stream().map(BizShipmentPlanVo::getShipmentId).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BizShipmentTracking> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BizShipmentTracking::getShipmentId, shipmentIds);
|
||||
List<BizShipmentTracking> bizShipmentTrackings = bizShipmentTrackingMapper.selectList(queryWrapper);
|
||||
Map<String, Long> collect = bizShipmentTrackings.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
BizShipmentTracking::getShipmentId,
|
||||
Collectors.counting()
|
||||
));
|
||||
for (BizShipmentPlanVo bizShipmentPlanVo : bizShipmentPlanVos) {
|
||||
Long count = collect.get(bizShipmentPlanVo.getShipmentId());
|
||||
bizShipmentPlanVo.setBoxQuantity(count);
|
||||
}
|
||||
// List<BizShipmentTracking> bizShipmentTrackings = bizShipmentTrackingMapper.selectList(queryWrapper);
|
||||
// Map<String, Long> collect = bizShipmentTrackings.stream()
|
||||
// .collect(Collectors.groupingBy(
|
||||
// BizShipmentTracking::getShipmentId,
|
||||
// Collectors.counting()
|
||||
// ));
|
||||
// for (BizShipmentPlanVo bizShipmentPlanVo : bizShipmentPlanVos) {
|
||||
// Long count = collect.get(bizShipmentPlanVo.getShipmentId());
|
||||
// bizShipmentPlanVo.setBoxQuantity(BigDecimal.valueOf(count));
|
||||
// }
|
||||
return bizShipmentPlanVos;
|
||||
}
|
||||
|
||||
@ -385,137 +572,6 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BizShipmentPlanOrderVo> queryPageListOrder(BizShipmentPlanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizShipmentPlan> lqw = buildQueryWrapper(bo);
|
||||
Page<BizShipmentPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
Set<String> shipmentIds = result.getRecords().stream().map(BizShipmentPlanVo::getShipmentId).collect(Collectors.toSet());
|
||||
|
||||
|
||||
List<BizShipmentPlanOrderVo> convert = MapstructUtils.convert(result.getRecords(), BizShipmentPlanOrderVo.class);
|
||||
|
||||
Page<BizShipmentPlanOrderVo> bizShipmentPlanOrderVoPage = new Page<>(result.getCurrent(), result.getSize(), result.getTotal());
|
||||
bizShipmentPlanOrderVoPage.setRecords(convert);
|
||||
|
||||
|
||||
Set<Long> sids = result.getRecords().stream().map(BizShipmentPlanVo::getSid).collect(Collectors.toSet());
|
||||
Map<Long, String> storeNameMap = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(sids)) {
|
||||
storeNameMap = iSysAmazonStoreService.queryBySidList(sids).stream().collect(Collectors.toMap(SysAmazonStore::getSid, SysAmazonStore::getStoreName));
|
||||
}
|
||||
|
||||
|
||||
// Set<Long> senOrderIds = result.getRecords().stream().map(BizShipmentPlanVo::getSendOrderId).collect(Collectors.toSet());
|
||||
// Map<Long, BizSendOrder> sendOrderMap = new HashMap<>();
|
||||
// if (CollectionUtil.isNotEmpty(senOrderIds)) {
|
||||
// sendOrderMap = iSendOrderService.queryBySidList(senOrderIds).stream().collect(Collectors.toMap(BizSendOrder::getId, Function.identity()));
|
||||
// }
|
||||
Set<Long> ids = result.getRecords().stream().map(BizShipmentPlanVo::getId).collect(Collectors.toSet());
|
||||
|
||||
Map<Long, List<BizSendOrder>> resultOrderMap = getOrdersGroupedByShipmentId(ids);
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(shipmentIds)) {
|
||||
LambdaQueryWrapper<BizShipmentTracking> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BizShipmentTracking::getShipmentId, shipmentIds);
|
||||
List<BizShipmentTracking> bizShipmentTrackings = bizShipmentTrackingMapper.selectList(queryWrapper);
|
||||
Map<String, Long> collect = bizShipmentTrackings.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
BizShipmentTracking::getShipmentId,
|
||||
Collectors.counting()
|
||||
));
|
||||
|
||||
LambdaQueryWrapper<BizLogisticsOrder> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(BizLogisticsOrder::getFbaShipmentId, shipmentIds);
|
||||
List<BizLogisticsOrder> bizLogisticsOrders = bizLogisticsOrderMapper.selectList(lambdaQueryWrapper);
|
||||
Set<Long> quoteIds = bizLogisticsOrders.stream().map(BizLogisticsOrder::getQuoteOrderId).collect(Collectors.toSet());
|
||||
List<BizLogisticsQuote> quotes = iLogisticsQuoteService.queryQuoteWithQuoteId(quoteIds);
|
||||
Map<Long, BizLogisticsQuote> quoteMap = quotes.stream().collect(Collectors.toMap(BizLogisticsQuote::getId, Function.identity()));
|
||||
|
||||
|
||||
Map<String, BizLogisticsOrder> orderMap = bizLogisticsOrders.stream().collect(Collectors.toMap(BizLogisticsOrder::getFbaShipmentId, Function.identity(),
|
||||
(existing, replacement) -> existing));
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizLogisticsOrderDetail> orderDetailLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
orderDetailLambdaQueryWrapper.in(BizLogisticsOrderDetail::getFbaShipmentId, shipmentIds);
|
||||
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails = bizLogisticsOrderDetailMapper.selectList(orderDetailLambdaQueryWrapper);
|
||||
Map<String, List<BizLogisticsOrderDetail>> detailMap = bizLogisticsOrderDetails.stream().collect(Collectors.groupingBy(BizLogisticsOrderDetail::getFbaShipmentId));
|
||||
|
||||
|
||||
LambdaQueryWrapper<BizShipmentItem> bizShipmentItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
bizShipmentItemLambdaQueryWrapper.in(BizShipmentItem::getShipmentId, shipmentIds);
|
||||
List<BizShipmentItem> bizShipmentItems = bizShipmentItemMapper.selectList(bizShipmentItemLambdaQueryWrapper);
|
||||
Map<String, List<BizShipmentItem>> collect1 = bizShipmentItems.stream().collect(Collectors.groupingBy(BizShipmentItem::getShipmentId, Collectors.toList()));
|
||||
|
||||
|
||||
for (BizShipmentPlanOrderVo bizShipmentPlanVo : bizShipmentPlanOrderVoPage.getRecords()) {
|
||||
Long count = collect.get(bizShipmentPlanVo.getShipmentId());
|
||||
BizLogisticsOrder bizLogisticsOrder = orderMap.get(bizShipmentPlanVo.getShipmentId());
|
||||
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails1 = detailMap.get(bizShipmentPlanVo.getShipmentId());
|
||||
|
||||
List<BizShipmentItem> bizShipmentItems1 = collect1.get(bizShipmentPlanVo.getShipmentId());
|
||||
bizShipmentPlanVo.setItemVoList(bizShipmentItems1);
|
||||
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO,BigDecimal::add);
|
||||
bizShipmentPlanVo.setQuantityShipped(sum);
|
||||
|
||||
|
||||
// BizSendOrder bizSendOrder = sendOrderMap.get(bizShipmentPlanVo.getSendOrderId());
|
||||
// if (bizSendOrder != null) {
|
||||
// bizShipmentPlanVo.setSendOrder(sendOrderMap.get(bizShipmentPlanVo.getSendOrderId()));
|
||||
// }
|
||||
|
||||
List<BizSendOrder> bizSendOrders = resultOrderMap.get(bizShipmentPlanVo.getId());
|
||||
bizShipmentPlanVo.setSendOrders(bizSendOrders);
|
||||
BigDecimal reduce = bizSendOrders.stream().filter(bizSendOrder -> ObjectUtil.isNotEmpty(bizSendOrder.getWeightPerBox())).map(BizSendOrder::getWeightPerBox).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setVendorWeight(reduce);
|
||||
|
||||
BigDecimal quantityRelated = bizSendOrders.stream().filter(bizSendOrder -> ObjectUtil.isNotEmpty(bizSendOrder.getQuantitySend())).map(BizSendOrder::getQuantitySend).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setQuantityRelated(quantityRelated);
|
||||
bizShipmentPlanVo.setQuantityRemain(bizShipmentPlanVo.getQuantityShipped().subtract(quantityRelated));
|
||||
|
||||
bizShipmentPlanVo.setDetailList(bizLogisticsOrderDetails1);
|
||||
if (CollectionUtil.isNotEmpty(bizLogisticsOrderDetails1)) {
|
||||
BizLogisticsOrderDetail bizLogisticsOrderDetail = bizLogisticsOrderDetails1.get(0);
|
||||
bizShipmentPlanVo.setTrackingNumber(bizLogisticsOrderDetail.getTrackingNumber());
|
||||
BigDecimal collect2 = bizLogisticsOrderDetails1.stream().filter(item -> item.getLogisticsWeight() != null).map(BizLogisticsOrderDetail::getLogisticsWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
|
||||
bizShipmentPlanVo.setLogisticWeight(collect2);
|
||||
|
||||
BigDecimal totalVolume = bizLogisticsOrderDetails1.stream().filter(item -> item.getTotalVolume() != null).map(BizLogisticsOrderDetail::getTotalVolume).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
bizShipmentPlanVo.setTotalVolume(totalVolume);
|
||||
|
||||
|
||||
BigDecimal l = Optional.ofNullable(bizShipmentPlanVo.getLogisticWeight()).orElse(BigDecimal.ZERO).subtract(Optional.ofNullable(bizShipmentPlanVo.getVendorWeight()).orElse(BigDecimal.ZERO));
|
||||
bizShipmentPlanVo.setWeightDiff(l);
|
||||
}
|
||||
bizShipmentPlanVo.setBoxQuantity(count);
|
||||
bizShipmentPlanVo.setOrder(bizLogisticsOrder);
|
||||
if (bizLogisticsOrder != null) {
|
||||
BizLogisticsQuote bizLogisticsQuote = quoteMap.get(bizLogisticsOrder.getQuoteOrderId());
|
||||
bizShipmentPlanVo.setQuote(bizLogisticsQuote);
|
||||
|
||||
if ("weight".equals(bizShipmentPlanVo.getQuote().getType())) {
|
||||
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(bizShipmentPlanVo.getLogisticWeight()).add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
|
||||
} else if ("total".equals(bizLogisticsQuote.getType())) {
|
||||
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
|
||||
|
||||
} else if ("volume".equals(bizLogisticsQuote.getType())) {
|
||||
bizShipmentPlanVo.setAmountPrice(bizShipmentPlanVo.getQuote().getPrice().multiply(bizShipmentPlanVo.getTotalVolume()).multiply(new BigDecimal("0.000001")).add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
|
||||
}
|
||||
// bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(bizShipmentPlanVo.getLogisticWeight()).add(bizLogisticsQuote.getSurcharge()));
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(sids)) {
|
||||
String storeName = storeNameMap.get(bizShipmentPlanVo.getSid());
|
||||
bizShipmentPlanVo.setSellerName(storeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TableDataInfo.build(bizShipmentPlanOrderVoPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatusbyFbaShipmentIds(List<String> fbaShipmentids) {
|
||||
|
||||
@ -0,0 +1,156 @@
|
||||
package org.asinkj.amz.service.impl;
|
||||
|
||||
import org.asinkj.amz.domain.bo.BizStoreUserRelListBo;
|
||||
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.BizStoreUserRelBo;
|
||||
import org.asinkj.amz.domain.vo.BizStoreUserRelVo;
|
||||
import org.asinkj.amz.domain.BizStoreUserRel;
|
||||
import org.asinkj.amz.mapper.BizStoreUserRelMapper;
|
||||
import org.asinkj.amz.service.IBizStoreUserRelService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户店铺关联Service业务层处理
|
||||
*
|
||||
* @author shuo hu
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BizStoreUserRelServiceImpl implements IBizStoreUserRelService {
|
||||
|
||||
private final BizStoreUserRelMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询用户店铺关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 用户店铺关联
|
||||
*/
|
||||
@Override
|
||||
public BizStoreUserRelVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户店铺关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 用户店铺关联分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BizStoreUserRelVo> queryPageList(BizStoreUserRelBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizStoreUserRel> lqw = buildQueryWrapper(bo);
|
||||
Page<BizStoreUserRelVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的用户店铺关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 用户店铺关联列表
|
||||
*/
|
||||
@Override
|
||||
public List<BizStoreUserRelVo> queryList(BizStoreUserRelBo bo) {
|
||||
LambdaQueryWrapper<BizStoreUserRel> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizStoreUserRel> buildQueryWrapper(BizStoreUserRelBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BizStoreUserRel> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getStoreId() != null, BizStoreUserRel::getStoreId, bo.getStoreId());
|
||||
lqw.eq(bo.getUserId() != null, BizStoreUserRel::getUserId, bo.getUserId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户店铺关联
|
||||
*
|
||||
* @param bo 用户店铺关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BizStoreUserRelBo bo) {
|
||||
BizStoreUserRel add = MapstructUtils.convert(bo, BizStoreUserRel.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户店铺关联
|
||||
*
|
||||
* @param bo 用户店铺关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BizStoreUserRelBo bo) {
|
||||
BizStoreUserRel update = MapstructUtils.convert(bo, BizStoreUserRel.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BizStoreUserRel entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除用户店铺关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateUsers(BizStoreUserRelListBo bo) {
|
||||
|
||||
LambdaQueryWrapper<BizStoreUserRel> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BizStoreUserRel::getStoreId, bo.getStoreId());
|
||||
baseMapper.delete(wrapper);
|
||||
ArrayList<BizStoreUserRel> bizStoreUserRels = new ArrayList<>();
|
||||
for (Long l : bo.getUserId()) {
|
||||
BizStoreUserRel bizStoreUserRel = new BizStoreUserRel();
|
||||
bizStoreUserRel.setStoreId(bo.getStoreId());
|
||||
bizStoreUserRel.setStoreName(bo.getStoreName());
|
||||
bizStoreUserRel.setUserId(l);
|
||||
bizStoreUserRels.add(bizStoreUserRel);
|
||||
}
|
||||
baseMapper.insertBatch(bizStoreUserRels);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> queryStoreName(Long userId) {
|
||||
List<BizStoreUserRel> list = baseMapper.selectList(new LambdaQueryWrapper<BizStoreUserRel>().eq(BizStoreUserRel::getUserId, userId));
|
||||
return list.stream().map(BizStoreUserRel::getStoreName).collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,7 @@ import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.asinkj.amz.domain.*;
|
||||
import org.asinkj.amz.domain.vo.BizStoreUserRelVo;
|
||||
import org.asinkj.amz.mapper.*;
|
||||
import org.asinkj.amz.service.LingxinCallback;
|
||||
import org.asinkj.asinking.entity.*;
|
||||
@ -94,6 +95,12 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
||||
@Resource
|
||||
private BizOrderOutItemMapper bizOrderOutItemMapper;
|
||||
|
||||
@Resource
|
||||
private BizStoreUserRelMapper bizStoreUserRelMapper;
|
||||
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
|
||||
@Value("${lingxing.appId}")
|
||||
private String appId;
|
||||
@ -126,6 +133,31 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
||||
public TableDataInfo<SysAmazonStoreVo> queryPageList(SysAmazonStoreBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysAmazonStore> lqw = buildQueryWrapper(bo);
|
||||
Page<SysAmazonStoreVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
|
||||
List<SysAmazonStoreVo> records = result.getRecords();
|
||||
List<Long> collect = records.stream().map(SysAmazonStoreVo::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<BizStoreUserRel> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(BizStoreUserRel::getStoreId, collect);
|
||||
List<BizStoreUserRel> list = bizStoreUserRelMapper.selectList(wrapper);
|
||||
Set<Long> userIds = list.stream().map(BizStoreUserRel::getUserId).collect(Collectors.toSet());
|
||||
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(SysUser::getUserId, userIds);
|
||||
List<SysUser> sysUsers = sysUserMapper.selectList(queryWrapper);
|
||||
Map<Long, SysUser> userMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
|
||||
List<BizStoreUserRelVo> convert = MapstructUtils.convert(list, BizStoreUserRelVo.class);
|
||||
for (BizStoreUserRelVo bizStoreUserRelVo : convert) {
|
||||
bizStoreUserRelVo.setUser(userMap.get(bizStoreUserRelVo.getUserId()));
|
||||
}
|
||||
|
||||
Map<Long, List<BizStoreUserRelVo>> collect1 = convert.stream().collect(Collectors.groupingBy(BizStoreUserRelVo::getStoreId));
|
||||
records.forEach(item -> {
|
||||
List<BizStoreUserRelVo> bizStoreUserRelVos = collect1.get(item.getId());
|
||||
if (CollectionUtil.isNotEmpty(bizStoreUserRelVos)) {
|
||||
List<SysUser> list1 = bizStoreUserRelVos.stream().map(BizStoreUserRelVo::getUser).toList();
|
||||
item.setUsers(list1);
|
||||
}
|
||||
});
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@ -998,7 +1030,7 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
|
||||
Map<String, Long> collect = bizTrackingList.stream().collect(Collectors.groupingBy(BizShipmentTracking::getShipmentId,
|
||||
Collectors.counting()));
|
||||
for (BizShipmentPlan bizShipmentPlan : readyToShip) {
|
||||
bizShipmentPlan.setBoxQuantity(collect.get(bizShipmentPlan.getShipmentId()));
|
||||
bizShipmentPlan.setBoxQuantity(BigDecimal.valueOf(collect.get(bizShipmentPlan.getShipmentId())));
|
||||
}
|
||||
|
||||
bizShipmentPlanMapper.insertBatch(readyToShip);
|
||||
|
||||
@ -12,6 +12,7 @@ public class SerialNoGenerator {
|
||||
|
||||
/**
|
||||
* 生成询价单号(格式:INQ+年月日+6位序列)
|
||||
*
|
||||
* @return 示例:INQ20231023000001
|
||||
*/
|
||||
public static String generateInquiryNo() {
|
||||
@ -75,4 +76,37 @@ public class SerialNoGenerator {
|
||||
// 6. 格式化输出
|
||||
return String.format("ORDER%s%06d", datePart, sequence);
|
||||
}
|
||||
|
||||
public static String generateMixOrderNo() {
|
||||
// 1. 生成日期部分
|
||||
String datePart = LocalDate.now(ZoneId.of("Asia/Shanghai"))
|
||||
.format(DateTimeFormatter.ofPattern("yyMMdd"));
|
||||
|
||||
// 2. 构建Redis键
|
||||
String redisKey = "order:hp:" + datePart;
|
||||
|
||||
// 3. 原子递增序列号
|
||||
long sequence = RedisUtils.incrAtomicValue(redisKey);
|
||||
|
||||
// 4. 首次生成时设置过期时间(次日凌晨过期)
|
||||
if (sequence == 1L) {
|
||||
LocalDateTime now = LocalDateTime.now(ZoneId.of("Asia/Shanghai"));
|
||||
LocalDateTime expirationTime = now.toLocalDate()
|
||||
.plusDays(1)
|
||||
.atStartOfDay();
|
||||
|
||||
Duration ttl = Duration.between(now, expirationTime);
|
||||
RedisUtils.expire(redisKey, ttl);
|
||||
}
|
||||
|
||||
// 5. 校验序列号范围(根据业务需求可选)
|
||||
if (sequence > 9_999L) {
|
||||
throw new IllegalStateException("当日序列号已用尽");
|
||||
}
|
||||
|
||||
// 6. 格式化输出
|
||||
return String.format("HP%s%04d", datePart, sequence);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -11,18 +11,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="item.logisticsStatus != null">
|
||||
logistics_status = #{item.logisticsStatus},
|
||||
</if>
|
||||
<if test="item.logisticsProviderName != null and item.logisticsProviderName != ''">
|
||||
logistics_provider_name = #{item.logisticsProviderName},
|
||||
</if>
|
||||
<if test="item.trackingNumber != null and item.trackingNumber != ''">
|
||||
tracking_number = #{item.trackingNumber},
|
||||
</if>
|
||||
<if test="item.logisticsWeight != null and item.logisticsWeight != ''">
|
||||
logistics_weight = #{item.logisticsWeight},
|
||||
</if>
|
||||
<if test="item.length != null and item.length != ''">
|
||||
length = #{item.length},
|
||||
</if>
|
||||
<if test="item.width != null and item.width != ''">
|
||||
width = #{item.width},
|
||||
</if>
|
||||
<if test="item.height != null and item.height != ''">
|
||||
height = #{item.height},
|
||||
</if>
|
||||
<if test="item.actualDeliveryDate != null and item.actualDeliveryDate != ''">
|
||||
actual_delivery_date = #{item.actualDeliveryDate},
|
||||
</if>
|
||||
<if test="item.goodsReceiptTime != null and item.actualDeliveryDate != ''">
|
||||
goods_receipt_time = #{item.goodsReceiptTime},
|
||||
</if>
|
||||
<if test="item.transferStartTime != null and item.transferStartTime != ''">
|
||||
transfer_start_time = #{item.transferStartTime},
|
||||
</if>
|
||||
<if test="item.signedTime != null and item.signedTime != ''">
|
||||
signed_time = #{item.signedTime},
|
||||
</if>
|
||||
<if test="item.scheduleTime != null and item.scheduleTime != ''">
|
||||
schedule_time = #{item.scheduleTime},
|
||||
</if>
|
||||
<if test="item.vesselDepartTime != null and item.vesselDepartTime != ''">
|
||||
vessel_depart_time = #{item.vesselDepartTime},
|
||||
</if>
|
||||
<if test="item.portArrivalTime != null and item.portArrivalTime != ''">
|
||||
port_arrival_time = #{item.portArrivalTime},
|
||||
</if>
|
||||
<if test="item.inspectionTime != null and item.inspectionTime != ''">
|
||||
inspection_time = #{item.inspectionTime},
|
||||
</if>
|
||||
<if test="item.deliveryPickupTime != null and item.deliveryPickupTime != ''">
|
||||
delivery_pickup_time = #{item.deliveryPickupTime},
|
||||
</if>
|
||||
<if test="item.totalVolume != null and item.totalVolume != ''">
|
||||
total_volume = #{item.totalVolume},
|
||||
</if>
|
||||
</set>
|
||||
WHERE fba_box_number = #{item.fbaBoxNumber}
|
||||
</foreach>
|
||||
|
||||
@ -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.BizPackingSpecsItemMapper">
|
||||
|
||||
</mapper>
|
||||
@ -4,4 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.asinkj.amz.mapper.BizPurchaseOrderMapper">
|
||||
|
||||
|
||||
<select id="selectCustomPage" resultType="org.asinkj.amz.domain.vo.BizPurchaseOrderVo">
|
||||
SELECT
|
||||
req.*
|
||||
FROM biz_purchase_order req
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
o.product_name AS "order.productName",
|
||||
o.quantity_send AS "order.quantitySend",
|
||||
o.quantity_per_box AS "order.quantityPerBox",
|
||||
o.box_count AS "order.boxCount",
|
||||
rel.carton_count AS "order.boxCount",
|
||||
o.box_dimensions AS "order.boxDimensions",
|
||||
o.weight_per_box AS "order.weightPerBox",
|
||||
o.real_store_name AS "order.realStoreName",
|
||||
@ -32,9 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
o.send_detail AS "order.sendDetail",
|
||||
o.logistics_provider_name AS "order.logisticsProviderName",
|
||||
o.order_detail_id AS "order.orderDetailId",
|
||||
o.shipment_id AS "order.shipmentId"
|
||||
o.shipment_id AS "order.shipmentId",
|
||||
bps.pieces_per_carton AS "order.piecesPerCarton" ,
|
||||
bps.pieces_per_carton * rel.carton_count AS "order.quantityRelated"
|
||||
FROM biz_send_order o
|
||||
INNER JOIN biz_send_shipment_rel rel ON o.id = rel.send_order_id
|
||||
INNER JOIN biz_send_shipment_plan_rel rel ON o.id = rel.send_order_id
|
||||
left join biz_packing_specs bps ON bps.id = rel.pack_id
|
||||
WHERE rel.shipment_plan_id IN
|
||||
<foreach item="id" collection="shipmentIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
@ -44,9 +47,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
req.*
|
||||
FROM biz_send_order req
|
||||
-- LEFT JOIN biz_send_shipment_plan_rel det ON req.id = det.send_order_id
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
<!--<if test="finish != null">-->
|
||||
<!-- <!– 当finish为false时,使用小于 –>-->
|
||||
<!-- <if test="!finish">-->
|
||||
<!-- GROUP BY req.id-->
|
||||
<!-- HAVING COALESCE(SUM(det.carton_count), 0) < MAX(req.box_count)-->
|
||||
<!-- </if>-->
|
||||
<!-- <!– 当finish为true时,使用大于 –>-->
|
||||
<!-- <if test="finish">-->
|
||||
<!-- GROUP BY req.id-->
|
||||
<!-- HAVING COALESCE(SUM(det.carton_count), 0) > MAX(req.box_count)-->
|
||||
<!-- </if>-->
|
||||
<!--</if>-->
|
||||
ORDER BY req.create_time DESC
|
||||
</select>
|
||||
<select id="selectCustomPackPage" resultType="org.asinkj.amz.domain.vo.BizSendOrderPackVo">
|
||||
SELECT
|
||||
bps.id as pkid,
|
||||
bps.carton_count,
|
||||
bps.pieces_per_carton,
|
||||
bps.length,
|
||||
bps.width,
|
||||
bps.height,
|
||||
bps.weight,
|
||||
bssr.carton_count as link_carton_count,
|
||||
bso.*
|
||||
FROM biz_packing_specs bps
|
||||
INNER JOIN (
|
||||
SELECT *
|
||||
FROM biz_send_order
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
) bso ON bps.send_order_id = bso.id
|
||||
LEFT JOIN biz_send_shipment_plan_rel bssr ON bssr.pack_id = bps.id
|
||||
ORDER BY order_sn DESC,id DESC
|
||||
</select>
|
||||
<select id="selectLinkMixSendOrderList" resultType="org.asinkj.amz.domain.vo.BizSendOrderPackVo">
|
||||
|
||||
</select>
|
||||
|
||||
<resultMap id="orderWithShipmentMap" type="org.asinkj.amz.domain.OrderWithShipment">
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
<?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.BizSendShipmentPlanRelMapper">
|
||||
|
||||
<select id="selectCustomPage" resultType="org.asinkj.amz.domain.vo.BizSendPlanRelVo">
|
||||
SELECT
|
||||
bso.order_sn,
|
||||
bso.product_name,
|
||||
bsspr.sku,
|
||||
bps.length,
|
||||
bps.width,
|
||||
bps.height,
|
||||
bps.weight,
|
||||
bsspr.carton_count,
|
||||
bsspr.create_time
|
||||
FROM biz_send_shipment_plan_rel bsspr
|
||||
LEFT JOIN biz_send_order bso ON bso.id = bsspr.send_order_id
|
||||
LEFT JOIN biz_shipment_plan bsp ON bsp.id = bsspr.shipment_plan_id
|
||||
LEFT JOIN biz_packing_specs bps ON bps.id = bsspr.pack_id
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="querySendPlanRelVo" resultType="org.asinkj.amz.domain.vo.BizSendPlanRelVo">
|
||||
SELECT
|
||||
bso.id as send_order_id,
|
||||
bso.order_sn,
|
||||
bso.product_name,
|
||||
bsspr.sku,
|
||||
bps.length,
|
||||
bps.width,
|
||||
bps.height,
|
||||
bps.weight,
|
||||
bsspr.carton_count,
|
||||
bps.pieces_per_carton,
|
||||
bsspr.create_time,
|
||||
bsp.shipment_id,
|
||||
bl.logistics_provider_name,
|
||||
sys_user.address
|
||||
FROM biz_send_shipment_plan_rel bsspr
|
||||
LEFT JOIN biz_send_order bso ON bso.id = bsspr.send_order_id
|
||||
LEFT JOIN biz_shipment_plan bsp ON bsp.id = bsspr.shipment_plan_id
|
||||
LEFT JOIN biz_packing_specs bps ON bps.id = bsspr.pack_id
|
||||
LEFT JOIN biz_logistics_order bl ON bl.fba_shipment_id = bsp.shipment_id
|
||||
LEFT JOIN sys_user ON bl.logistics_provider_id = sys_user.user_id
|
||||
<where>
|
||||
<if test="sendIds != null">
|
||||
bso.id IN
|
||||
<foreach collection="sendIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="querySendOrderPlanRelVo" resultType="org.asinkj.amz.domain.vo.BizSendPlanRelVo">
|
||||
SELECT
|
||||
bso.id as send_order_id,
|
||||
bsp.id as shipment_plan_id,
|
||||
bps.id as pack_id,
|
||||
bso.order_sn,
|
||||
bso.product_name,
|
||||
bsspr.sku,
|
||||
bps.length,
|
||||
bps.width,
|
||||
bps.height,
|
||||
bps.weight,
|
||||
bsspr.carton_count,
|
||||
bps.pieces_per_carton,
|
||||
bsspr.create_time,
|
||||
bsp.shipment_id,
|
||||
bl.logistics_provider_name,
|
||||
sys_user.address
|
||||
FROM biz_send_shipment_plan_rel bsspr
|
||||
LEFT JOIN biz_send_order bso ON bso.id = bsspr.send_order_id
|
||||
LEFT JOIN biz_shipment_plan bsp ON bsp.id = bsspr.shipment_plan_id
|
||||
LEFT JOIN biz_packing_specs bps ON bps.id = bsspr.pack_id
|
||||
LEFT JOIN biz_logistics_order bl ON bl.fba_shipment_id = bsp.shipment_id
|
||||
LEFT JOIN sys_user ON bl.logistics_provider_id = sys_user.user_id
|
||||
<where>
|
||||
<if test="planIds != null">
|
||||
bsp.id IN
|
||||
<foreach collection="planIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
send_order_id,
|
||||
shipment_plan_id
|
||||
FROM biz_send_shipment_rel
|
||||
FROM biz_send_shipment_plan_rel
|
||||
WHERE send_order_id IN
|
||||
<foreach item="id" collection="sendOrderIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM biz_send_order o
|
||||
|
||||
<!-- 关联路径:发货单 → 关联表 → 货运计划 → 询价单-->
|
||||
INNER JOIN biz_send_shipment_rel rel ON o.id = rel.send_order_id
|
||||
INNER JOIN biz_send_shipment_plan_rel rel ON o.id = rel.send_order_id
|
||||
INNER JOIN biz_shipment_plan plan ON plan.id = rel.shipment_plan_id
|
||||
INNER JOIN biz_inquiry_request req ON req.shipment_id = plan.shipment_id
|
||||
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
<?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.BizStoreUserRelMapper">
|
||||
|
||||
<select id="selectCustom" resultType="org.asinkj.amz.domain.vo.BizStoreUserRelVo">
|
||||
select *
|
||||
from biz_store_user_rel bsur
|
||||
left join sys_user su on bsur.user_id = su.user_id
|
||||
<where>
|
||||
<if test="storeIds != null">
|
||||
store_id in
|
||||
<foreach item="item" collection="storeIds" separator="," open="(" close=")" index="">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user