feat(oms/wms): 出入库明细查询-已入库/已出库状态过滤、WMS新增出入库明细查询页面及专用导出
一、OMS 入库/出库明细查询(修复+导出) - 出库明细SQL状态过滤由=9改为in(9,12,13):已出库/已复核/已交接均算已出库,与出库排名统计口径一致 - 入库明细SQL固定只统计已入库(status=5)单据 - 入/出库明细SQL新增实际入仓/出仓日期区间过滤(IFNULL(实际日期,建档时间)兜底),支持统计当天 - 新增Excel导出接口 /executionInMaterialDetailApi/exportWithOrder、/executionOutMaterialDetailApi/exportWithOrder(全量不分页) - 退货回仓统计:通过入库单类型 inOrderTypeCode=tui_huo_ru_ku(退货入库)过滤 二、WMS 新增入库/出库明细查询页面 - 入库明细查询:GET /materialDetailApi/listWithOrder(明细关联入库单,固定已入库(5),level=1防父子行重复计数) - 出库明细查询:GET /outMaterialDetailApi/listWithOrder(新建OutMaterialDetailApi,关联出库单,固定in(9,12,13)) - 返回单头字段:单据状态/审核状态/货主/供应商/客户/单据类型/实际入仓出仓日期/保额/货物类型等 - 入库客户编号/名称/客户预约名称经通知单号关联notice_order取得(入库单表无客户字段) 三、WMS 明细导出专用列集 - 出库导出/exportWithOrder:按客户要求30列导出,含出库单号/出库日期/客户信息/LOT号/费用组(单价、总价、折扣、仓租、合同收费)等 - 入库导出/exportWithOrder:按客户要求30列导出,含客户信息/入库日期/每件保额/收费标准/有效期等 - 单据状态、货物种类导出时自动转文字;导出列顺序与客户清单一致 - 火险保费、入库单件净重(KG)暂无数据来源,导出空列占位,待确认数据来源后补充 四、其他 - 查询条件不传日期时默认查全部日期,统计当天由前端传当天日期区间实现 - 数据权限:非平台超管按登录人一级组织过滤
This commit is contained in:
+8
@@ -1,5 +1,7 @@
|
||||
package com.mhd.oms.domain.executionInMaterialDetail.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -16,20 +18,26 @@ public class ExecutionInMaterialDetailWithOrderPO extends ExecutionInMaterialDet
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
@Excel(name = "入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
private Integer inOrderStatus;
|
||||
|
||||
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer inOrderAuditStatus;
|
||||
|
||||
@ApiModelProperty("货主ID")
|
||||
private Long orderShipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
@Excel(name = "货主编码")
|
||||
private String orderShipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String orderShipperName;
|
||||
|
||||
@ApiModelProperty("入库日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date warehouseDate;
|
||||
}
|
||||
|
||||
+6
@@ -66,4 +66,10 @@ public class ExecutionInMaterialDetailQueryDTO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateStart;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateEnd;
|
||||
}
|
||||
|
||||
+6
@@ -137,4 +137,10 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
||||
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||
private Integer overStockStatus;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateStart;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateEnd;
|
||||
}
|
||||
+9
@@ -1,6 +1,7 @@
|
||||
package com.mhd.oms.domain.executionOutMaterialDetail.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -19,33 +20,41 @@ public class ExecutionOutMaterialDetailWithOrderPO extends ExecutionOutMaterialD
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
@Excel(name = "出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||
private Integer outOrderStatus;
|
||||
|
||||
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer outOrderAuditStatus;
|
||||
|
||||
@ApiModelProperty("货主ID")
|
||||
private Long orderShipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
@Excel(name = "货主编码")
|
||||
private String orderShipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String orderShipperName;
|
||||
|
||||
@ApiModelProperty("出仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderOutboundDate;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderOutboundTime;
|
||||
|
||||
@ApiModelProperty("保额")
|
||||
@Excel(name = "保额")
|
||||
private BigDecimal insureAmount;
|
||||
|
||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型: 0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
}
|
||||
|
||||
+6
@@ -66,4 +66,10 @@ public class ExecutionOutMaterialDetailQueryDTO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateStart;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateEnd;
|
||||
}
|
||||
|
||||
+6
@@ -137,4 +137,10 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
||||
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||
private Integer overStockStatus;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateStart;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateEnd;
|
||||
}
|
||||
+23
@@ -3,6 +3,7 @@ package com.mhd.oms.interfaces.facade.executionInMaterialDetail;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||
@@ -16,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -96,4 +99,24 @@ public class ExecutionInMaterialDetailApi extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库明细查询Excel(关联入库执行单,全量不分页;
|
||||
* SQL固定只统计已入库(5)单据,可按单据类型(如退货入库tui_huo_ru_ku)与实际入仓日期区间过滤)
|
||||
*/
|
||||
@ApiOperation("导出入库明细查询Excel")
|
||||
@GetMapping("/exportWithOrder")
|
||||
public void exportWithOrder(HttpServletResponse response, ExecutionInMaterialDetailQueryDTO queryDTO) throws Exception
|
||||
{
|
||||
//转换实体(不分页,导出全量)
|
||||
QueryOrderOverStockDO queryDO = inMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
List<ExecutionInMaterialDetailWithOrderPO> list = inMaterialDetailApplicationService.queryInOrderDetailList(queryDO);
|
||||
|
||||
String fileName = URLEncoder.encode("入库明细查询", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||
ExcelUtil<ExecutionInMaterialDetailWithOrderPO> util = new ExcelUtil<>(ExecutionInMaterialDetailWithOrderPO.class);
|
||||
util.exportExcel(response, list, "入库明细查询");
|
||||
}
|
||||
|
||||
}
|
||||
+22
@@ -2,6 +2,7 @@ package com.mhd.oms.interfaces.facade.executionOutMaterialDetail;
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailQueryDTO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.service.ExecutionOutMaterialDetailApplicationService;
|
||||
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -41,4 +44,23 @@ public class ExecutionOutMaterialDetailApi extends BaseController {
|
||||
List<ExecutionOutMaterialDetailWithOrderPO> list = outMaterialDetailApplicationService.queryOutOrderDetailList(queryDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库明细查询Excel(关联出库执行单,全量不分页;
|
||||
* SQL固定只统计已出库(9/12/13)单据,可按单据类型与实际出仓日期区间过滤)
|
||||
*/
|
||||
@ApiOperation("导出出库明细查询Excel")
|
||||
@GetMapping("/exportWithOrder")
|
||||
public void exportWithOrder(HttpServletResponse response, ExecutionOutMaterialDetailQueryDTO queryDTO) throws Exception {
|
||||
//转换实体(不分页,导出全量)
|
||||
QueryOrderOverStockDO queryDO = outMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
List<ExecutionOutMaterialDetailWithOrderPO> list = outMaterialDetailApplicationService.queryOutOrderDetailList(queryDO);
|
||||
|
||||
String fileName = URLEncoder.encode("出库明细查询", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||
ExcelUtil<ExecutionOutMaterialDetailWithOrderPO> util = new ExcelUtil<>(ExecutionOutMaterialDetailWithOrderPO.class);
|
||||
util.exportExcel(response, list, "出库明细查询");
|
||||
}
|
||||
}
|
||||
|
||||
+9
-3
@@ -450,15 +450,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
|
||||
and b.order_type_code = #{inOrderTypeCode}
|
||||
</if>
|
||||
<if test="inStatus != null ">
|
||||
and b.status = #{inStatus}
|
||||
</if>
|
||||
<!-- 入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭,只统计已入库(5)的明细 -->
|
||||
and b.status = 5
|
||||
<if test="inOrderExpectStartTime != null">
|
||||
and b.expect_time >= #{inOrderExpectStartTime}
|
||||
</if>
|
||||
<if test="inOrderExpectEndTime != null">
|
||||
and b.expect_time <= #{inOrderExpectEndTime}
|
||||
</if>
|
||||
<!-- 实际入仓日期区间(为空的历史单按建档时间兜底),用于统计当天入库 -->
|
||||
<if test="warehouseDateStart != null and warehouseDateStart != ''">
|
||||
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') >= #{warehouseDateStart}
|
||||
</if>
|
||||
<if test="warehouseDateEnd != null and warehouseDateEnd != ''">
|
||||
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') <= #{warehouseDateEnd}
|
||||
</if>
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
|
||||
+9
-3
@@ -543,15 +543,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
|
||||
and b.order_type_code = #{outOrderTypeCode}
|
||||
</if>
|
||||
<if test="outStatus != null ">
|
||||
and b.status = #{outStatus}
|
||||
</if>
|
||||
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接,只统计已出库(9/12/13)的明细 -->
|
||||
and b.status in (9, 12, 13)
|
||||
<if test="outOrderExpectStartTime != null">
|
||||
and b.expect_time >= #{outOrderExpectStartTime}
|
||||
</if>
|
||||
<if test="outOrderExpectEndTime != null">
|
||||
and b.expect_time <= #{outOrderExpectEndTime}
|
||||
</if>
|
||||
<!-- 实际出仓日期区间(为空的历史单按建档时间兜底),用于统计当天出库 -->
|
||||
<if test="outboundDateStart != null and outboundDateStart != ''">
|
||||
and date_format(IFNULL(b.OUTBOUND_DATE, b.create_time), '%Y-%m-%d') >= #{outboundDateStart}
|
||||
</if>
|
||||
<if test="outboundDateEnd != null and outboundDateEnd != ''">
|
||||
and date_format(IFNULL(b.OUTBOUND_DATE, b.create_time), '%Y-%m-%d') <= #{outboundDateEnd}
|
||||
</if>
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
|
||||
+38
@@ -2,9 +2,12 @@ package com.mhd.wms.application.service.inMaterialDetail;
|
||||
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.service.InMaterialDetailDomainService;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -39,6 +42,41 @@ public class InMaterialDetailApplicationService {
|
||||
return inMaterialDetailDomainService.queryList(inMaterialDetailDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||
*/
|
||||
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
queryOrderOverStockDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
return inMaterialDetailDomainService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||
*/
|
||||
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return inMaterialDetailDomainService.exportInOrderDetailList(setDataPermission(queryOrderOverStockDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据权限:非平台超管(1)按登录人一级组织过滤
|
||||
*/
|
||||
private QueryOrderOverStockDO setDataPermission(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
queryOrderOverStockDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
return queryOrderOverStockDO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物料明细
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.mhd.wms.application.service.outMaterialDetail;
|
||||
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.service.OutMaterialDetailDomainService;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库物料明细ApplicationService
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class OutMaterialDetailApplicationService {
|
||||
@Autowired
|
||||
private OutMaterialDetailDomainService outMaterialDetailDomainService;
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailDomainService.queryOutOrderDetailList(setDataPermission(queryOrderOverStockDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||
*/
|
||||
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailDomainService.exportOutOrderDetailList(setDataPermission(queryOrderOverStockDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据权限:非平台超管(1)按登录人一级组织过滤
|
||||
*/
|
||||
private QueryOrderOverStockDO setDataPermission(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
queryOrderOverStockDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
return queryOrderOverStockDO;
|
||||
}
|
||||
}
|
||||
+12
@@ -2,7 +2,9 @@ package com.mhd.wms.domain.inMaterialDetail.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailBaseDO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
@@ -27,6 +29,16 @@ public interface IInMaterialDetailService extends IService<InMaterialDetail>
|
||||
|
||||
public List<InMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||
*/
|
||||
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||
*/
|
||||
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 分页查询物料明细列表
|
||||
*/
|
||||
|
||||
+12
@@ -2,7 +2,9 @@ package com.mhd.wms.domain.inMaterialDetail.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
@@ -28,6 +30,16 @@ public interface InMaterialDetailMapper extends BaseMapper<InMaterialDetail>
|
||||
*/
|
||||
public List<InMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||
*/
|
||||
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||
*/
|
||||
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 入库列表页:按入库单号批量取去重后的 Invoice No(仅 level=1)
|
||||
*/
|
||||
|
||||
+18
@@ -13,7 +13,9 @@ import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.mapper.InMaterialDetailMapper;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailBaseDO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
@@ -72,6 +74,22 @@ public class InMaterialDetailImpl extends ServiceImpl<InMaterialDetailMapper, In
|
||||
return inMaterialDetailMapper.queryInOrderList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||
*/
|
||||
@Override
|
||||
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return inMaterialDetailMapper.queryInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||
*/
|
||||
@Override
|
||||
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return inMaterialDetailMapper.exportInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料明细列表
|
||||
*/
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.mhd.wms.domain.inMaterialDetail.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入库明细导出专用PO(仅含客户要求的导出列,列顺序即导出顺序;
|
||||
* 火险保费 WMS 库暂无数据来源,先占位导出空列;
|
||||
* 单件净重(KG) 入库明细表无单件净重列,先占位导出空列)
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Data
|
||||
public class InMaterialDetailExportPO {
|
||||
|
||||
@Excel(name = "客户编号", sort = 1)
|
||||
private String customerCode;
|
||||
|
||||
@Excel(name = "客户名称", sort = 2)
|
||||
private String customerName;
|
||||
|
||||
@Excel(name = "入库单号", sort = 3)
|
||||
private String inOrderNumber;
|
||||
|
||||
@Excel(name = "入库日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 4)
|
||||
private Date warehouseDate;
|
||||
|
||||
@Excel(name = "LOT编号", sort = 5)
|
||||
private String lotNo;
|
||||
|
||||
@Excel(name = "客户预约名称", sort = 6)
|
||||
private String customerOrderNumber;
|
||||
|
||||
@Excel(name = "物料名称", sort = 7)
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "物料编码", sort = 8)
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "库存单位", sort = 9)
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "件数", sort = 10)
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
@Excel(name = "仓库", sort = 11)
|
||||
private String warehouseName;
|
||||
|
||||
@Excel(name = "饮用日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 12)
|
||||
private Date drinkDate;
|
||||
|
||||
@Excel(name = "库位", sort = 13)
|
||||
private String storageLocationName;
|
||||
|
||||
@Excel(name = "单件净重(KG)", sort = 14)
|
||||
private BigDecimal netWeight;
|
||||
|
||||
@Excel(name = "单件体积(CBM)", sort = 15)
|
||||
private BigDecimal singleVolume;
|
||||
|
||||
@Excel(name = "单价", sort = 16)
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@Excel(name = "总价", sort = 17)
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Excel(name = "折扣(%)", sort = 18)
|
||||
private BigDecimal discountRate;
|
||||
|
||||
@Excel(name = "每月仓租", sort = 19)
|
||||
private BigDecimal monthlyWarehouseFee;
|
||||
|
||||
@Excel(name = "半月仓租", sort = 20)
|
||||
private BigDecimal halfMonthWhFee;
|
||||
|
||||
@Excel(name = "合同收费", sort = 21)
|
||||
private BigDecimal contractFee;
|
||||
|
||||
@Excel(name = "火险保费", sort = 22)
|
||||
private BigDecimal fireInsureFee;
|
||||
|
||||
@Excel(name = "备注", sort = 23)
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "货物种类", sort = 24, readConverterExp = "0=物料,1=半成品,2=成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@Excel(name = "总重量", sort = 25)
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@Excel(name = "每件保额", sort = 26)
|
||||
private BigDecimal insureAmount;
|
||||
|
||||
@Excel(name = "仓位/库位", sort = 27)
|
||||
private String storageName;
|
||||
|
||||
@Excel(name = "收费标准", sort = 28)
|
||||
private BigDecimal chargeStandard;
|
||||
|
||||
@Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd", sort = 29)
|
||||
private Date expiryDate;
|
||||
|
||||
@Excel(name = "单据状态", sort = 30, readConverterExp = "5=已入库")
|
||||
private Integer inOrderStatus;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.mhd.wms.domain.inMaterialDetail.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入库明细查询结果(关联入库单,只统计已入库单据)
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Data
|
||||
public class InMaterialDetailWithOrderPO extends InMaterialDetailPO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
@Excel(name = "入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
private Integer inOrderStatus;
|
||||
|
||||
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer inOrderAuditStatus;
|
||||
|
||||
@ApiModelProperty("入仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date warehouseDate;
|
||||
|
||||
@ApiModelProperty("保额")
|
||||
@Excel(name = "保额")
|
||||
private BigDecimal insureAmount;
|
||||
|
||||
@ApiModelProperty("货物类型: 0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型: 0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
}
|
||||
+17
@@ -1,8 +1,11 @@
|
||||
package com.mhd.wms.domain.inMaterialDetail.service;
|
||||
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -30,6 +33,20 @@ public class InMaterialDetailDomainService {
|
||||
return materialDetailService.queryList(inMaterialDetailDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||
*/
|
||||
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return materialDetailService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||
*/
|
||||
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return materialDetailService.exportInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物料明细
|
||||
|
||||
+12
@@ -3,7 +3,9 @@ package com.mhd.wms.domain.outMaterialDetail.repository.facade;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialCheckPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailBaseDO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
@@ -32,6 +34,16 @@ public interface IOutMaterialDetailService extends IService<OutMaterialDetail>
|
||||
*/
|
||||
public List<OutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||
*/
|
||||
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
|
||||
|
||||
public List<OutMaterialDetailPO> queryListChildren(OutMaterialDetailDO outMaterialDetailDO);
|
||||
|
||||
+12
@@ -2,7 +2,9 @@ package com.mhd.wms.domain.outMaterialDetail.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
@@ -28,6 +30,16 @@ public interface OutMaterialDetailMapper extends BaseMapper<OutMaterialDetail>
|
||||
*/
|
||||
public List<OutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
/**
|
||||
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||
*/
|
||||
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
|
||||
/**
|
||||
* @description 批量修改指定物料明细分配数量
|
||||
|
||||
+18
@@ -34,7 +34,9 @@ import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialCheckPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailBaseDO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
@@ -107,6 +109,22 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
return outMaterialDetailMapper.queryOutOrderList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
@Override
|
||||
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailMapper.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||
*/
|
||||
@Override
|
||||
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailMapper.exportOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料明细列表
|
||||
*/
|
||||
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
package com.mhd.wms.domain.outMaterialDetail.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 出库明细导出专用PO(仅含客户要求的导出列,列顺序即导出顺序;
|
||||
* 火险保费 WMS 库暂无数据来源,先占位导出空列)
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Data
|
||||
public class OutMaterialDetailExportPO {
|
||||
|
||||
@Excel(name = "出库单号", sort = 1)
|
||||
private String outOrderNumber;
|
||||
|
||||
@Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 2)
|
||||
private Date outboundDate;
|
||||
|
||||
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 3)
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "客户编号", sort = 4)
|
||||
private String customerCode;
|
||||
|
||||
@Excel(name = "客户名称", sort = 5)
|
||||
private String customerName;
|
||||
|
||||
@Excel(name = "LOT编号", sort = 6)
|
||||
private String lotNo;
|
||||
|
||||
@Excel(name = "客户预约名称", sort = 7)
|
||||
private String customerOrderNumber;
|
||||
|
||||
@Excel(name = "物料名称", sort = 8)
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "物料编码", sort = 9)
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "库存单位", sort = 10)
|
||||
private String stockUnit;
|
||||
|
||||
@Excel(name = "件数", sort = 11)
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
@Excel(name = "仓库", sort = 12)
|
||||
private String warehouseName;
|
||||
|
||||
@Excel(name = "饮用日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 13)
|
||||
private Date drinkDate;
|
||||
|
||||
@Excel(name = "库位", sort = 14)
|
||||
private String storageLocationName;
|
||||
|
||||
@Excel(name = "单件净重(KG)", sort = 15)
|
||||
private BigDecimal weightLimit;
|
||||
|
||||
@Excel(name = "单件体积(CBM)", sort = 16)
|
||||
private BigDecimal singleVolume;
|
||||
|
||||
@Excel(name = "单价", sort = 17)
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@Excel(name = "总价", sort = 18)
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Excel(name = "折扣(%)", sort = 19)
|
||||
private BigDecimal discountRate;
|
||||
|
||||
@Excel(name = "每月仓租", sort = 20)
|
||||
private BigDecimal monthlyWarehouseFee;
|
||||
|
||||
@Excel(name = "半月仓租", sort = 21)
|
||||
private BigDecimal halfMonthWhFee;
|
||||
|
||||
@Excel(name = "合同收费", sort = 22)
|
||||
private BigDecimal contractFee;
|
||||
|
||||
@Excel(name = "火险保费", sort = 23)
|
||||
private BigDecimal fireInsureFee;
|
||||
|
||||
@Excel(name = "备注", sort = 24)
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "总重量(KG)", sort = 25)
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@Excel(name = "仓位/库位", sort = 26)
|
||||
private String storageName;
|
||||
|
||||
@Excel(name = "入库单号", sort = 27)
|
||||
private String inOrderNumber;
|
||||
|
||||
@Excel(name = "种类", sort = 28, readConverterExp = "0=物料,1=半成品,2=成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@Excel(name = "总价值", sort = 29)
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Excel(name = "单据状态", sort = 30, readConverterExp = "9=已出库,12=已复核,13=已交接")
|
||||
private Integer outOrderStatus;
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.mhd.wms.domain.outMaterialDetail.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 出库明细查询结果(关联出库单,只统计已出库单据)
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Data
|
||||
public class OutMaterialDetailWithOrderPO extends OutMaterialDetailPO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("客户id")
|
||||
@Excel(name = "客户id")
|
||||
private Long customerId;
|
||||
|
||||
@ApiModelProperty("客户编码")
|
||||
@Excel(name = "客户编码")
|
||||
private String customerCode;
|
||||
|
||||
@ApiModelProperty("客户名称")
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
@ApiModelProperty("出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||
@Excel(name = "出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||
private Integer outOrderStatus;
|
||||
|
||||
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer outOrderAuditStatus;
|
||||
|
||||
@ApiModelProperty("出仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date outboundDate;
|
||||
|
||||
@ApiModelProperty("保额")
|
||||
@Excel(name = "保额")
|
||||
private BigDecimal insureAmount;
|
||||
|
||||
@ApiModelProperty("货物类型: 0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型: 0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
}
|
||||
+17
@@ -1,8 +1,11 @@
|
||||
package com.mhd.wms.domain.outMaterialDetail.service;
|
||||
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -30,6 +33,20 @@ public class OutMaterialDetailDomainService {
|
||||
return outMaterialDetailService.queryList(outMaterialDetailDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailService.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||
*/
|
||||
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailService.exportOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物料明细
|
||||
|
||||
+12
@@ -137,4 +137,16 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
||||
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||
private Integer overStockStatus;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateStart;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateEnd;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateStart;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateEnd;
|
||||
}
|
||||
|
||||
+12
@@ -8,7 +8,9 @@ import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.wms.interfaces.dto.inMaterialDetail.InMaterialDetailDTO;
|
||||
import com.mhd.wms.interfaces.dto.inMaterialDetail.InMaterialDetailQueryDTO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -32,6 +34,16 @@ public class InMaterialDetailAssembler {
|
||||
return inMaterialDetailDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单)查询参数转换
|
||||
*/
|
||||
public QueryOrderOverStockDO toQueryDO(InMaterialDetailQueryDTO queryDTO) {
|
||||
QueryOrderOverStockDO queryDO = new QueryOrderOverStockDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(queryDTO, queryDO, IgnoreNullUtil.getNullPropertyNames(queryDTO));
|
||||
return queryDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.mhd.wms.interfaces.assember.outMaterialDetail;
|
||||
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.wms.interfaces.dto.outMaterialDetail.OutMaterialDetailDTO;
|
||||
import com.mhd.wms.interfaces.dto.outMaterialDetail.OutMaterialDetailQueryDTO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 出库物料明细Assembler
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Component
|
||||
public class OutMaterialDetailAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public OutMaterialDetailDO toDO(OutMaterialDetailDTO outMaterialDetailDTO) {
|
||||
OutMaterialDetailDO outMaterialDetailDO = new OutMaterialDetailDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(outMaterialDetailDTO, outMaterialDetailDO, IgnoreNullUtil.getNullPropertyNames(outMaterialDetailDTO));
|
||||
return outMaterialDetailDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单)查询参数转换
|
||||
*/
|
||||
public QueryOrderOverStockDO toQueryDO(OutMaterialDetailQueryDTO queryDTO) {
|
||||
QueryOrderOverStockDO queryDO = new QueryOrderOverStockDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(queryDTO, queryDO, IgnoreNullUtil.getNullPropertyNames(queryDTO));
|
||||
return queryDO;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.wms.interfaces.dto.inMaterialDetail;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 入库明细查询参数 DTO(关联入库单,只统计已入库单据)
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Data
|
||||
public class InMaterialDetailQueryDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("入库单类型编码(如退货入库 tui_huo_ru_ku)")
|
||||
private String inOrderTypeCode;
|
||||
|
||||
@ApiModelProperty("物料基础信息id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateStart;
|
||||
|
||||
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String warehouseDateEnd;
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.wms.interfaces.dto.outMaterialDetail;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 出库明细查询参数 DTO(关联出库单,只统计已出库单据)
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@Data
|
||||
public class OutMaterialDetailQueryDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("出库单类型编码")
|
||||
private String outOrderTypeCode;
|
||||
|
||||
@ApiModelProperty("物料基础信息id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateStart;
|
||||
|
||||
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||
private String outboundDateEnd;
|
||||
}
|
||||
+41
@@ -1,18 +1,25 @@
|
||||
package com.mhd.wms.interfaces.facadeApi.inMaterialDetail;
|
||||
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.wms.application.service.inMaterialDetail.InMaterialDetailApplicationService;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.wms.interfaces.assember.inMaterialDetail.InMaterialDetailAssembler;
|
||||
import com.mhd.wms.interfaces.dto.inMaterialDetail.InMaterialDetailDTO;
|
||||
import com.mhd.wms.interfaces.dto.inMaterialDetail.InMaterialDetailQueryDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -43,6 +50,40 @@ public class InMaterialDetailApi extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库单,只统计已入库(5)单据;
|
||||
* 退货回仓按入库单类型 inOrderTypeCode=退货入库(tui_huo_ru_ku) 过滤)
|
||||
*/
|
||||
@ApiOperation("入库明细查询(关联入库单)")
|
||||
@GetMapping("/listWithOrder")
|
||||
public TableDataInfo listWithOrder(InMaterialDetailQueryDTO queryDTO)
|
||||
{
|
||||
//转换实体
|
||||
QueryOrderOverStockDO queryDO = inMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
startPage();
|
||||
List<InMaterialDetailWithOrderPO> list = inMaterialDetailApplicationService.queryInOrderDetailList(queryDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库明细查询Excel(专用列集,全量不分页,只统计已入库(5)单据)
|
||||
*/
|
||||
@ApiOperation("导出入库明细查询Excel")
|
||||
@GetMapping("/exportWithOrder")
|
||||
public void exportWithOrder(HttpServletResponse response, InMaterialDetailQueryDTO queryDTO) throws Exception
|
||||
{
|
||||
//转换实体(不分页,导出全量)
|
||||
QueryOrderOverStockDO queryDO = inMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
List<InMaterialDetailExportPO> list = inMaterialDetailApplicationService.exportInOrderDetailList(queryDO);
|
||||
|
||||
String fileName = URLEncoder.encode("入库明细查询", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||
ExcelUtil<InMaterialDetailExportPO> util = new ExcelUtil<>(InMaterialDetailExportPO.class);
|
||||
util.exportExcel(response, list, "入库明细查询");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑物料明细
|
||||
*/
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.mhd.wms.interfaces.facadeApi.outMaterialDetail;
|
||||
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.wms.application.service.outMaterialDetail.OutMaterialDetailApplicationService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.wms.interfaces.assember.outMaterialDetail.OutMaterialDetailAssembler;
|
||||
import com.mhd.wms.interfaces.dto.outMaterialDetail.OutMaterialDetailQueryDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库物料明细Api
|
||||
*
|
||||
* @author rcx
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/outMaterialDetailApi")
|
||||
public class OutMaterialDetailApi extends BaseController {
|
||||
@Autowired
|
||||
private OutMaterialDetailApplicationService outMaterialDetailApplicationService;
|
||||
@Resource
|
||||
private OutMaterialDetailAssembler outMaterialDetailAssembler;
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
@ApiOperation("出库明细查询(关联出库单)")
|
||||
@GetMapping("/listWithOrder")
|
||||
public TableDataInfo listWithOrder(OutMaterialDetailQueryDTO queryDTO)
|
||||
{
|
||||
//转换实体
|
||||
QueryOrderOverStockDO queryDO = outMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
startPage();
|
||||
List<OutMaterialDetailWithOrderPO> list = outMaterialDetailApplicationService.queryOutOrderDetailList(queryDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库明细查询Excel(专用列集,全量不分页,只统计已出库(9/12/13)单据)
|
||||
*/
|
||||
@ApiOperation("导出出库明细查询Excel")
|
||||
@GetMapping("/exportWithOrder")
|
||||
public void exportWithOrder(HttpServletResponse response, OutMaterialDetailQueryDTO queryDTO) throws Exception
|
||||
{
|
||||
//转换实体(不分页,导出全量)
|
||||
QueryOrderOverStockDO queryDO = outMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
List<OutMaterialDetailExportPO> list = outMaterialDetailApplicationService.exportOutOrderDetailList(queryDO);
|
||||
|
||||
String fileName = URLEncoder.encode("出库明细查询", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||
ExcelUtil<OutMaterialDetailExportPO> util = new ExcelUtil<>(OutMaterialDetailExportPO.class);
|
||||
util.exportExcel(response, list, "出库明细查询");
|
||||
}
|
||||
}
|
||||
@@ -373,6 +373,207 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 出库明细查询结果(关联出库单),在物料明细基础上追加单头通知单号/类型/货主/客户/预计出货时间/出仓日期与货品保额 -->
|
||||
<resultMap type="com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO" id="OutMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
||||
<result property="noticeNumber" column="notice_number" />
|
||||
<result property="shipperId" column="shipper_id" />
|
||||
<result property="shipperCode" column="shipper_code" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<result property="orderTypeCode" column="order_type_code" />
|
||||
<result property="orderTypeName" column="order_type_name" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerCode" column="customer_code" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="expectTime" column="expect_time" />
|
||||
<result property="supplyChainNumber" column="supply_chain_number" />
|
||||
<result property="priorityLevelCode" column="priority_level_code" />
|
||||
<result property="priorityLevelName" column="priority_level_name" />
|
||||
<result property="directWarehouse" column="direct_warehouse" />
|
||||
<result property="annexUrl" column="annex_url" />
|
||||
<result property="outOrderStatus" column="out_order_status" />
|
||||
<result property="outOrderAuditStatus" column="out_order_audit_status"/>
|
||||
<result property="outboundDate" column="outbound_date" />
|
||||
<result property="insureAmount" column="insure_amount" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
</resultMap>
|
||||
|
||||
<!--
|
||||
出库明细查询(关联出库单):
|
||||
口径:仅已出库及后续完成状态(b.status in (9,12,13):已出库/已复核/已交接,与出库排名统计同口径);
|
||||
仅取 level=1 主行防父子行重复计数;
|
||||
实际出仓日期筛选 IFNULL(b.outbound_date, b.create_time);
|
||||
注意:达梦数据库分页包裹查询不允许重复列名,单头列需与明细表 a 列名错开
|
||||
(b.out_order_number、b.warehouse_*、b.quantity 等与明细同名的列不重复查,明细行自带)
|
||||
-->
|
||||
<select id="queryOutOrderDetailList" parameterType="com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO" resultMap="OutMaterialDetailWithOrderResult">
|
||||
select
|
||||
<include refid="selectMaterialDetailPo"/>
|
||||
, b.notice_number
|
||||
, b.shipper_id, b.shipper_code, b.shipper_name
|
||||
, b.order_type_code, b.order_type_name
|
||||
, b.customer_id, b.customer_code, b.customer_name
|
||||
, b.expect_time
|
||||
, b.supply_chain_number
|
||||
, b.priority_level_code, b.priority_level_name
|
||||
, b.direct_warehouse
|
||||
, b.annex_url
|
||||
, b.status as out_order_status
|
||||
, b.audit_status as out_order_audit_status
|
||||
, b.outbound_date
|
||||
, c.insure_amount, c.goods_type
|
||||
from out_material_detail a
|
||||
join stock_out_order b on a.out_order_number = b.out_order_number
|
||||
left join material_base_info c on a.material_base_info_id = c.material_base_info_id
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="outOrderNumber != null and outOrderNumber != ''">
|
||||
and b.out_order_number like concat('%', #{outOrderNumber}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and b.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and b.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and b.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and b.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and b.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
|
||||
and b.order_type_code = #{outOrderTypeCode}
|
||||
</if>
|
||||
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接,只统计已出库(9/12/13)的明细 -->
|
||||
and b.status in (9, 12, 13)
|
||||
<!-- 实际出仓日期区间(为空的历史单按建档时间兜底),用于统计当天出库 -->
|
||||
<if test="outboundDateStart != null and outboundDateStart != ''">
|
||||
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') >= #{outboundDateStart}
|
||||
</if>
|
||||
<if test="outboundDateEnd != null and outboundDateEnd != ''">
|
||||
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') <= #{outboundDateEnd}
|
||||
</if>
|
||||
and a.level = 1
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<!--
|
||||
出库明细导出(专用列集,列别名对应 OutMaterialDetailExportPO 属性):
|
||||
客户编号/名称取出库单自身字段,客户预约名称取通知单 notice_order 的客户订单号(经 b.notice_number 关联);
|
||||
饮用日期出库明细无此列,按入库单号+物料标量子查询回查入库明细的饮用日期(MAX 防多行);
|
||||
火险保费 WMS 库暂无数据来源,导出空列(CAST(NULL)占位);
|
||||
过滤口径与 queryOutOrderDetailList 完全一致(仅已出库(9/12/13)、level=1、实际出仓日期区间)
|
||||
-->
|
||||
<select id="exportOutOrderDetailList" parameterType="com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO" resultType="com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO">
|
||||
select
|
||||
a.out_order_number as outOrderNumber,
|
||||
b.outbound_date as outboundDate,
|
||||
a.create_time as createTime,
|
||||
b.customer_code as customerCode,
|
||||
b.customer_name as customerName,
|
||||
a.lot_no as lotNo,
|
||||
n.customer_order_number as customerOrderNumber,
|
||||
a.material_name as materialName,
|
||||
a.material_code as materialCode,
|
||||
a.stock_unit as stockUnit,
|
||||
a.PIECE_COUNT as pieceCount,
|
||||
a.warehouse_name as warehouseName,
|
||||
(select MAX(i.DRINK_DATE) from in_material_detail i
|
||||
where i.in_order_number = a.in_order_number
|
||||
and i.material_base_info_id = a.material_base_info_id
|
||||
and i.del_flag = 1) as drinkDate,
|
||||
a.storage_location_name as storageLocationName,
|
||||
a.weight_limit as weightLimit,
|
||||
a.single_volume as singleVolume,
|
||||
a.unit_price as unitPrice,
|
||||
a.TOTAL_PRICE as totalPrice,
|
||||
a.discount_rate as discountRate,
|
||||
a.monthly_warehouse_fee as monthlyWarehouseFee,
|
||||
a.half_month_wh_fee as halfMonthWhFee,
|
||||
a.contract_fee as contractFee,
|
||||
CAST(NULL AS DECIMAL) as fireInsureFee,
|
||||
a.remark as remark,
|
||||
a.TOTAL_GROSS_WEIGHT as totalGrossWeight,
|
||||
a.storage_name as storageName,
|
||||
a.in_order_number as inOrderNumber,
|
||||
c.goods_type as goodsType,
|
||||
a.TOTAL_AMOUNT as totalAmount,
|
||||
b.status as outOrderStatus
|
||||
from out_material_detail a
|
||||
join stock_out_order b on a.out_order_number = b.out_order_number
|
||||
left join material_base_info c on a.material_base_info_id = c.material_base_info_id
|
||||
left join notice_order n on b.notice_number = n.notice_number and n.del_flag = 1
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="outOrderNumber != null and outOrderNumber != ''">
|
||||
and b.out_order_number like concat('%', #{outOrderNumber}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and b.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and b.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and b.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and b.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and b.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
|
||||
and b.order_type_code = #{outOrderTypeCode}
|
||||
</if>
|
||||
and b.status in (9, 12, 13)
|
||||
<if test="outboundDateStart != null and outboundDateStart != ''">
|
||||
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') >= #{outboundDateStart}
|
||||
</if>
|
||||
<if test="outboundDateEnd != null and outboundDateEnd != ''">
|
||||
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') <= #{outboundDateEnd}
|
||||
</if>
|
||||
and a.level = 1
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<update id="batchAddAllocationQuantityByIds" parameterType="com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO">
|
||||
UPDATE out_material_detail
|
||||
<set>
|
||||
|
||||
@@ -357,6 +357,203 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 入库明细查询结果(关联入库单),在物料明细基础上追加单头通知单号/类型/货主/供应商/预计到货时间/入仓日期与货品保额 -->
|
||||
<resultMap type="com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO" id="InMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
||||
<result property="noticeNumber" column="notice_number" />
|
||||
<result property="shipperId" column="shipper_id" />
|
||||
<result property="shipperCode" column="shipper_code" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<result property="orderTypeCode" column="order_type_code" />
|
||||
<result property="orderTypeName" column="order_type_name" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
<result property="supplierCode" column="supplier_code" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="expectTime" column="expect_time" />
|
||||
<result property="supplyChainNumber" column="supply_chain_number" />
|
||||
<result property="priorityLevelCode" column="priority_level_code" />
|
||||
<result property="priorityLevelName" column="priority_level_name" />
|
||||
<result property="directWarehouse" column="direct_warehouse" />
|
||||
<result property="annexUrl" column="annex_url" />
|
||||
<result property="inOrderStatus" column="in_order_status" />
|
||||
<result property="inOrderAuditStatus" column="in_order_audit_status" />
|
||||
<result property="warehouseDate" column="warehouse_date" />
|
||||
<result property="insureAmount" column="insure_amount" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
</resultMap>
|
||||
|
||||
<!--
|
||||
入库明细查询(关联入库单):
|
||||
口径:仅已入库状态(b.status = 5)单据;仅取 level=1 主行防父子行重复计数;
|
||||
实际入仓日期筛选 IFNULL(b.warehouse_date, b.create_time)(与入库排名统计同口径);
|
||||
退货回仓按入库单类型过滤(inOrderTypeCode,退货入库 tui_huo_ru_ku);
|
||||
注意:达梦数据库分页包裹查询不允许重复列名,单头列需与明细表 a 列名错开
|
||||
(b.warehouse_*、b.quantity 等与明细同名的列不重复查,明细行自带)
|
||||
-->
|
||||
<select id="queryInOrderDetailList" parameterType="com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO" resultMap="InMaterialDetailWithOrderResult">
|
||||
select
|
||||
<include refid="selectMaterialDetailPo"/>
|
||||
, b.notice_number
|
||||
, b.shipper_id, b.shipper_code, b.shipper_name
|
||||
, b.order_type_code, b.order_type_name
|
||||
, b.supplier_id, b.supplier_code, b.supplier_name
|
||||
, b.expect_time
|
||||
, b.supply_chain_number
|
||||
, b.priority_level_code, b.priority_level_name
|
||||
, b.direct_warehouse
|
||||
, b.annex_url
|
||||
, b.status as in_order_status
|
||||
, b.audit_status as in_order_audit_status
|
||||
, b.warehouse_date
|
||||
, c.insure_amount, c.goods_type
|
||||
from in_material_detail a
|
||||
join stock_in_order b on a.in_order_number = b.in_order_number
|
||||
left join material_base_info c on a.material_base_info_id = c.material_base_info_id
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="inOrderNumber != null and inOrderNumber != ''">
|
||||
and b.in_order_number like concat('%', #{inOrderNumber}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and b.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and b.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and b.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and b.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and b.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
|
||||
and b.order_type_code = #{inOrderTypeCode}
|
||||
</if>
|
||||
<!-- 入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭,只统计已入库(5)的明细 -->
|
||||
and b.status = 5
|
||||
<!-- 实际入仓日期区间(为空的历史单按建档时间兜底),用于统计当天入库 -->
|
||||
<if test="warehouseDateStart != null and warehouseDateStart != ''">
|
||||
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') >= #{warehouseDateStart}
|
||||
</if>
|
||||
<if test="warehouseDateEnd != null and warehouseDateEnd != ''">
|
||||
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') <= #{warehouseDateEnd}
|
||||
</if>
|
||||
and a.level = 1
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<!--
|
||||
入库明细导出(专用列集,列别名对应 InMaterialDetailExportPO 属性):
|
||||
客户编号/名称/客户预约名称取自通知单 notice_order(入库单表无客户字段,经 b.notice_number 关联);
|
||||
火险保费/单件净重 WMS 库暂无数据来源,导出空列(CAST(NULL)占位);
|
||||
过滤口径与 queryInOrderDetailList 完全一致(仅已入库(5)、level=1、实际入仓日期区间)
|
||||
-->
|
||||
<select id="exportInOrderDetailList" parameterType="com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO" resultType="com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO">
|
||||
select
|
||||
n.customer_code as customerCode,
|
||||
n.customer_name as customerName,
|
||||
a.in_order_number as inOrderNumber,
|
||||
b.warehouse_date as warehouseDate,
|
||||
a.lot_no as lotNo,
|
||||
n.customer_order_number as customerOrderNumber,
|
||||
a.material_name as materialName,
|
||||
a.material_code as materialCode,
|
||||
a.unit_name as unitName,
|
||||
a.PIECE_COUNT as pieceCount,
|
||||
a.warehouse_name as warehouseName,
|
||||
a.DRINK_DATE as drinkDate,
|
||||
a.storage_location_name as storageLocationName,
|
||||
CAST(NULL AS DECIMAL) as netWeight,
|
||||
a.single_volume as singleVolume,
|
||||
a.unit_price as unitPrice,
|
||||
a.TOTAL_PRICE as totalPrice,
|
||||
a.discount_rate as discountRate,
|
||||
a.monthly_warehouse_fee as monthlyWarehouseFee,
|
||||
a.half_month_wh_fee as halfMonthWhFee,
|
||||
a.contract_fee as contractFee,
|
||||
CAST(NULL AS DECIMAL) as fireInsureFee,
|
||||
a.remark as remark,
|
||||
c.goods_type as goodsType,
|
||||
a.TOTAL_GROSS_WEIGHT as totalGrossWeight,
|
||||
c.insure_amount as insureAmount,
|
||||
a.storage_name as storageName,
|
||||
c.charge_standard as chargeStandard,
|
||||
a.EXPIRY_DATE as expiryDate,
|
||||
b.status as inOrderStatus
|
||||
from in_material_detail a
|
||||
join stock_in_order b on a.in_order_number = b.in_order_number
|
||||
left join material_base_info c on a.material_base_info_id = c.material_base_info_id
|
||||
left join notice_order n on b.notice_number = n.notice_number and n.del_flag = 1
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="inOrderNumber != null and inOrderNumber != ''">
|
||||
and b.in_order_number like concat('%', #{inOrderNumber}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and b.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and b.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and b.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and b.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and b.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
|
||||
and b.order_type_code = #{inOrderTypeCode}
|
||||
</if>
|
||||
and b.status = 5
|
||||
<if test="warehouseDateStart != null and warehouseDateStart != ''">
|
||||
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') >= #{warehouseDateStart}
|
||||
</if>
|
||||
<if test="warehouseDateEnd != null and warehouseDateEnd != ''">
|
||||
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') <= #{warehouseDateEnd}
|
||||
</if>
|
||||
and a.level = 1
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<!-- 入库列表页:按入库单号批量取去重后的 Invoice No -->
|
||||
<select id="selectDistinctInvoiceNoForStockInList" resultType="com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg">
|
||||
SELECT DISTINCT
|
||||
|
||||
Reference in New Issue
Block a user