Commit 6f5798720817883b600728a4f711c967a9b1dbe0

Authored by YunaiV
1 parent 3c6ab397

✨ ERP:增加 ERP 销售出库的实现 30%(列表)

yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/dataobject/sale/ErpSaleOutDO.java
@@ -107,8 +107,6 @@ public class ErpSaleOutDO extends BaseDO { @@ -107,8 +107,6 @@ public class ErpSaleOutDO extends BaseDO {
107 private BigDecimal discountPrice; 107 private BigDecimal discountPrice;
108 /** 108 /**
109 * 其它金额,单位:元 109 * 其它金额,单位:元
110 - *  
111 - * 注意:它不算在 {@link #totalPrice} 中  
112 */ 110 */
113 private BigDecimal otherPrice; 111 private BigDecimal otherPrice;
114 112
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/dataobject/sale/ErpSaleOutItemDO.java
@@ -16,8 +16,8 @@ import java.math.BigDecimal; @@ -16,8 +16,8 @@ import java.math.BigDecimal;
16 * 16 *
17 * @author 芋道源码 17 * @author 芋道源码
18 */ 18 */
19 -@TableName("erp_sale_order_items")  
20 -@KeySequence("erp_sale_order_items_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 19 +@TableName("erp_sale_out_items")
  20 +@KeySequence("erp_sale_out_items_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
21 @Data 21 @Data
22 @EqualsAndHashCode(callSuper = true) 22 @EqualsAndHashCode(callSuper = true)
23 @ToString(callSuper = true) 23 @ToString(callSuper = true)
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpAccountMapper.java
@@ -20,7 +20,7 @@ public interface ErpAccountMapper extends BaseMapperX<ErpAccountDO> { @@ -20,7 +20,7 @@ public interface ErpAccountMapper extends BaseMapperX<ErpAccountDO> {
20 default PageResult<ErpAccountDO> selectPage(ErpAccountPageReqVO reqVO) { 20 default PageResult<ErpAccountDO> selectPage(ErpAccountPageReqVO reqVO) {
21 return selectPage(reqVO, new LambdaQueryWrapperX<ErpAccountDO>() 21 return selectPage(reqVO, new LambdaQueryWrapperX<ErpAccountDO>()
22 .likeIfPresent(ErpAccountDO::getName, reqVO.getName()) 22 .likeIfPresent(ErpAccountDO::getName, reqVO.getName())
23 - .eqIfPresent(ErpAccountDO::getNo, reqVO.getNo()) 23 + .likeIfPresent(ErpAccountDO::getNo, reqVO.getNo())
24 .eqIfPresent(ErpAccountDO::getRemark, reqVO.getRemark()) 24 .eqIfPresent(ErpAccountDO::getRemark, reqVO.getRemark())
25 .orderByDesc(ErpAccountDO::getId)); 25 .orderByDesc(ErpAccountDO::getId));
26 } 26 }
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/sale/ErpSaleOrderMapper.java
@@ -22,7 +22,7 @@ public interface ErpSaleOrderMapper extends BaseMapperX&lt;ErpSaleOrderDO&gt; { @@ -22,7 +22,7 @@ public interface ErpSaleOrderMapper extends BaseMapperX&lt;ErpSaleOrderDO&gt; {
22 22
23 default PageResult<ErpSaleOrderDO> selectPage(ErpSaleOrderPageReqVO reqVO) { 23 default PageResult<ErpSaleOrderDO> selectPage(ErpSaleOrderPageReqVO reqVO) {
24 MPJLambdaWrapperX<ErpSaleOrderDO> query = new MPJLambdaWrapperX<ErpSaleOrderDO>() 24 MPJLambdaWrapperX<ErpSaleOrderDO> query = new MPJLambdaWrapperX<ErpSaleOrderDO>()
25 - .eqIfPresent(ErpSaleOrderDO::getNo, reqVO.getNo()) 25 + .likeIfPresent(ErpSaleOrderDO::getNo, reqVO.getNo())
26 .eqIfPresent(ErpSaleOrderDO::getCustomerId, reqVO.getCustomerId()) 26 .eqIfPresent(ErpSaleOrderDO::getCustomerId, reqVO.getCustomerId())
27 .betweenIfPresent(ErpSaleOrderDO::getOrderTime, reqVO.getOrderTime()) 27 .betweenIfPresent(ErpSaleOrderDO::getOrderTime, reqVO.getOrderTime())
28 .eqIfPresent(ErpSaleOrderDO::getStatus, reqVO.getStatus()) 28 .eqIfPresent(ErpSaleOrderDO::getStatus, reqVO.getStatus())
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/sale/ErpSaleOutMapper.java
@@ -22,7 +22,7 @@ public interface ErpSaleOutMapper extends BaseMapperX&lt;ErpSaleOutDO&gt; { @@ -22,7 +22,7 @@ public interface ErpSaleOutMapper extends BaseMapperX&lt;ErpSaleOutDO&gt; {
22 22
23 default PageResult<ErpSaleOutDO> selectPage(ErpSaleOutPageReqVO reqVO) { 23 default PageResult<ErpSaleOutDO> selectPage(ErpSaleOutPageReqVO reqVO) {
24 MPJLambdaWrapperX<ErpSaleOutDO> query = new MPJLambdaWrapperX<ErpSaleOutDO>() 24 MPJLambdaWrapperX<ErpSaleOutDO> query = new MPJLambdaWrapperX<ErpSaleOutDO>()
25 - .eqIfPresent(ErpSaleOutDO::getNo, reqVO.getNo()) 25 + .likeIfPresent(ErpSaleOutDO::getNo, reqVO.getNo())
26 .eqIfPresent(ErpSaleOutDO::getCustomerId, reqVO.getCustomerId()) 26 .eqIfPresent(ErpSaleOutDO::getCustomerId, reqVO.getCustomerId())
27 .betweenIfPresent(ErpSaleOutDO::getOutTime, reqVO.getOutTime()) 27 .betweenIfPresent(ErpSaleOutDO::getOutTime, reqVO.getOutTime())
28 .eqIfPresent(ErpSaleOutDO::getStatus, reqVO.getStatus()) 28 .eqIfPresent(ErpSaleOutDO::getStatus, reqVO.getStatus())
@@ -31,8 +31,12 @@ public interface ErpSaleOutMapper extends BaseMapperX&lt;ErpSaleOutDO&gt; { @@ -31,8 +31,12 @@ public interface ErpSaleOutMapper extends BaseMapperX&lt;ErpSaleOutDO&gt; {
31 .eqIfPresent(ErpSaleOutDO::getAccountId, reqVO.getAccountId()) 31 .eqIfPresent(ErpSaleOutDO::getAccountId, reqVO.getAccountId())
32 .likeIfPresent(ErpSaleOutDO::getOrderNo, reqVO.getOrderNo()) 32 .likeIfPresent(ErpSaleOutDO::getOrderNo, reqVO.getOrderNo())
33 .orderByDesc(ErpSaleOutDO::getId); 33 .orderByDesc(ErpSaleOutDO::getId);
34 - query.gt(Boolean.TRUE.equals(reqVO.getDebtStatus()), ErpSaleOutDO::getDebtPrice, BigDecimal.ZERO);  
35 - if (reqVO.getWarehouseId() != null && reqVO.getProductId() != null) { 34 + if (Boolean.TRUE.equals(reqVO.getDebtStatus())) {
  35 + query.gt(ErpSaleOutDO::getDebtPrice, BigDecimal.ZERO);
  36 + } else if (Boolean.FALSE.equals(reqVO.getDebtStatus())) {
  37 + query.eq(ErpSaleOutDO::getDebtPrice, BigDecimal.ZERO);
  38 + }
  39 + if (reqVO.getWarehouseId() != null || reqVO.getProductId() != null) {
36 query.leftJoin(ErpSaleOutItemDO.class, ErpSaleOutItemDO::getOutId, ErpSaleOutDO::getId) 40 query.leftJoin(ErpSaleOutItemDO.class, ErpSaleOutItemDO::getOutId, ErpSaleOutDO::getId)
37 .eq(reqVO.getWarehouseId() != null, ErpSaleOutItemDO::getWarehouseId, reqVO.getWarehouseId()) 41 .eq(reqVO.getWarehouseId() != null, ErpSaleOutItemDO::getWarehouseId, reqVO.getWarehouseId())
38 .eq(reqVO.getProductId() != null, ErpSaleOutItemDO::getProductId, reqVO.getProductId()) 42 .eq(reqVO.getProductId() != null, ErpSaleOutItemDO::getProductId, reqVO.getProductId())
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/stock/ErpStockCheckMapper.java
@@ -19,7 +19,7 @@ public interface ErpStockCheckMapper extends BaseMapperX&lt;ErpStockCheckDO&gt; { @@ -19,7 +19,7 @@ public interface ErpStockCheckMapper extends BaseMapperX&lt;ErpStockCheckDO&gt; {
19 19
20 default PageResult<ErpStockCheckDO> selectPage(ErpStockCheckPageReqVO reqVO) { 20 default PageResult<ErpStockCheckDO> selectPage(ErpStockCheckPageReqVO reqVO) {
21 MPJLambdaWrapperX<ErpStockCheckDO> query = new MPJLambdaWrapperX<ErpStockCheckDO>() 21 MPJLambdaWrapperX<ErpStockCheckDO> query = new MPJLambdaWrapperX<ErpStockCheckDO>()
22 - .eqIfPresent(ErpStockCheckDO::getNo, reqVO.getNo()) 22 + .likeIfPresent(ErpStockCheckDO::getNo, reqVO.getNo())
23 .betweenIfPresent(ErpStockCheckDO::getCheckTime, reqVO.getCheckTime()) 23 .betweenIfPresent(ErpStockCheckDO::getCheckTime, reqVO.getCheckTime())
24 .eqIfPresent(ErpStockCheckDO::getStatus, reqVO.getStatus()) 24 .eqIfPresent(ErpStockCheckDO::getStatus, reqVO.getStatus())
25 .likeIfPresent(ErpStockCheckDO::getRemark, reqVO.getRemark()) 25 .likeIfPresent(ErpStockCheckDO::getRemark, reqVO.getRemark())
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/stock/ErpStockInMapper.java
@@ -19,7 +19,7 @@ public interface ErpStockInMapper extends BaseMapperX&lt;ErpStockInDO&gt; { @@ -19,7 +19,7 @@ public interface ErpStockInMapper extends BaseMapperX&lt;ErpStockInDO&gt; {
19 19
20 default PageResult<ErpStockInDO> selectPage(ErpStockInPageReqVO reqVO) { 20 default PageResult<ErpStockInDO> selectPage(ErpStockInPageReqVO reqVO) {
21 MPJLambdaWrapperX<ErpStockInDO> query = new MPJLambdaWrapperX<ErpStockInDO>() 21 MPJLambdaWrapperX<ErpStockInDO> query = new MPJLambdaWrapperX<ErpStockInDO>()
22 - .eqIfPresent(ErpStockInDO::getNo, reqVO.getNo()) 22 + .likeIfPresent(ErpStockInDO::getNo, reqVO.getNo())
23 .eqIfPresent(ErpStockInDO::getSupplierId, reqVO.getSupplierId()) 23 .eqIfPresent(ErpStockInDO::getSupplierId, reqVO.getSupplierId())
24 .betweenIfPresent(ErpStockInDO::getInTime, reqVO.getInTime()) 24 .betweenIfPresent(ErpStockInDO::getInTime, reqVO.getInTime())
25 .eqIfPresent(ErpStockInDO::getStatus, reqVO.getStatus()) 25 .eqIfPresent(ErpStockInDO::getStatus, reqVO.getStatus())
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/stock/ErpStockMoveMapper.java
@@ -19,7 +19,7 @@ public interface ErpStockMoveMapper extends BaseMapperX&lt;ErpStockMoveDO&gt; { @@ -19,7 +19,7 @@ public interface ErpStockMoveMapper extends BaseMapperX&lt;ErpStockMoveDO&gt; {
19 19
20 default PageResult<ErpStockMoveDO> selectPage(ErpStockMovePageReqVO reqVO) { 20 default PageResult<ErpStockMoveDO> selectPage(ErpStockMovePageReqVO reqVO) {
21 MPJLambdaWrapperX<ErpStockMoveDO> query = new MPJLambdaWrapperX<ErpStockMoveDO>() 21 MPJLambdaWrapperX<ErpStockMoveDO> query = new MPJLambdaWrapperX<ErpStockMoveDO>()
22 - .eqIfPresent(ErpStockMoveDO::getNo, reqVO.getNo()) 22 + .likeIfPresent(ErpStockMoveDO::getNo, reqVO.getNo())
23 .betweenIfPresent(ErpStockMoveDO::getMoveTime, reqVO.getMoveTime()) 23 .betweenIfPresent(ErpStockMoveDO::getMoveTime, reqVO.getMoveTime())
24 .eqIfPresent(ErpStockMoveDO::getStatus, reqVO.getStatus()) 24 .eqIfPresent(ErpStockMoveDO::getStatus, reqVO.getStatus())
25 .likeIfPresent(ErpStockMoveDO::getRemark, reqVO.getRemark()) 25 .likeIfPresent(ErpStockMoveDO::getRemark, reqVO.getRemark())
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/stock/ErpStockOutMapper.java
@@ -19,7 +19,7 @@ public interface ErpStockOutMapper extends BaseMapperX&lt;ErpStockOutDO&gt; { @@ -19,7 +19,7 @@ public interface ErpStockOutMapper extends BaseMapperX&lt;ErpStockOutDO&gt; {
19 19
20 default PageResult<ErpStockOutDO> selectPage(ErpStockOutPageReqVO reqVO) { 20 default PageResult<ErpStockOutDO> selectPage(ErpStockOutPageReqVO reqVO) {
21 MPJLambdaWrapperX<ErpStockOutDO> query = new MPJLambdaWrapperX<ErpStockOutDO>() 21 MPJLambdaWrapperX<ErpStockOutDO> query = new MPJLambdaWrapperX<ErpStockOutDO>()
22 - .eqIfPresent(ErpStockOutDO::getNo, reqVO.getNo()) 22 + .likeIfPresent(ErpStockOutDO::getNo, reqVO.getNo())
23 .eqIfPresent(ErpStockOutDO::getCustomerId, reqVO.getCustomerId()) 23 .eqIfPresent(ErpStockOutDO::getCustomerId, reqVO.getCustomerId())
24 .betweenIfPresent(ErpStockOutDO::getOutTime, reqVO.getOutTime()) 24 .betweenIfPresent(ErpStockOutDO::getOutTime, reqVO.getOutTime())
25 .eqIfPresent(ErpStockOutDO::getStatus, reqVO.getStatus()) 25 .eqIfPresent(ErpStockOutDO::getStatus, reqVO.getStatus())