合并0227调拨版本上线内容

1 parent e2b63506
Showing 92 changed files with 2818 additions and 93 deletions
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
</parent> </parent>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.6.0-SNAPSHOT</version> <version>${smartcarlife.api.version}</version>
<name>rpc-dj-smartcarlife-api</name> <name>rpc-dj-smartcarlife-api</name>
<properties> <properties>
<deploy.scanPackage>cn.com.glsx.dj.smartcarlife.remote</deploy.scanPackage> <deploy.scanPackage>cn.com.glsx.dj.smartcarlife.remote</deploy.scanPackage>
<smartcarlife.api.version>5.6.2-SNAPSHOT</smartcarlife.api.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.6.0-SNAPSHOT</version> <version>${smartcarlife.api.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
......
package cn.com.glsx.dj.smartcarlife.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
* 调拨发货驳回
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class AllocateDeliveryRejectDTO implements Serializable {
private static final long serialVersionUID = -8528629365246091413L;
/**
* 调拨单号
*/
@ApiModelProperty(notes = "调拨单号")
private String allocateCode;
/**
* 驳回节点 1-调拨商户 2-运营审核 3-商务审核
*/
@ApiModelProperty(notes = "驳回节点 1-调拨商户 2-运营审核 3-商务审核")
private Integer rejectNode;
/**
* 状态set
*/
@ApiModelProperty(notes = "状态set")
private byte statusSet;
/**
* 驳回原因
*/
@ApiModelProperty(notes = "驳回原因")
private String rejectCause;
/**
* 操作人uuid
*/
@ApiModelProperty(notes = "操作人uuid")
private String operatorId;
/**
* 操作人名称
*/
@ApiModelProperty(notes = "操作人名称")
private String operatorName;
}
package cn.com.glsx.dj.smartcarlife.dto; package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.model.GoodsOrderApplyRecord; import cn.com.glsx.dj.smartcarlife.model.GoodsOrderApplyRecord;
import cn.com.glsx.dj.smartcarlife.model.PayOrderVoucher;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -61,6 +62,15 @@ public class GoodsOrderApplyRecordDTO extends GoodsOrderApplyRecord implements S ...@@ -61,6 +62,15 @@ public class GoodsOrderApplyRecordDTO extends GoodsOrderApplyRecord implements S
@ApiModelProperty(notes = "原错误订单商品信息") @ApiModelProperty(notes = "原错误订单商品信息")
private GoodsOrderDTO oldGoodsOrderDTO; private GoodsOrderDTO oldGoodsOrderDTO;
@ApiModelProperty(notes = "订单备注")
private String orderRemark;
@ApiModelProperty(name="outTradeNo", notes = "交易单号(交易流水)")
private String outTradeNo;
@ApiModelProperty(name = "payVoucherList", notes = "线下支付凭证list")
private List<PayOrderVoucher> payVoucherList;
@ApiModelProperty(notes = "审核操作日志") @ApiModelProperty(notes = "审核操作日志")
private List<GoodsOrderApplyRecordLogDTO> applyLogList; private List<GoodsOrderApplyRecordLogDTO> applyLogList;
} }
...@@ -28,6 +28,11 @@ public class OrderReduceStockDTO implements Serializable{/** ...@@ -28,6 +28,11 @@ public class OrderReduceStockDTO implements Serializable{/**
private List<OrderReduceStockGoods> goodsList; private List<OrderReduceStockGoods> goodsList;
private Date reduceDate; private Date reduceDate;
/**
* 操作人
*/
private String operatorName;
@Data @Data
@ToString @ToString
......
...@@ -2,14 +2,12 @@ package cn.com.glsx.dj.smartcarlife.dto; ...@@ -2,14 +2,12 @@ package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderDelivery; import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderDelivery;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.util.List; import java.util.List;
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@SuperBuilder @SuperBuilder
...@@ -59,6 +57,12 @@ public class PurchaseOrderDeliveryDTO extends PurchaseOrderDelivery { ...@@ -59,6 +57,12 @@ public class PurchaseOrderDeliveryDTO extends PurchaseOrderDelivery {
*/ */
private Long purchaseOrderGoodsId; private Long purchaseOrderGoodsId;
/**
* 调拨订单商品id
*/
private Long allocateOrderGoodsId;
/** /**
* 采购订单备注 * 采购订单备注
*/ */
...@@ -73,4 +77,74 @@ public class PurchaseOrderDeliveryDTO extends PurchaseOrderDelivery { ...@@ -73,4 +77,74 @@ public class PurchaseOrderDeliveryDTO extends PurchaseOrderDelivery {
* 操作人uuid * 操作人uuid
*/ */
private String operatorUuid; private String operatorUuid;
/**
* 商品名称
*/
private String goodsName;
/*
* 调拨订单的发货单列表需要更多的信息展示
*/
/**
* 采购订单的创建人
*/
@ApiModelProperty(notes = "制单人")
private String purchaseCreatedBy;
/**
* 调拨订单的创建人
*/
@ApiModelProperty(notes = "调拨人")
private String allocateCreatedBy;
/**
* 调入门店id
*/
@ApiModelProperty(notes = "调入门店-4s店id")
private Integer callInMerchantId;
/**
* 调入门店名称
*/
@ApiModelProperty(notes = "调入门店-4s店名称")
private String callInMerchantName;
/**
* 调入园区店id
*/
@ApiModelProperty(notes = "调入仓库-调入园区店id")
private Integer callInYqMerchantId;
/**
* 调入园区店名称
*/
@ApiModelProperty(notes = "调入仓库-调入园区店名称")
private String callInYqMerchantName;
/**
* 调出门店id
*/
@ApiModelProperty(notes = "调出门店-调出门店id")
private Integer callOutMerchantId;
/**
* 调出门店名称
*/
@ApiModelProperty(notes = "调出门店-4s店名称")
private String callOutMerchantName;
/**
* 调出园区店id
*/
@ApiModelProperty(notes = "调出仓库-调出园区店id")
private Integer callOutYqMerchantId;
/**
* 调出园区店名称
*/
@ApiModelProperty(notes = "调出仓库-调出园区店名称")
private String callOutYqMerchantName;
} }
package cn.com.glsx.dj.smartcarlife.dto; package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.enums.purchaseGoods.DeliveryOrderTypeEnum;
import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderDeliveryDetail; import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderDeliveryDetail;
import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderGoodsCarType; import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderGoodsCarType;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -93,5 +94,86 @@ public class PurchaseOrderDeliveryDetailDTO extends PurchaseOrderDeliveryDetail ...@@ -93,5 +94,86 @@ public class PurchaseOrderDeliveryDetailDTO extends PurchaseOrderDeliveryDetail
*/ */
private String purchaseUnit; private String purchaseUnit;
/**
* 订单类型 0采购单 1调拨单
* @see DeliveryOrderTypeEnum
*/
@ApiModelProperty(notes = "订单类型 0采购单 1调拨单")
private Integer orderType;
/**
* 收件人
*/
@ApiModelProperty(notes = "收件人")
private String contactName;
/**
* 收件人电话
*/
@ApiModelProperty(notes = "收件人电话")
private String contactPhone;
/**
* 收件人地址
*/
@ApiModelProperty(notes = "收件人地址")
private String contactAddress;
/**
* 调入门店id
*/
@ApiModelProperty(notes = "调入门店-4s店id")
private Integer callInMerchantId;
/**
* 调入门店名称
*/
@ApiModelProperty(notes = "调入门店-4s店名称")
private String callInMerchantName;
/**
* 调入园区店id
*/
@ApiModelProperty(notes = "调入仓库-调入园区店id")
private Integer callInYqMerchantId;
/**
* 调入园区店名称
*/
@ApiModelProperty(notes = "调入仓库-调入园区店名称")
private String callInYqMerchantName;
/**
* 调出门店id
*/
@ApiModelProperty(notes = "调出门店-调出门店id")
private Integer callOutMerchantId;
/**
* 调出门店名称
*/
@ApiModelProperty(notes = "调出门店-4s店名称")
private String callOutMerchantName;
/**
* 调出园区店id
*/
@ApiModelProperty(notes = "调出仓库-调出园区店id")
private Integer callOutYqMerchantId;
/**
* 调出园区店名称
*/
@ApiModelProperty(notes = "调出仓库-调出园区店名称")
private String callOutYqMerchantName;
@ApiModelProperty(notes = "上传凭证文件url,用逗号拼接")
private String uploadFileUrl;
/**
* 膜卷号
*/
@ApiModelProperty(notes = "膜卷号(来自调拨商品详情中)")
private String filmRollNo;
} }
package cn.com.glsx.dj.smartcarlife.dto; package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.enums.purchaseGoods.DeliveryOrderTypeEnum;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
...@@ -15,6 +16,12 @@ public class PurchaseOrderDeliverySignExportVO implements Serializable { ...@@ -15,6 +16,12 @@ public class PurchaseOrderDeliverySignExportVO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 订单类型 0采购单 1调拨单
* @see DeliveryOrderTypeEnum
*/
private Integer orderType;
/**
* 发货主体 * 发货主体
*/ */
private String sendOutMerchantName; private String sendOutMerchantName;
......
...@@ -19,6 +19,8 @@ public class PurchaseOrderOperateDTO implements Serializable { ...@@ -19,6 +19,8 @@ public class PurchaseOrderOperateDTO implements Serializable {
@ApiModelProperty(notes = "操作类型", example = "1.审核,2.取消") @ApiModelProperty(notes = "操作类型", example = "1.审核,2.取消")
private Byte operateType; private Byte operateType;
private String operator;
private String updatedBy; private String updatedBy;
private Integer putMerchantId; private Integer putMerchantId;
......
...@@ -19,7 +19,9 @@ public class RefundWarehousingDTO implements Serializable{/** ...@@ -19,7 +19,9 @@ public class RefundWarehousingDTO implements Serializable{/**
private static final long serialVersionUID = 4115119196799655774L; private static final long serialVersionUID = 4115119196799655774L;
private String orderCode; private String orderCode;
private String operator;
private List<RefundWarehousingGoods> goodsList; private List<RefundWarehousingGoods> goodsList;
@Data @Data
......
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.dto; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.dto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -39,6 +40,12 @@ public class SaveStockAllocateDetailDTO implements Serializable { ...@@ -39,6 +40,12 @@ public class SaveStockAllocateDetailDTO implements Serializable {
private String goodsName; private String goodsName;
/** /**
* 规格
*/
@ApiModelProperty(notes="规格", dataType="string", required = true)
private String specificationData;
/**
* 商品编号 * 商品编号
*/ */
@ApiModelProperty(notes="productCode", dataType="string", required = true) @ApiModelProperty(notes="productCode", dataType="string", required = true)
...@@ -90,4 +97,7 @@ public class SaveStockAllocateDetailDTO implements Serializable { ...@@ -90,4 +97,7 @@ public class SaveStockAllocateDetailDTO implements Serializable {
@ApiModelProperty(notes="膜卷号") @ApiModelProperty(notes="膜卷号")
private String filmRollNo; private String filmRollNo;
@ApiModelProperty(notes = "调出库存")
private BigDecimal outStockQty;
} }
package cn.com.glsx.dj.smartcarlife.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class StockAllocateDeliveryListDTO implements Serializable {
private static final long serialVersionUID = -5730342778292603339L;
/**
* detail_id
*/
@ApiModelProperty(notes = "detailId")
private Long detailId;
/**
* record_id
*/
@ApiModelProperty(notes = "recordId")
private Long recordId;
/**
* 调拨单号
*/
@ApiModelProperty(notes = "调拨单号")
private String allocateCode;
/**
* 商品ID
*/
@ApiModelProperty(notes = "商品ID")
private Integer goodsId;
/**
* 商品名称
*/
@ApiModelProperty(notes = "商品名称")
private String goodsName;
/**
* 商品编号
*/
@ApiModelProperty(notes = "商品编号")
private String productCode;
/**
* 多规格商品规格数据(不同规格按“/”分隔)
*/
@ApiModelProperty(notes = "规格")
private String specificationData;
/**
* 系列(素材名称id)
*/
@ApiModelProperty(notes = "系列(素材名称id)")
private Integer sourceMaterialId;
/**
* 系列(素材名称)
*/
@ApiModelProperty(notes = "系列")
private String sourceMaterialName;
/**
* 商品分类
*/
@ApiModelProperty(notes = "商品分类")
private Integer goodsType;
/**
* 商品分类名
*/
@ApiModelProperty(notes = "商品分类名")
private String goodsTypeName;
/**
* 调拨数量
*/
@ApiModelProperty(notes = "调拨数量 注:当conversionValue为null时 单位为件,不为null时单位为卷")
private BigDecimal allocateNumber;
/**
* 已发货数量
*/
@ApiModelProperty(notes = "已发货数量")
private int deliveryNumber;
/**
* 素材换算数值
*/
@ApiModelProperty(notes = "库存换算数值")
private BigDecimal conversionValue;
/**
* 调拨人
*/
@ApiModelProperty(notes = "调拨人")
private String createdBy;
/**
* 调入门店id
*/
@ApiModelProperty(notes = "调入门店-4s店id")
private Integer callInMerchantId;
/**
* 调入门店名称
*/
@ApiModelProperty(notes = "调入门店-4s店名称")
private String callInMerchantName;
/**
* 调入园区店id
*/
@ApiModelProperty(notes = "调入仓库-调入园区店id")
private Integer callInYqMerchantId;
/**
* 调入园区店名称
*/
@ApiModelProperty(notes = "调入仓库-调入园区店名称")
private String callInYqMerchantName;
/**
* 调出门店id
*/
@ApiModelProperty(notes = "调出门店-调出门店id")
private Integer callOutMerchantId;
/**
* 调出门店名称
*/
@ApiModelProperty(notes = "调出门店-4s店名称")
private String callOutMerchantName;
/**
* 调出园区店id
*/
@ApiModelProperty(notes = "调出仓库-调出园区店id")
private Integer callOutYqMerchantId;
/**
* 调出园区店名称
*/
@ApiModelProperty(notes = "调出仓库-调出园区店名称")
private String callOutYqMerchantName;
/**
* 收货人
*/
@ApiModelProperty(notes = "收货人")
private String receiver;
/**
* 联系电话
*/
@ApiModelProperty(notes = "收货人电话")
private String phone;
/**
* 收货地址
*/
@ApiModelProperty(notes = "收货地址")
private String address;
/**
* 发货状态:1:未发货,2全部发货,3部分发货,4结束发货
*/
@ApiModelProperty(notes = "发货状态:1:未发货,2全部发货,3部分发货,4结束发货")
private Byte deliveryStatus;
/**
* 单据状态: 1.待提交,2.运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回 -1.作废
*/
@ApiModelProperty(notes = "单据状态: 1.待提交,2.运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回 -1.作废 " +
"注:调拨发货-订单状态:5.商务已审核(已审核), 7.发货已驳回(已驳回)")
private Byte billStatus;
@ApiModelProperty(notes = "调拨备注")
private String remark;
@ApiModelProperty(notes = "膜卷号")
private String filmRollNo;
@ApiModelProperty(notes = "调出库存(调拨时源仓库库存快照)")
private BigDecimal outStockQty;
@ApiModelProperty(notes = "调入库存(调拨时目标仓库库存快照)")
private BigDecimal inStockQty;
}
package cn.com.glsx.dj.smartcarlife.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
* 调拨发货列表分页请求
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class StockAllocateDeliveryPageDTO implements Serializable {
private static final long serialVersionUID = -8528629365246091413L;
/**
* 当前页码
*/
@ApiModelProperty(name = "currentPage", notes = "当前页码", dataType = "int", required = true, example = "1")
private int currentPage;
/**
* 每页条数
*/
@ApiModelProperty(name = "pageSize", notes = "每页条数", dataType = "20", required = true, example = "20")
private int pageSize;
/**
* 调拨单号
*/
@ApiModelProperty(notes = "调拨单号")
private String allocateCode;
/**
* 调入方-模糊查询(调入门店-4s店名称、调入仓库-调入园区店名称)
*/
@ApiModelProperty(notes = "调入方")
private String callInName;
/**
* 调出方-模糊查询(调出门店-4s店名称、调出仓库-调出园区店名称)
*/
@ApiModelProperty(notes = "调出方")
private String callOutName;
/**
* 发货状态:0-未发货,1-全部发货,2-部分发货
*/
@ApiModelProperty(notes = "发货状态:0-未发货,1-全部发货,2-部分发货")
private Byte deliveryStatus;
/**
* 商品名称
*/
@ApiModelProperty(notes = "商品名称")
private String goodsName;
/**
* 商品编号
*/
@ApiModelProperty(notes = "商品编号")
private String productCode;
}
...@@ -2,15 +2,26 @@ package cn.com.glsx.dj.smartcarlife.dto; ...@@ -2,15 +2,26 @@ package cn.com.glsx.dj.smartcarlife.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateDetail; import cn.com.glsx.dj.smartcarlife.model.StockAllocateDetail;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
/** /**
* @author chenx * @author chenx
*/ */
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data @Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class StockAllocateDetailDTO extends StockAllocateDetail implements Serializable { public class StockAllocateDetailDTO extends StockAllocateDetail implements Serializable {
private static final long serialVersionUID = 2186617036923585846L; private static final long serialVersionUID = 2186617036923585846L;
...@@ -19,4 +30,6 @@ public class StockAllocateDetailDTO extends StockAllocateDetail implements Seria ...@@ -19,4 +30,6 @@ public class StockAllocateDetailDTO extends StockAllocateDetail implements Seria
private String specificationData; private String specificationData;
private String specificationTypeSequence; private String specificationTypeSequence;
private List<Long> idList;
} }
package cn.com.glsx.dj.smartcarlife.dto; package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateAuditDetail;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateRecord; import cn.com.glsx.dj.smartcarlife.model.StockAllocateRecord;
import cn.com.glsx.framework.core.annotation.ApiAlias;
import io.swagger.annotations.ApiModelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import org.oreframework.commons.office.easyexcel.annotation.ExcelMergeRow;
/** /**
* @author chenx * @author chenx
...@@ -15,6 +27,7 @@ import java.util.List; ...@@ -15,6 +27,7 @@ import java.util.List;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ToString(callSuper = true) @ToString(callSuper = true)
@SuperBuilder
@Data @Data
public class StockAllocateRecordDTO extends StockAllocateRecord implements Serializable { public class StockAllocateRecordDTO extends StockAllocateRecord implements Serializable {
...@@ -44,8 +57,40 @@ public class StockAllocateRecordDTO extends StockAllocateRecord implements Seria ...@@ -44,8 +57,40 @@ public class StockAllocateRecordDTO extends StockAllocateRecord implements Seria
*/ */
private List<Integer> yqMerchantIds; private List<Integer> yqMerchantIds;
@ApiModelProperty(notes = "调拨单状态 0 待提交 1 运营审核 2 商务审核 4,6,7 审批驳回 5 审批通过 -1 作废")
private String billStatusName;
@ApiModelProperty(notes = "0-未发货,1-全部发货,2-部分发货")
private String deliveryStatusName;
/** /**
* 保存盘点单商品详情列表 * 保存盘点单商品详情列表
*/ */
List<SaveStockAllocateDetailDTO> saveStockAllocateDetailList; List<SaveStockAllocateDetailDTO> saveStockAllocateDetailList;
@ApiModelProperty(notes = "调拨单商品明细列表")
private List<StockAllocateDetailDTO> stockAllocateDetailList;
private List<StockAllocateAuditDetail> auditDetaiList;
@ApiModelProperty(notes = "查询类型(1.运营审核查询,2:商务审核查询)")
private Byte queryType;
@ApiModelProperty(notes="驳回节点 1-调拨商户 2-运营审核 3-商务审核")
private Integer rejectNode;
@ApiModelProperty(notes = "调拨单状态 0 待提交 1 运营审核 2 商务审核 4,6,7 审批驳回 5 审批通过 -1 作废")
private List<Byte> billStatusList;
@ApiModelProperty(notes = "调入名称")
private String callInName;
@ApiModelProperty(notes = "总的调拨数量")
private BigDecimal totalAllocateNumber;
/**
* 调拨单详情id,调拨单详情映射
*/
Map<Long, StockAllocateDetailDTO> orderGoodsIdMap;
} }
...@@ -54,4 +54,10 @@ public class StockAllocateRecordExportDTO extends StockAllocateRecord implements ...@@ -54,4 +54,10 @@ public class StockAllocateRecordExportDTO extends StockAllocateRecord implements
private String specificationData; private String specificationData;
private String specificationTypeSequence; private String specificationTypeSequence;
@ApiModelProperty(notes = "调拨单状态 0 待提交 1 运营审核 2 商务审核 4,6,7 审批驳回 5 审批通过 -1 作废")
private String billStatusName;
@ApiModelProperty(notes = "0-未发货,1-全部发货,2-部分发货")
private String deliveryStatusName;
} }
...@@ -55,5 +55,6 @@ public class StockCheckRecordDTO extends StockCheckRecord implements Serializabl ...@@ -55,5 +55,6 @@ public class StockCheckRecordDTO extends StockCheckRecord implements Serializabl
*/ */
List<StockCheckDetailDTO> stockCheckDetailList; List<StockCheckDetailDTO> stockCheckDetailList;
private String operator;
} }
package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.enums.IncreaseStockTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.ReduceStockEventTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.SuperBuilder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class StockFlowDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 出入库时间
*/
@ApiModelProperty(notes = "出入库时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date flowTime;
/**
* 商品名称
*/
@ApiModelProperty(notes = "商品名称")
private String upgradeGoodsName;
/**
* 商品编码
*/
@ApiModelProperty(notes = "商品编码")
private String productCode;
/**
* 规格数据
*/
@ApiModelProperty(notes = "规格数据")
private String specificationData;
/**
* 规格类型序列
*/
@ApiModelProperty(notes = "规格类型序列,用于解析规格数据")
private String specificationTypeSequence;
/**
* 商品系列
*/
@ApiModelProperty(notes = "商品系列")
private String goodsSeries;
/**
* 商品所属分类名称
*/
@ApiModelProperty(notes = "商品所属分类名称")
private String goodsTypeName;
private Integer goodsType;
/**
* 出入库数量
*/
@ApiModelProperty(notes = "出入库数量")
private BigDecimal stockNum;
/**
* 出入库金额
*/
@ApiModelProperty(notes = "出入库金额")
private BigDecimal stockMoney;
/**
* 关联业务单号
*/
@ApiModelProperty(notes = "关联业务单号")
private String businessCode;
/**
* 关联发货单号
*/
@ApiModelProperty(notes = "关联发货单号(仅入库)")
private String deliveryNumber;
/**
* 膜卷号
*/
@ApiModelProperty(notes = "膜卷号")
private String filmRollNo;
/**
* 出入库仓库商户名称
*/
@ApiModelProperty(notes = "出入库仓库商户名称")
private String yqMerchantName;
/**
* 出入库门店商户名称
*/
@ApiModelProperty(notes = "出入库门店商户名称")
private String merchantName;
/**
* 操作人姓名
*/
@ApiModelProperty(notes = "操作人姓名")
private String operator;
/**
* 技师姓名
*/
@ApiModelProperty(notes = "技师姓名(仅出库)")
private String technicianName;
/**
* 流程类型
*/
@ApiModelProperty(notes = "出入库类型: 101-领料出库,102-盘点出库,103-调拨出库,104-退货出库;201-商城采购入库,202-盘点入库,203-调拨入库,204-退料入库,205-自采入库")
private Integer flowType;
// ================= 查询条件字段 =================
/**
* 商户ID列表
*/
@ApiModelProperty(notes = "查询条件:商户ID列表")
private List<Integer> yqMerchantIds;
/**
* 查询开始时间
*/
@ApiModelProperty(notes = "查询条件:开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startDate;
/**
* 查询结束时间
*/
@ApiModelProperty(notes = "查询条件:结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endDate;
/**
* 统一出入库类型编码列表(多选)
*
* @see #parseInOutTypes
*/
@ApiModelProperty(notes = "查询条件:101-领料出库,102-盘点出库,103-调拨出库,104-退货出库;201-商城采购入库,202-盘点入库,203-调拨入库,204-退料入库,205-自采入库")
private List<Integer> queryFlowTypes;
/**
* 入库类型列表
*/
@ApiModelProperty(notes = "查询条件:入库类型列表")
private List<Integer> increaseStockTypes;
/**
* 出库类型列表
*/
@ApiModelProperty(notes = "查询条件:出库类型列表")
private List<Integer> eventTypes;
/**
* 订单升级状态(Y:已升级 N:战败)
*/
@ApiModelProperty(notes = "订单升级状态(Y:已升级 N:战败)")
private String upgradeFlag;
/**
* 将统一出入库类型编码(flowTypes)转换为各自的入库/出库子类型列表
*
* @see ReduceStockEventTypeEnum 出库类型枚举
* @see IncreaseStockTypeEnum 入库类型枚举
*/
public void parseInOutTypes(){
if (CollectionUtils.isEmpty(this.queryFlowTypes)) {
return;
}
// 两表union,进行条件过滤时需要屏蔽另一个表
List<Integer> inTypes = Lists.newArrayList(-1);
List<Integer> outTypes = Lists.newArrayList(-1);
for (Integer code : this.queryFlowTypes) {
if (code == null) {
continue;
}
// 出库:101-领料出库,102-盘点出库,103-调拨出库,104-退货出库
if (code >= 101 && code <= 199) {
outTypes.add(code - 100);
}
// 入库:201-商城采购入库,202-盘点入库,203-调拨入库,204-退料入库,205-自采入库
if (code >= 201 && code <= 299) {
inTypes.add(code - 200);
}
}
setIncreaseStockTypes(inTypes);
setEventTypes(outTypes);
}
}
...@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor; ...@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
@Data @Data
@ToString @ToString(callSuper = true)
@SuperBuilder @SuperBuilder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
...@@ -37,4 +37,7 @@ public class OnlineStatementAccountDailyBalanceDTO extends OnlineStatementAccoun ...@@ -37,4 +37,7 @@ public class OnlineStatementAccountDailyBalanceDTO extends OnlineStatementAccoun
@ApiModelProperty(notes = "查询日期拼接,仅展示") @ApiModelProperty(notes = "查询日期拼接,仅展示")
private String queryDate; private String queryDate;
@ApiModelProperty(notes = "过滤金额全为0的数据")
private Boolean filterAllZero;
} }
...@@ -27,4 +27,6 @@ public class PurchaseApplyAuditDTO extends PurchaseApplyRecord { ...@@ -27,4 +27,6 @@ public class PurchaseApplyAuditDTO extends PurchaseApplyRecord {
@ApiModelProperty(notes = "膜卷号list") @ApiModelProperty(notes = "膜卷号list")
private List<String> filmRollList; private List<String> filmRollList;
private String operator;
} }
\ No newline at end of file \ No newline at end of file
...@@ -177,4 +177,42 @@ public class PurchaseOrderEnum { ...@@ -177,4 +177,42 @@ public class PurchaseOrderEnum {
return value; return value;
} }
} }
/**
*
* @Description:调拨发货单状态
* 0.草稿 1.待提交,2.运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回 -1.作废
* @author zhoulm
*/
public enum StockAllocateStatus {
/** 草稿**/
DRAFT((byte)0),
/** 待提交**/
WAIT_COMMIT((byte)1),
/** 运营已审核 **/
OPERATOR_CHECKED((byte)2),
/** 已取消 **/
CANCELED((byte)3),
/** 运营已驳回 **/
OPERATOR_REJECT((byte)4),
/** 商务已审核 **/
BUSINESS_CHECKED((byte)5),
/** 商务已驳回 **/
BUSINESS_REJECT((byte)6),
/** 发货已驳回 **/
DELIVERY_REJECT((byte)7),
/** 作废 **/
DELE((byte)-1)
;
private final byte value;
StockAllocateStatus(byte value){
this.value = value;
}
public byte getValue(){
return value;
}
}
} }
package cn.com.glsx.dj.smartcarlife.enums.purchaseGoods;
import lombok.Getter;
@Getter
public enum BillStatusEnum {
DRAF((byte)0, "待提交"),
WAIT_OPERATOR_APPROVED((byte)1, "运营审核"),
OPERATOR_APPROVED((byte)2, "运营已审核"),
CANCELLED((byte)3, "已取消"),
OPERATOR_REJECTED((byte)4, "运营已驳回"),
BUSINESS_APPROVED((byte)5, "商务已审核"),
BUSINESS_REJECTED((byte)6, "商务已驳回"),
DELIVERY_REJECTED((byte)7, "发货已驳回"),
VOID((byte)-1, "作废");
private final byte code;
private final String desc;
BillStatusEnum(Byte code, String desc) {
this.code = code;
this.desc = desc;
}
/**
* 根据 code 获取枚举
*/
public static BillStatusEnum fromCode(Byte code) {
for (BillStatusEnum status : BillStatusEnum.values()) {
if (code.equals(status.code)) {
return status;
}
}
throw new IllegalArgumentException("无效的单据状态码: " + code);
}
public static String getDisplayDesc(Byte status) {
if (status == null) {
return "未知状态";
}
switch (status) {
case 0:
return "待提交";
case 1:
return "运营审核";
case 2:
return "商务审核";
case 5:
return "审核通过";
case -1:
return "作废";
case 4:
case 6:
case 7:
return "审核驳回"; // ← 合并 4,6,7
default:
return "未知状态";
}
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.smartcarlife.enums.purchaseGoods;
import lombok.Getter;
import java.util.Objects;
/**
* 发货单订单类型
*/
@Getter
public enum DeliveryOrderTypeEnum {
UNKNOWN(-1, "未知异常"),
PURCHASE_ORDER(0, "采购单"),
ALLOCATE_ORDER(1, "调拨单");
private final Integer value;
private final String message;
DeliveryOrderTypeEnum(Integer value, String message) {
this.value = value;
this.message = message;
}
public static DeliveryOrderTypeEnum getByValue(Integer value) {
for (DeliveryOrderTypeEnum e : DeliveryOrderTypeEnum.values()) {
if (Objects.equals(e.getValue(), value)) {
return e;
}
}
return UNKNOWN;
}
}
package cn.com.glsx.dj.smartcarlife.enums.purchaseGoods;
import lombok.Getter;
@Getter
public enum DeliveryStatusEnum {
UNDELIVERED((byte)1, "未发货"),
FULL_DELIVERED((byte)2, "全部发货"),
PARTIAL_DELIVERED((byte)3, "部分发货"),
FINISH_DELIVERED((byte)4, "结束发货");
private final Byte code;
private final String desc;
DeliveryStatusEnum(Byte code, String desc) {
this.code = code;
this.desc = desc;
}
/**
* 安全获取:code 不存在时返回 null
*/
public static DeliveryStatusEnum safeFromCode(Byte code) {
for (DeliveryStatusEnum status : DeliveryStatusEnum.values()) {
if (status.code == code) {
return status;
}
}
return null;
}
/**
* 根据状态码获取描述文本(用于前端展示)
*/
public static String getDescByCode(Byte code) {
DeliveryStatusEnum status = safeFromCode(code);
return status != null ? status.getDesc() : "未知发货状态";
}
}
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,7 @@ package cn.com.glsx.dj.smartcarlife.enums.purchaseGoods; ...@@ -5,7 +5,7 @@ package cn.com.glsx.dj.smartcarlife.enums.purchaseGoods;
* 驳回节点 1-采购商户 2-运营审核 3-商务审核 4-采购发货审核 5-总监审核 * 驳回节点 1-采购商户 2-运营审核 3-商务审核 4-采购发货审核 5-总监审核
*/ */
public enum ReviewNodeEnum { public enum ReviewNodeEnum {
/** 采购商户**/ /** 采购商户 (调拨单时为调拨商户)**/
PURCHASE_MERCHANT( 1), PURCHASE_MERCHANT( 1),
/** 运营审核 **/ /** 运营审核 **/
OPERATOR_VIEW( 2), OPERATOR_VIEW( 2),
...@@ -13,7 +13,7 @@ public enum ReviewNodeEnum { ...@@ -13,7 +13,7 @@ public enum ReviewNodeEnum {
BUSINESS_VIEW(3), BUSINESS_VIEW(3),
/** 采购发货审核 **/ /** 采购发货审核 **/
DELIVERY(4), DELIVERY(4),
/** 总监审核 **/ /** 总监审核 (调拨单时为商务已审核)**/
DIRECTOR(5); DIRECTOR(5);
private final Integer value; private final Integer value;
......
package cn.com.glsx.dj.smartcarlife.enums.purchaseGoods;
/**
* 订单类型(0:采购单,1:调拨单)
*/
public enum WechatMessageOrderTypeEnum {
/** 采购单**/
PURCHASE_ORDER((byte) 0),
/** 调拨单 **/
STOCK_ALLOCATE((byte) 1);
private final byte value;
WechatMessageOrderTypeEnum(byte value) {
this.value = value;
}
public byte getValue() {
return value;
}
}
...@@ -129,6 +129,13 @@ public class GoodsWarehousingInfo implements Serializable { ...@@ -129,6 +129,13 @@ public class GoodsWarehousingInfo implements Serializable {
@ApiModelProperty(notes = "采购订单商品主键ID") @ApiModelProperty(notes = "采购订单商品主键ID")
@Column(name = "purchase_order_goods_id") @Column(name = "purchase_order_goods_id")
private Long purchaseOrderGoodsId; private Long purchaseOrderGoodsId;
/**
* 调拨订单商品主键ID
*/
@Column(name = "allocate_order_goods_id")
@ApiModelProperty(notes = "调拨订单商品主键ID")
private Long allocateOrderGoodsId;
/** /**
* 创建人 * 创建人
...@@ -160,4 +167,9 @@ public class GoodsWarehousingInfo implements Serializable { ...@@ -160,4 +167,9 @@ public class GoodsWarehousingInfo implements Serializable {
@Column(name = "deleted_flag") @Column(name = "deleted_flag")
private String deletedFlag; private String deletedFlag;
/**
* 修改人
*/
@Column(name = "updated_user_name")
private String updatedUserName;
} }
\ No newline at end of file \ No newline at end of file
...@@ -85,6 +85,12 @@ public class MerchantGoodsStockReduceRecord implements Serializable { ...@@ -85,6 +85,12 @@ public class MerchantGoodsStockReduceRecord implements Serializable {
private String businessCode; private String businessCode;
/** /**
* 物料单号
*/
@Column(name = "delivery_number")
private String deliveryNumber;
/**
* 出库方式(1:订单出库,2:盘点出库,3:调拨出库) * 出库方式(1:订单出库,2:盘点出库,3:调拨出库)
*/ */
@Column(name = "event_type") @Column(name = "event_type")
......
package cn.com.glsx.dj.smartcarlife.model; package cn.com.glsx.dj.smartcarlife.model;
import cn.com.glsx.dj.smartcarlife.enums.PurchaseOrderEnum;
import cn.com.glsx.dj.smartcarlife.remote.PurchaseOrderRemote; import cn.com.glsx.dj.smartcarlife.remote.PurchaseOrderRemote;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -98,6 +99,7 @@ public class PurchaseOrder implements Serializable{ ...@@ -98,6 +99,7 @@ public class PurchaseOrder implements Serializable{
/** /**
* 入库状态(1.未入库,2.全部入库,3部分入库) * 入库状态(1.未入库,2.全部入库,3部分入库)
* @see PurchaseOrderEnum.PutStatus
*/ */
@Column(name = "put_status") @Column(name = "put_status")
private Byte putStatus; private Byte putStatus;
......
package cn.com.glsx.dj.smartcarlife.model; package cn.com.glsx.dj.smartcarlife.model;
import cn.com.glsx.dj.smartcarlife.enums.purchaseGoods.DeliveryOrderTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.PurchaseOrderDeliveryRemote; import cn.com.glsx.dj.smartcarlife.remote.PurchaseOrderDeliveryRemote;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -218,4 +219,16 @@ public class PurchaseOrderDelivery implements Serializable{ ...@@ -218,4 +219,16 @@ public class PurchaseOrderDelivery implements Serializable{
*/ */
@Column(name = "deleted_flag") @Column(name = "deleted_flag")
private String deletedFlag; private String deletedFlag;
/**
* 订单类型 0采购单 1调拨单
* @see DeliveryOrderTypeEnum
*/
@Column(name = "order_type")
@ApiModelProperty(notes = "订单类型 0采购单 1调拨单")
private Integer orderType;
@ApiModelProperty(notes = "上传凭证文件url,用逗号拼接")
@Column(name = "upload_file")
private String uploadFileUrl;
} }
...@@ -85,6 +85,13 @@ public class PurchaseOrderDeliveryDetail implements Serializable{ ...@@ -85,6 +85,13 @@ public class PurchaseOrderDeliveryDetail implements Serializable{
*/ */
@Column(name = "purchase_order_goods_id") @Column(name = "purchase_order_goods_id")
private Long purchaseOrderGoodsId; private Long purchaseOrderGoodsId;
/**
* 调拨订单商品主键ID
*/
@Column(name = "allocate_order_goods_id")
@ApiModelProperty(notes = "调拨订单商品主键ID")
private Long allocateOrderGoodsId;
/** /**
* 商品编码 * 商品编码
...@@ -105,7 +112,7 @@ public class PurchaseOrderDeliveryDetail implements Serializable{ ...@@ -105,7 +112,7 @@ public class PurchaseOrderDeliveryDetail implements Serializable{
*/ */
@ApiModelProperty(notes = "发货数量", required = true) @ApiModelProperty(notes = "发货数量", required = true)
@Column(name = "purchase_number") @Column(name = "purchase_number")
private Integer purchaseNumber; private BigDecimal purchaseNumber;
/** /**
* 可用库存数量 * 可用库存数量
......
...@@ -54,7 +54,13 @@ public class PurchaseOrderWechatMessageRecord implements Serializable { ...@@ -54,7 +54,13 @@ public class PurchaseOrderWechatMessageRecord implements Serializable {
*/ */
@Column(name = "push_url") @Column(name = "push_url")
private String pushUrl; private String pushUrl;
/**
* 订单类型(0:采购单,1:调拨单)
*/
@Column(name = "order_type")
private Byte orderType;
/** /**
* 创建人 * 创建人
*/ */
......
package cn.com.glsx.dj.smartcarlife.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Table(name = "dj_car_life_stock_allocate_audit_detail")
public class StockAllocateAuditDetail implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1849202271041314793L;
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 调拨单编号
*/
@Column(name = "allocate_code")
private String allocateCode;
/**
* 状态(1.待审核,2.运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回)
*/
private Byte status;
/**
* 驳回后状态(1.待审核,2.运营已审核,5.商务已审核)
*/
@Column(name = "rejected_status")
private Byte rejectedStatus;
/**
* 审核人
*/
@Column(name = "reviewed_by")
private String reviewedBy;
/**
* 审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(notes = "审核时间")
@Column(name = "reviewed_date")
private Date reviewedDate;
/**
* 审核通过的备注
*/
private String remark;
/**
* 驳回原因
*/
@Column(name = "reject_cause")
private String rejectCause;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file \ No newline at end of file
...@@ -118,5 +118,52 @@ public class StockAllocateDetail implements Serializable { ...@@ -118,5 +118,52 @@ public class StockAllocateDetail implements Serializable {
@Column(name = "updated_date") @Column(name = "updated_date")
private Date updatedDate; private Date updatedDate;
/**
* 素材换算数值
*/
@ApiModelProperty(notes = "库存换算数值")
@Column(name = "conversion_value")
private BigDecimal conversionValue;
/**
* 已发货数量
*/
@Column(name = "delivery_number")
private BigDecimal deliveryNumber;
/**
* 发货状态(1:未发货,2全部发货,3部分发货,4结束发货)
*/
@Column(name = "delivery_status")
private Integer deliveryStatus;
/**
* 升级商品采购价
*/
@ApiModelProperty(notes = "单价")
@Column(name = "upgrade_purchase_price")
private BigDecimal upgradePurchasePrice;
/**
* 已入库数量
*/
@ApiModelProperty(notes = "已入库数量")
@Column(name = "input_number")
private BigDecimal inputNumber;
/**
* 多规格商品规格数据(不同规格按“/”分隔)
*/
@ApiModelProperty(notes = "规格")
@Column(name = "specification_data")
private String specificationData;
@ApiModelProperty(notes = "调出库存")
@Column(name = "out_stock_qty")
private BigDecimal outStockQty;
@ApiModelProperty(notes = "调入库存")
@Column(name = "in_stock_qty")
private BigDecimal inStockQty;
} }
...@@ -9,6 +9,12 @@ import javax.persistence.GenerationType; ...@@ -9,6 +9,12 @@ import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.com.glsx.dj.smartcarlife.enums.PurchaseOrderEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -101,7 +107,14 @@ public class StockAllocateRecord implements Serializable { ...@@ -101,7 +107,14 @@ public class StockAllocateRecord implements Serializable {
* 备注 * 备注
*/ */
private String remark; private String remark;
/**
* 驳回原因
*/
@ApiModelProperty(name = "rejectCause",notes = "驳回原因")
@Column(name = "reject_cause")
private String rejectCause;
/** /**
* 删除标识(D:已删除;N:未删除) * 删除标识(D:已删除;N:未删除)
*/ */
...@@ -131,4 +144,52 @@ public class StockAllocateRecord implements Serializable { ...@@ -131,4 +144,52 @@ public class StockAllocateRecord implements Serializable {
*/ */
@Column(name = "updated_date") @Column(name = "updated_date")
private Date updatedDate; private Date updatedDate;
/**
* 入库状态(1.未入库,2.全部入库,3部分入库)
* @see PurchaseOrderEnum.PutStatus
*/
@Column(name = "put_status")
private Byte putStatus;
/**
* 单据状态: 1.待提交,2.运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回 -1.作废
*/
@Column(name = "bill_status")
private Byte billStatus;
/**
* 发货状态:0-未发货,1-全部发货,2-部分发货
*/
@Column(name = "delivery_status")
private Byte deliveryStatus;
/**
* 收货人
*/
@Column(name = "receiver")
private String receiver;
/**
* 联系电话
*/
@Column(name = "phone")
private String phone;
/**
* 收货地址
*/
@Column(name = "address")
private String address;
/**
* 单据时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "submit_time")
private Date submitTime;
} }
...@@ -31,4 +31,9 @@ public interface OnlineStatementAccountDailyBalanceRemote { ...@@ -31,4 +31,9 @@ public interface OnlineStatementAccountDailyBalanceRemote {
@ApiResponse("返回结果") @ApiResponse("返回结果")
RpcResponse<Boolean> recalculateTask(String startRecalculateDate); RpcResponse<Boolean> recalculateTask(String startRecalculateDate);
@ApiMethod("统计银盛对账单信息")
@ApiParam(name="condition",notes="查询条件",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回银盛对账单统计信息")
RpcResponse<OnlineStatementAccountDailyBalanceDTO> countTotal(OnlineStatementAccountDailyBalanceDTO condition);
} }
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.remote; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.*; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.businessassistant.PurchaseOrderGoodsBaseDTO; import cn.com.glsx.dj.smartcarlife.dto.businessassistant.PurchaseOrderGoodsBaseDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.OrderGoodsDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderGoodsPageDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderGoodsPageDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderSelfDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderSelfDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.SelfPurchaseOrderGoodsDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.SelfPurchaseOrderGoodsDTO;
...@@ -168,7 +169,12 @@ public interface PurchaseOrderRemote { ...@@ -168,7 +169,12 @@ public interface PurchaseOrderRemote {
@ApiParam(name = "purchaseOrderPageDTO",notes ="订单编号",dataType = ApiParam.DataTypeEnum.STRING,required = true ) @ApiParam(name = "purchaseOrderPageDTO",notes ="订单编号",dataType = ApiParam.DataTypeEnum.STRING,required = true )
@ApiResponse("H5页面订单详情") @ApiResponse("H5页面订单详情")
RpcResponse<PurchaseOrderPageDTO> getH5Detail(PurchaseOrderPageDTO purchaseOrderPageDTO); RpcResponse<PurchaseOrderPageDTO> getH5Detail(PurchaseOrderPageDTO purchaseOrderPageDTO);
@ApiMethod("H5页面商品详情查询")
@ApiParam(name = "id",notes ="调拨详情ID",dataType = ApiParam.DataTypeEnum.LONG,required = true )
@ApiResponse("H5页面商品详情查询")
RpcResponse<OrderGoodsDTO> getH5GoodsDetail(@NotNull Long id);
@ApiMethod("退货") @ApiMethod("退货")
@ApiParam(name = "condition",notes ="退货信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true ) @ApiParam(name = "condition",notes ="退货信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true )
@ApiResponse("退货结果") @ApiResponse("退货结果")
......
package cn.com.glsx.dj.smartcarlife.remote; package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordDTO; import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordExportDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
...@@ -20,7 +15,7 @@ public interface StockAllocateRemote { ...@@ -20,7 +15,7 @@ public interface StockAllocateRemote {
@ApiMethod("保存调拨单") @ApiMethod("保存调拨单")
@ApiParam(name = "stockAllocateRecordDTO", notes = "调拨确认单参数", dataType = ApiParam.DataTypeEnum.LIST, required = true) @ApiParam(name = "stockAllocateRecordDTO", notes = "调拨确认单参数", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("保存调拨单") @ApiResponse("保存调拨单")
RpcResponse<Boolean> saveStockAllocateRecord(@NotNull StockAllocateRecordDTO stockAllocateRecordDTO); RpcResponse<String> saveStockAllocateRecord(@NotNull StockAllocateRecordDTO stockAllocateRecordDTO);
@ApiMethod("分页查询调拨单列表") @ApiMethod("分页查询调拨单列表")
@ApiParams({ @ApiParams({
...@@ -42,4 +37,38 @@ public interface StockAllocateRemote { ...@@ -42,4 +37,38 @@ public interface StockAllocateRemote {
@ApiResponse("调拨详细信息") @ApiResponse("调拨详细信息")
RpcResponse<RpcPagination<StockAllocateDetailDTO>> listStockAllocateDetailPage(@NotNull RpcPagination<StockAllocateDetailDTO> pagination); RpcResponse<RpcPagination<StockAllocateDetailDTO>> listStockAllocateDetailPage(@NotNull RpcPagination<StockAllocateDetailDTO> pagination);
@ApiMethod("更新调拨单")
@ApiParam(name = "stockAllocateRecordDTO", notes = "调拨确认单参数", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("更新调拨单")
RpcResponse<String> updateStockAllocateRecord(StockAllocateRecordDTO stockAllocateRecordDTO);
@ApiMethod("更新调拨单状态")
@ApiParam(name = "stockAllocateRecordDTO", notes = "调拨确认单参数", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("更新调拨单状态")
RpcResponse<Boolean> updateStockAllocateRecordStatus(StockAllocateRecordDTO stockAllocateRecordDTO);
@ApiMethod("查询调拨信息")
@ApiParam(name = "allocateCode", notes = "调拨单号", dataType = ApiParam.DataTypeEnum.STRING, required = true)
@ApiResponse("调拨信息")
RpcResponse<StockAllocateRecordDTO> getDetailByAllocateCode(@NotBlank String allocateCode);
@ApiMethod("H5页面详情查询")
@ApiParam(name = "allocateCode",notes ="调拨单编号",dataType = ApiParam.DataTypeEnum.STRING,required = true )
@ApiResponse("H5页面订单详情")
RpcResponse<StockAllocateRecordDTO> getH5Detail(@NotBlank String allocateCode);
@ApiMethod("H5页面商品详情查询")
@ApiParam(name = "id",notes ="调拨详情ID",dataType = ApiParam.DataTypeEnum.LONG,required = true )
@ApiResponse("H5页面商品详情查询")
RpcResponse<StockAllocateDetailDTO> getH5GoodsDetail(@NotNull Long id);
@ApiMethod("调拨订单批量发货")
@ApiParam(name = "stockAllocateRecordDTO", notes = "调拨确认单参数", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("调拨订单批量发货结果")
RpcResponse<Boolean> allocateDeliveryBatch(PurchaseOrderDeliveryDTO dto);
@ApiMethod("调拨订单发货列表")
RpcResponse<RpcPagination<StockAllocateDeliveryListDTO>> allocateDeliveryPage(StockAllocateDeliveryPageDTO dto);
@ApiMethod("调拨发货驳回")
RpcResponse<Boolean> allocateDeliveryReject(AllocateDeliveryRejectDTO dto);
} }
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "调拨单运营审核", owner = "zholm")
public interface StockAllocateReviewRemote {
@ApiMethod("运营审核")
@ApiParam(name = "dto",notes ="审核状态",dataType = ApiParam.DataTypeEnum.OBJECT,required = true )
@ApiResponse("true")
RpcResponse<Boolean> operatorAudit(StockAllocateRecordDTO dto);
@ApiMethod("商务审核")
@ApiParam(name = "dto",notes ="商务审核参数",dataType = ApiParam.DataTypeEnum.OBJECT,required = true )
@ApiResponse("true")
RpcResponse<Boolean> businessAudit(StockAllocateRecordDTO dto);
@ApiMethod("商务驳回")
@ApiParam(name = "dto",notes ="商务驳回参数",dataType = ApiParam.DataTypeEnum.OBJECT,required = true )
@ApiResponse("true")
RpcResponse<Boolean> businessReject(StockAllocateRecordDTO dto);
}
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* 出入库管理Remote
*/
@ApiService(value = "出入库管理接口", owner = "lyj")
public interface StockFlowRemote {
/**
* 分页查询出入库流水
*/
@ApiMethod("分页查询出入库流水")
RpcResponse<RpcPagination<StockFlowDTO>> page(RpcPagination<StockFlowDTO> pagination);
}
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>
<skipTests>true</skipTests> <skipTests>true</skipTests>
<smartcarlife.api.version>5.6.2-SNAPSHOT</smartcarlife.api.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.6.0-SNAPSHOT</version> <version>${smartcarlife.api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
......
...@@ -77,4 +77,5 @@ public class CommonConstants { ...@@ -77,4 +77,5 @@ public class CommonConstants {
public static final String OTHER = "其他"; public static final String OTHER = "其他";
/** 规格数据分隔符 **/ /** 规格数据分隔符 **/
public static final String SPECIFICATION_SEPARATOR = ";~;"; public static final String SPECIFICATION_SEPARATOR = ";~;";
public static final String STOCK_INSUFFICIENT = "库存不足";
} }
...@@ -4,6 +4,7 @@ import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsStockMonthReportDTO; ...@@ -4,6 +4,7 @@ import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsStockMonthReportDTO;
import cn.com.glsx.dj.smartcarlife.dto.stock.MerchantShopGoodsStockDTO; import cn.com.glsx.dj.smartcarlife.dto.stock.MerchantShopGoodsStockDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantShopGoodsStock; import cn.com.glsx.dj.smartcarlife.model.MerchantShopGoodsStock;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List; import java.util.List;
...@@ -25,5 +26,7 @@ public interface MerchantShopGoodsStockMapper extends OreMapper<MerchantShopGood ...@@ -25,5 +26,7 @@ public interface MerchantShopGoodsStockMapper extends OreMapper<MerchantShopGood
List<MerchantShopGoodsStockDTO> getList(MerchantShopGoodsStockDTO dto); List<MerchantShopGoodsStockDTO> getList(MerchantShopGoodsStockDTO dto);
List<MerchantShopGoodsStockDTO> listForSettlementExport(MerchantShopGoodsStockDTO dto); List<MerchantShopGoodsStockDTO> listForSettlementExport(MerchantShopGoodsStockDTO dto);
List<MerchantShopGoodsStock> findByGoodsIds(@Param("callOutYqMerchantId") Integer callOutYqMerchantId,
@Param("merchantIds") List<Integer> collected, @Param("goodsIds")List<Integer> goodIds);
} }
\ No newline at end of file \ No newline at end of file
...@@ -11,4 +11,6 @@ import cn.com.glsx.dj.smartcarlife.model.OnlineStatementAccountDailyBalance; ...@@ -11,4 +11,6 @@ import cn.com.glsx.dj.smartcarlife.model.OnlineStatementAccountDailyBalance;
public interface OnlineStatementAccountDailyBalanceMapper extends OreMapper<OnlineStatementAccountDailyBalance> { public interface OnlineStatementAccountDailyBalanceMapper extends OreMapper<OnlineStatementAccountDailyBalance> {
List<OnlineStatementAccountDailyBalanceDTO> list(OnlineStatementAccountDailyBalanceDTO condition); List<OnlineStatementAccountDailyBalanceDTO> list(OnlineStatementAccountDailyBalanceDTO condition);
OnlineStatementAccountDailyBalanceDTO countTotal(OnlineStatementAccountDailyBalanceDTO condition);
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,4 +18,5 @@ public interface PurchaseOrderDeliveryMapper extends OreMapper<PurchaseOrderDeli ...@@ -18,4 +18,5 @@ public interface PurchaseOrderDeliveryMapper extends OreMapper<PurchaseOrderDeli
List<PurchaseOrderDeliveryDTO> listOrderDeliveryDetailPage(PurchaseOrderDeliveryDTO condition); List<PurchaseOrderDeliveryDTO> listOrderDeliveryDetailPage(PurchaseOrderDeliveryDTO condition);
List<PurchaseOrderDeliveryDTO> listAllocateDeliveryPage(PurchaseOrderDeliveryDTO condition);
} }
package cn.com.glsx.dj.smartcarlife.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateAuditDetail;
@Mapper
public interface StockAllocateAuditDetailMapper extends OreMapper<StockAllocateAuditDetail> {
List<StockAllocateAuditDetail> list(StockAllocateAuditDetail record);
StockAllocateAuditDetail getRejectCauseByAllocateCode(@Param("allocateCode") String allocateCode);
}
\ No newline at end of file \ No newline at end of file
...@@ -3,12 +3,36 @@ package cn.com.glsx.dj.smartcarlife.mapper; ...@@ -3,12 +3,36 @@ package cn.com.glsx.dj.smartcarlife.mapper;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO; import cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateDetail; import cn.com.glsx.dj.smartcarlife.model.StockAllocateDetail;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface StockAllocateDetailMapper extends OreMapper<StockAllocateDetail> { public interface StockAllocateDetailMapper extends OreMapper<StockAllocateDetail> {
List<StockAllocateDetailDTO> listStockAllocateDetailPage(StockAllocateDetailDTO condition); List<StockAllocateDetailDTO> listStockAllocateDetailPage(StockAllocateDetailDTO condition);
void updateDetailInputNumber(@Param("id") Long id, @Param("updatedBy") String updatedBy);
void updateBatchOutStockQty(@Param("allocateCode") String allocateCode);
void delDetailByAllocateCode(@Param("allocateCode") String allocateCode, @Param("updatedBy") String updatedBy);
BigDecimal getTotalAllocateNumByAllocateCode(@Param("allocateCode") String allocateCode);
BigDecimal getTotalDeliveryNumByOrderCode(@Param("allocateCode") String allocateCode);
/**
* 更新调拨商品已发货数量
* @param id
* @param updatedBy
*/
void updateAllocateOrderGoodsDeliveryNumber(@Param("id") Long id, @Param("updatedBy") String updatedBy);
/**
* 更新调拨商品发货状态
*/
void updateAllocateOrderGoodsDeliveryStatus(@Param("id") Long id, @Param("updatedBy") String updatedBy);
} }
package cn.com.glsx.dj.smartcarlife.mapper; package cn.com.glsx.dj.smartcarlife.mapper;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordDTO; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordExportDTO;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateRecord; import cn.com.glsx.dj.smartcarlife.model.StockAllocateRecord;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Mapper @Mapper
...@@ -19,4 +20,22 @@ public interface StockAllocateRecordMapper extends OreMapper<StockAllocateRecord ...@@ -19,4 +20,22 @@ public interface StockAllocateRecordMapper extends OreMapper<StockAllocateRecord
List<StockAllocateRecordDTO> listStockAllocateRecord(StockAllocateRecordDTO condition); List<StockAllocateRecordDTO> listStockAllocateRecord(StockAllocateRecordDTO condition);
List<StockAllocateRecordExportDTO> listStockAllocateRecordExport(StockAllocateRecordDTO condition); List<StockAllocateRecordExportDTO> listStockAllocateRecordExport(StockAllocateRecordDTO condition);
StockAllocateRecordDTO findByAllocateCode(@Param("allocateCode") String allocateCode);
/**
* 查询总的采购库存
* @param orderCode
*/
BigDecimal getTotalStockNumByOrderCode(@Param("allocateCode") String orderCode);
/**
* 调拨发货分页查询
*/
List<StockAllocateDeliveryListDTO> allocateDeliveryPage(StockAllocateDeliveryPageDTO dto);
/**
* 调拨发货驳回
*/
int allocateDeliveryReject(AllocateDeliveryRejectDTO dto);
} }
package cn.com.glsx.dj.smartcarlife.mapper;
import cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface StockFlowMapper {
List<StockFlowDTO> listStockFlow(StockFlowDTO condition);
}
...@@ -58,4 +58,15 @@ public class OnlineStatementAccountDailyBalanceRemoteImpl implements OnlineState ...@@ -58,4 +58,15 @@ public class OnlineStatementAccountDailyBalanceRemoteImpl implements OnlineState
} }
} }
@Override
public RpcResponse<OnlineStatementAccountDailyBalanceDTO> countTotal(
OnlineStatementAccountDailyBalanceDTO condition) {
try{
return RpcResponse.success(onlineStatementAccountDailyBalanceService.countTotal(condition));
}catch(RpcServiceException e){
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
} }
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.remote; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.*; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.businessassistant.PurchaseOrderGoodsBaseDTO; import cn.com.glsx.dj.smartcarlife.dto.businessassistant.PurchaseOrderGoodsBaseDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.OrderGoodsDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderGoodsPageDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderGoodsPageDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderSelfDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderSelfDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.SelfPurchaseOrderGoodsDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.SelfPurchaseOrderGoodsDTO;
...@@ -324,7 +325,17 @@ public class PurchaseOrderRemoteImpl implements PurchaseOrderRemote { ...@@ -324,7 +325,17 @@ public class PurchaseOrderRemoteImpl implements PurchaseOrderRemote {
} }
} }
@Override @Override
public RpcResponse<OrderGoodsDTO> getH5GoodsDetail(Long id) {
try {
return RpcResponse.success(purchaseOrderGoodsService.getH5GoodsDetail(id));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> goodsRefund(PurchaseOrderDTO condition) { public RpcResponse<Boolean> goodsRefund(PurchaseOrderDTO condition) {
try { try {
return RpcResponse.success(purchaseOrderService.goodsRefund(condition)); return RpcResponse.success(purchaseOrderService.goodsRefund(condition));
......
package cn.com.glsx.dj.smartcarlife.remote; package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordDTO; import cn.com.glsx.dj.smartcarlife.service.PurchaseOrderDeliveryService;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordExportDTO;
import cn.com.glsx.dj.smartcarlife.service.stock.StockAllocateDetailService; import cn.com.glsx.dj.smartcarlife.service.stock.StockAllocateDetailService;
import cn.com.glsx.dj.smartcarlife.service.stock.StockAllocateRecordService; import cn.com.glsx.dj.smartcarlife.service.stock.StockAllocateRecordService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
...@@ -25,10 +24,12 @@ public class StockAllocateRemoteImpl implements StockAllocateRemote { ...@@ -25,10 +24,12 @@ public class StockAllocateRemoteImpl implements StockAllocateRemote {
private StockAllocateRecordService stockAllocateRecordService; private StockAllocateRecordService stockAllocateRecordService;
@Autowired @Autowired
private StockAllocateDetailService stockAllocateDetailService; private StockAllocateDetailService stockAllocateDetailService;
@Autowired
private PurchaseOrderDeliveryService purchaseOrderDeliveryService;
@Override @Override
public RpcResponse<Boolean> saveStockAllocateRecord(@NotNull StockAllocateRecordDTO stockAllocateRecordDTO) { public RpcResponse<String> saveStockAllocateRecord(@NotNull StockAllocateRecordDTO stockAllocateRecordDTO) {
try { try {
return RpcResponse.success(stockAllocateRecordService.saveStockAllocateRecord(stockAllocateRecordDTO)); return RpcResponse.success(stockAllocateRecordService.saveStockAllocateRecord(stockAllocateRecordDTO));
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
...@@ -68,4 +69,92 @@ public class StockAllocateRemoteImpl implements StockAllocateRemote { ...@@ -68,4 +69,92 @@ public class StockAllocateRemoteImpl implements StockAllocateRemote {
return RpcResponse.error(e); return RpcResponse.error(e);
} }
} }
@Override
public RpcResponse<String> updateStockAllocateRecord(
StockAllocateRecordDTO stockAllocateRecordDTO) {
try {
return RpcResponse.success(stockAllocateRecordService.updateStockAllocateRecord(stockAllocateRecordDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> updateStockAllocateRecordStatus(
StockAllocateRecordDTO stockAllocateRecordDTO) {
try {
return RpcResponse.success(stockAllocateRecordService.updateStockAllocateRecordStatus(stockAllocateRecordDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<StockAllocateRecordDTO> getDetailByAllocateCode(@NotBlank String allocateCode) {
try {
return RpcResponse.success(stockAllocateRecordService.getDetailByAllocateCode(allocateCode));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<StockAllocateRecordDTO> getH5Detail(@NotBlank String allocateCode) {
try {
return RpcResponse.success(stockAllocateRecordService.getH5Detail(allocateCode));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<StockAllocateDetailDTO> getH5GoodsDetail(@NotNull Long id) {
try {
return RpcResponse.success(stockAllocateDetailService.getById(id));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> allocateDeliveryBatch(PurchaseOrderDeliveryDTO dto) {
try {
return RpcResponse.success(purchaseOrderDeliveryService.allocateDeliveryBatch(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
/**
* 调拨发货分页查询
*/
@Override
public RpcResponse<RpcPagination<StockAllocateDeliveryListDTO>> allocateDeliveryPage(StockAllocateDeliveryPageDTO dto) {
try {
return RpcResponse.success(RpcPagination.copyPage(purchaseOrderDeliveryService.allocateDeliveryPage(dto)));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
/**
* 调拨发货驳回
*/
@Override
public RpcResponse<Boolean> allocateDeliveryReject(AllocateDeliveryRejectDTO dto) {
try {
return RpcResponse.success(purchaseOrderDeliveryService.allocateDeliveryReject(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
} }
package cn.com.glsx.dj.smartcarlife.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordDTO;
import cn.com.glsx.dj.smartcarlife.service.StockAllocateReviewService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(validation = "true",version = "1.0.0")
public class StockAllocateReviewRemoteImpl implements StockAllocateReviewRemote {
@Autowired
private StockAllocateReviewService stockAllocateReviewService;
@Override
public RpcResponse<Boolean> operatorAudit(StockAllocateRecordDTO dto) {
try {
return RpcResponse.success(stockAllocateReviewService.operatorAudit(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> businessAudit(StockAllocateRecordDTO dto) {
try {
return RpcResponse.success(stockAllocateReviewService.businessAudit(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> businessReject(StockAllocateRecordDTO dto) {
try {
return RpcResponse.success(stockAllocateReviewService.businessReject(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO;
import cn.com.glsx.dj.smartcarlife.service.stock.StockFlowService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
@DubboService
@Slf4j
public class StockFlowRemoteImpl implements StockFlowRemote {
@Autowired
private StockFlowService stockFlowService;
@Override
public RpcResponse<RpcPagination<StockFlowDTO>> page(RpcPagination<StockFlowDTO> pagination) {
try {
Page<StockFlowDTO> page = stockFlowService.page(pagination);
return RpcResponse.success(RpcPagination.copyPage(page));
} catch (Exception e) {
log.error("StockFlowRemoteImpl.page error", e);
return RpcResponse.error(e);
}
}
}
...@@ -165,6 +165,11 @@ public class GoodsOrderApplyRecordService { ...@@ -165,6 +165,11 @@ public class GoodsOrderApplyRecordService {
if(StringUtils.isNotBlank(orderApplyRecordDTO.getOrderCode())){ if(StringUtils.isNotBlank(orderApplyRecordDTO.getOrderCode())){
GoodsOrderDTO goodsOrderInfo = goodsOrderService.getPackageGoodsDetailByOrderCode(orderApplyRecordDTO.getOrderCode()); GoodsOrderDTO goodsOrderInfo = goodsOrderService.getPackageGoodsDetailByOrderCode(orderApplyRecordDTO.getOrderCode());
orderApplyRecordDTO.setGoodsOrderDTO(goodsOrderInfo); orderApplyRecordDTO.setGoodsOrderDTO(goodsOrderInfo);
if(ObjectUtil.isNotNull(goodsOrderInfo)){
orderApplyRecordDTO.setOrderRemark(goodsOrderInfo.getRemark());
orderApplyRecordDTO.setPayVoucherList(goodsOrderInfo.getPayVoucherList());
orderApplyRecordDTO.setOutTradeNo(ObjectUtil.isNotNull(goodsOrderInfo.getPayOrder()) ? goodsOrderInfo.getPayOrder().getOutTradeNo() : StringUtils.EMPTY);
}
} }
return orderApplyRecordDTO; return orderApplyRecordDTO;
}catch(RpcServiceException e){ }catch(RpcServiceException e){
......
...@@ -2181,10 +2181,14 @@ public class GoodsOrderService { ...@@ -2181,10 +2181,14 @@ public class GoodsOrderService {
.reduceStockNum(detail.getReduceStockNum()).businessCode(dto.getOrderCode()) .reduceStockNum(detail.getReduceStockNum()).businessCode(dto.getOrderCode())
.storeUsage(orderDTO.getMerchantName()).filmRollNo(detail.getFilmRollNo()) .storeUsage(orderDTO.getMerchantName()).filmRollNo(detail.getFilmRollNo())
.technicianName(detail.getTechnicianName()).technicianPhone(detail.getTechnicianPhone()) .technicianName(detail.getTechnicianName()).technicianPhone(detail.getTechnicianPhone())
.updatedBy(CommonConstants.DEFAULT_UPDATE_BY).reduceDate(dto.getReduceDate()).build(); .updatedBy(CommonConstants.DEFAULT_UPDATE_BY).reduceDate(dto.getReduceDate())
merchantGoodsStockReduceRecordService.reduceStock(record, StockUpdateTypeEnum.REDUCE); .updatedUserName(dto.getOperatorName())
.build();
merchantGoodsStockReduceRecordService.reduceStock(record, StockUpdateTypeEnum.REDUCE_ONLY_ENOUGH);
} }
} catch (Exception e) { } catch (RpcServiceException e) {
throw e;
} catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR); throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
} }
...@@ -4421,6 +4425,7 @@ public class GoodsOrderService { ...@@ -4421,6 +4425,7 @@ public class GoodsOrderService {
.increaseTime(new Date()).increaseStockType(IncreaseStockTypeEnum.ORDER.getValue()) .increaseTime(new Date()).increaseStockType(IncreaseStockTypeEnum.ORDER.getValue())
.productCode(upgradeGoods.getType()).increaseStockNum(detail.getIncreaseStockNum()) .productCode(upgradeGoods.getType()).increaseStockNum(detail.getIncreaseStockNum())
.filmRollNo(detail.getFilmRollNo()) .filmRollNo(detail.getFilmRollNo())
.updatedUserName(dto.getOperator())
.upgradeFlag(orderDTO.getUpgradeFlag()).updatedBy(CommonConstants.DEFAULT_UPDATE_BY).build(); .upgradeFlag(orderDTO.getUpgradeFlag()).updatedBy(CommonConstants.DEFAULT_UPDATE_BY).build();
goodsWarehousingInfoService.addGoodsWarehousingInfo(info); goodsWarehousingInfoService.addGoodsWarehousingInfo(info);
} }
......
...@@ -107,6 +107,9 @@ public class GoodsWarehousingInfoService { ...@@ -107,6 +107,9 @@ public class GoodsWarehousingInfoService {
dto.setCreatedBy(dto.getUpdatedBy()); dto.setCreatedBy(dto.getUpdatedBy());
dto.setCreatedDate(now); dto.setCreatedDate(now);
dto.setUpdatedDate(now); dto.setUpdatedDate(now);
if (StringUtils.isBlank(dto.getUpdatedUserName())) {
log.warn("入库操作人为空");
}
dto.setDeletedFlag(DeleteFlagEnum.N.getValue()); dto.setDeletedFlag(DeleteFlagEnum.N.getValue());
goodsWarehousingInfoMapper.insertUseGeneratedKeys(dto); goodsWarehousingInfoMapper.insertUseGeneratedKeys(dto);
} }
......
...@@ -28,6 +28,7 @@ import cn.com.glsx.scrm.wechat.enums.WorkWechatAppCodeEnum; ...@@ -28,6 +28,7 @@ import cn.com.glsx.scrm.wechat.enums.WorkWechatAppCodeEnum;
import cn.com.glsx.scrm.wechat.enums.WorkWechatAppMessageTypeEnum; import cn.com.glsx.scrm.wechat.enums.WorkWechatAppMessageTypeEnum;
import cn.com.glsx.scrm.wechat.model.WorkWechatCorpInfo; import cn.com.glsx.scrm.wechat.model.WorkWechatCorpInfo;
import cn.com.glsx.scrm.wechat.remote.WorkWechatCorpApplicationRemote; import cn.com.glsx.scrm.wechat.remote.WorkWechatCorpApplicationRemote;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -278,6 +279,26 @@ public class MerchantConcatService { ...@@ -278,6 +279,26 @@ public class MerchantConcatService {
entmicroStaffRequest.setMerchantId(env.getProperty("send.work.wechat.merchant.id", Integer.class, 44211227)); entmicroStaffRequest.setMerchantId(env.getProperty("send.work.wechat.merchant.id", Integer.class, 44211227));
entmicroStaffRequest.setStaffPhone(phone); entmicroStaffRequest.setStaffPhone(phone);
RpcResponse<List<EntmicroStaffResponse>> staffResponse = entmicroStaffRemote.findStaffByMerchantId(entmicroStaffRequest); RpcResponse<List<EntmicroStaffResponse>> staffResponse = entmicroStaffRemote.findStaffByMerchantId(entmicroStaffRequest);
log.info("根据手机号{}查询userId,结果{}", phone, JSONUtil.toJsonStr(staffResponse));
if (staffResponse.isSuccess()) {
List<EntmicroStaffResponse> result = staffResponse.getResult();
if (CollectionUtils.isNotEmpty(result)) {
return result.get(0).getUserId();
}
}
if (staffResponse.isFailed()) {
log.error("根据手机号{}查询userId失败,失败原因{}", phone, staffResponse.getException().getMessage());
}
return null;
}
public String getUserId(String phone, Integer merchantId) {
EntmicroStaffRequest entmicroStaffRequest = new EntmicroStaffRequest();
entmicroStaffRequest.setMerchantId(merchantId);
entmicroStaffRequest.setStaffPhone(phone);
RpcResponse<List<EntmicroStaffResponse>> staffResponse = entmicroStaffRemote.findStaffByMerchantId(entmicroStaffRequest);
log.info("根据手机号{}查询userId,结果{}", phone, JSONUtil.toJsonStr(staffResponse));
if (staffResponse.isSuccess()) { if (staffResponse.isSuccess()) {
List<EntmicroStaffResponse> result = staffResponse.getResult(); List<EntmicroStaffResponse> result = staffResponse.getResult();
if (CollectionUtils.isNotEmpty(result)) { if (CollectionUtils.isNotEmpty(result)) {
......
...@@ -275,9 +275,15 @@ public class PayOrderService { ...@@ -275,9 +275,15 @@ public class PayOrderService {
} }
} }
} }
payOrder.setTradeNo(payOrder.getOutTradeNo()); //payOrder.setTradeNo(payOrder.getOutTradeNo());
checkForTradeNo(payOrder, goodsOrder); checkForTradeNo(payOrder, goodsOrder);
payOrder.setTradeNo(payOrder.getOutTradeNo()); if (StringUtils.isNotBlank(payOrder.getTradeNo())) {
payOrder.setTradeNo(payOrder.getTradeNo());
} else {
payOrder.setTradeNo(payOrder.getOutTradeNo());
}
log.info("payOrder.outTradeNo:{},payOrder.tradeNo:{}, ", payOrder.getOutTradeNo(), payOrder.getTradeNo());
//payOrder.setTradeNo(payOrder.getOutTradeNo());
payOrder.setPayStatus(PayStatus.PAYED.getValue()); payOrder.setPayStatus(PayStatus.PAYED.getValue());
payOrder.setSuccessDate(getOrderSuccessDate(associateFailureOrder, payOrder.getSuccessDate(), now)); payOrder.setSuccessDate(getOrderSuccessDate(associateFailureOrder, payOrder.getSuccessDate(), now));
//payOrder.setActualMoney(goodsOrder.getTotalPrice()); //payOrder.setActualMoney(goodsOrder.getTotalPrice());
......
...@@ -162,6 +162,7 @@ public class PurchaseApplyRecordService { ...@@ -162,6 +162,7 @@ public class PurchaseApplyRecordService {
public Boolean audit(PurchaseApplyAuditDTO record) { public Boolean audit(PurchaseApplyAuditDTO record) {
RpcAssert.assertNotNull(record,DefaultErrorEnum.DATA_NULL,"record must not be null"); RpcAssert.assertNotNull(record,DefaultErrorEnum.DATA_NULL,"record must not be null");
RpcAssert.assertNotNull(record.getId(),DefaultErrorEnum.DATA_NULL,"record.id must not be null"); RpcAssert.assertNotNull(record.getId(),DefaultErrorEnum.DATA_NULL,"record.id must not be null");
String operator = record.getOperator();
try { try {
PurchaseApplyRecord o = PurchaseApplyRecord.builder().id(record.getId()).deletedFlag(DeletedFlagEnum.N.name()).build(); PurchaseApplyRecord o = PurchaseApplyRecord.builder().id(record.getId()).deletedFlag(DeletedFlagEnum.N.name()).build();
PurchaseApplyRecord applyRecord = purchaseApplyRecordMapper.selectOne(o); PurchaseApplyRecord applyRecord = purchaseApplyRecordMapper.selectOne(o);
...@@ -178,6 +179,7 @@ public class PurchaseApplyRecordService { ...@@ -178,6 +179,7 @@ public class PurchaseApplyRecordService {
//采购订单模块联动逻辑 //采购订单模块联动逻辑
goods.setUpdatedBy(record.getUpdatedBy()); goods.setUpdatedBy(record.getUpdatedBy());
BeanUtils.copyProperties(applyRecord,record); BeanUtils.copyProperties(applyRecord,record);
record.setOperator(operator);
String orderCode = purchaseOrderService.createOrderByAuditPass(record, goods); String orderCode = purchaseOrderService.createOrderByAuditPass(record, goods);
o.setPurchaseOrderCode(orderCode); o.setPurchaseOrderCode(orderCode);
......
...@@ -4,9 +4,11 @@ import cn.com.glsx.dj.smartcarlife.constant.CommonConstants; ...@@ -4,9 +4,11 @@ import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.dto.GoodsWarehousingInfoDTO; import cn.com.glsx.dj.smartcarlife.dto.GoodsWarehousingInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDTO; import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDTO;
import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO; import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO;
import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderGoodsPageDTO; import cn.com.glsx.dj.smartcarlife.dto.purchase.PurchaseOrderGoodsPageDTO;
import cn.com.glsx.dj.smartcarlife.dto.stock.VdCardDTO; import cn.com.glsx.dj.smartcarlife.dto.stock.VdCardDTO;
import cn.com.glsx.dj.smartcarlife.enums.PurchaseOrderEnum; import cn.com.glsx.dj.smartcarlife.enums.PurchaseOrderEnum;
import cn.com.glsx.dj.smartcarlife.enums.purchaseGoods.DeliveryOrderTypeEnum;
import cn.com.glsx.dj.smartcarlife.mapper.PurchaseOrderDeliveryDetailMapper; import cn.com.glsx.dj.smartcarlife.mapper.PurchaseOrderDeliveryDetailMapper;
import cn.com.glsx.dj.smartcarlife.model.PurchaseOrder; import cn.com.glsx.dj.smartcarlife.model.PurchaseOrder;
import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderDelivery; import cn.com.glsx.dj.smartcarlife.model.PurchaseOrderDelivery;
...@@ -84,6 +86,28 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -84,6 +86,28 @@ public class PurchaseOrderDeliveryDetailService {
} }
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public PurchaseOrderDeliveryDetail allocateDeliveryDetailInsert(PurchaseOrderDeliveryDetail record) {
RpcAssert.assertNotNull(record, DefaultErrorEnum.DATA_NULL,"PurchaseOrderDeliveryDetail is null");
RpcAssert.assertNotNull(record.getOrderDeliveryId(), DefaultErrorEnum.DATA_NULL,"PurchaseOrderDeliveryDetail.orderDeliveryId is null");
RpcAssert.assertNotNull(record.getOrderCode(), DefaultErrorEnum.DATA_NULL,"PurchaseOrderDeliveryDetail.orderCode is null");
RpcAssert.assertNotNull(record.getUpgradeGoodsId(), DefaultErrorEnum.DATA_NULL,"PurchaseOrderDeliveryDetail.upgradeGoodsId is null");
RpcAssert.assertNotNull(record.getPurchaseNumber(), DefaultErrorEnum.DATA_NULL,"PurchaseOrderDeliveryDetail.purchaseNumber is null");
RpcAssert.assertNotEmpty(record.getCreatedBy(), DefaultErrorEnum.DATA_NULL,"PurchaseOrderDelivery.createdBy is null");
RpcAssert.assertNotNull(record.getAllocateOrderGoodsId(), DefaultErrorEnum.DATA_NULL,"PurchaseOrderDeliveryDetail.getAllocateOrderGoodsId is null");
try {
record.setUpdatedBy(record.getCreatedBy());
record.setCreatedDate(new Date());
record.setUpdatedDate(record.getCreatedDate());
record.setDeletedFlag(DeletedFlagEnum.N.name());
purchaseOrderDeliveryDetailMapper.insertUseGeneratedKeys(record);
return record;
}catch(Exception e) {
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void batchInsert(PurchaseOrderDeliveryDTO record, PurchaseOrderDelivery purchaseOrderDelivery, Map<Long, PurchaseOrderGoodsPageDTO> orderGoodsIdMap) { public void batchInsert(PurchaseOrderDeliveryDTO record, PurchaseOrderDelivery purchaseOrderDelivery, Map<Long, PurchaseOrderGoodsPageDTO> orderGoodsIdMap) {
List<PurchaseOrderDeliveryDetailDTO> deliveryDetailList = record.getDeliveryDetailList(); List<PurchaseOrderDeliveryDetailDTO> deliveryDetailList = record.getDeliveryDetailList();
...@@ -106,9 +130,9 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -106,9 +130,9 @@ public class PurchaseOrderDeliveryDetailService {
final List<Integer> FILM_COUPON_TYPES = JSONArray.parseArray(Optional.ofNullable(env.getProperty("dj.goods.filmCouponTypes")).orElse(CommonConstants.DEFAULT_FILM_GOOD_TYPES), Integer.class); final List<Integer> FILM_COUPON_TYPES = JSONArray.parseArray(Optional.ofNullable(env.getProperty("dj.goods.filmCouponTypes")).orElse(CommonConstants.DEFAULT_FILM_GOOD_TYPES), Integer.class);
boolean isFilmType = FILM_COUPON_TYPES.contains(detailDTO.getGoodsType()); boolean isFilmType = FILM_COUPON_TYPES.contains(detailDTO.getGoodsType());
if (Objects.nonNull(conversionValue) && isFilmType) { if (Objects.nonNull(conversionValue) && isFilmType) {
detailDTO.setStockNum(conversionValue.multiply(BigDecimal.valueOf(detailDTO.getPurchaseNumber()))); detailDTO.setStockNum(conversionValue.multiply(detailDTO.getPurchaseNumber()));
} else { } else {
detailDTO.setStockNum(BigDecimal.valueOf(detailDTO.getPurchaseNumber())); detailDTO.setStockNum(detailDTO.getPurchaseNumber());
} }
detailDTO.setCreatedBy(record.getCreatedBy()); detailDTO.setCreatedBy(record.getCreatedBy());
if (CollectionUtils.isNotEmpty(detailDTO.getDeliveryCardList())) { if (CollectionUtils.isNotEmpty(detailDTO.getDeliveryCardList())) {
...@@ -155,6 +179,38 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -155,6 +179,38 @@ public class PurchaseOrderDeliveryDetailService {
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void allocateBatchInsert(PurchaseOrderDeliveryDTO record, PurchaseOrderDelivery purchaseOrderDelivery, Map<Long, StockAllocateDetailDTO> orderGoodsIdMap) {
List<PurchaseOrderDeliveryDetailDTO> deliveryDetailList = record.getDeliveryDetailList();
for (PurchaseOrderDeliveryDetailDTO detailDTO : deliveryDetailList) {
StockAllocateDetailDTO allocateDetail = orderGoodsIdMap.get(detailDTO.getAllocateOrderGoodsId());
detailDTO.setOrderDeliveryId(purchaseOrderDelivery.getId());
detailDTO.setOrderCode(allocateDetail.getAllocateCode());
detailDTO.setGoodsCode("");
detailDTO.setGoodsName(allocateDetail.getSourceMaterialName());
detailDTO.setGoodsType(allocateDetail.getGoodsType());
detailDTO.setGoodsTypeName(allocateDetail.getGoodsTypeName());
detailDTO.setUpgradeGoodsId(allocateDetail.getGoodsId());
detailDTO.setType(allocateDetail.getProductCode());
detailDTO.setUpgradeGoodsName(allocateDetail.getGoodsName());
//detailDTO.setDeliveryRemark(allocateDetail.getDeliveryRemark());
/*BigDecimal conversionValue = allocateDetail.getConversionValue();
final List<Integer> FILM_COUPON_TYPES = JSONArray.parseArray(Optional.ofNullable(env.getProperty("dj.goods.filmCouponTypes")).orElse(CommonConstants.DEFAULT_FILM_GOOD_TYPES), Integer.class);
boolean isFilmType = FILM_COUPON_TYPES.contains(detailDTO.getGoodsType());
if (isFilmType) {
detailDTO.setStockNum(conversionValue.multiply(BigDecimal.valueOf(detailDTO.getPurchaseNumber())));
} else {
detailDTO.setStockNum(BigDecimal.valueOf(detailDTO.getPurchaseNumber()));
}*/
detailDTO.setStockNum(detailDTO.getPurchaseNumber());
detailDTO.setCreatedBy(record.getCreatedBy());
detailDTO.setPutStatus(PurchaseOrderEnum.PutStatus.NO_SIGN.getValue());
thiz.allocateDeliveryDetailInsert(detailDTO);
}
}
/** /**
* 根据采购订单查询总的发货数量 * 根据采购订单查询总的发货数量
* @param orderCode * @param orderCode
...@@ -197,7 +253,7 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -197,7 +253,7 @@ public class PurchaseOrderDeliveryDetailService {
purchaseOrderDeliveryDetailMapper.list(pagination.getCondition()); purchaseOrderDeliveryDetailMapper.list(pagination.getCondition());
if(CollectionUtils.isNotEmpty(page.getResult())) { if(CollectionUtils.isNotEmpty(page.getResult())) {
page.getResult().stream().forEach(item->{ page.getResult().stream().forEach(item->{
if(item.getShoppingCarId() != null) { if(!Objects.equals(item.getOrderType(), DeliveryOrderTypeEnum.ALLOCATE_ORDER.getValue()) && item.getShoppingCarId() != null) {
item.setSuitCarTypeList(purchaseOrderGoodsCarTypeService.listByShoppingCarId(item.getShoppingCarId())); item.setSuitCarTypeList(purchaseOrderGoodsCarTypeService.listByShoppingCarId(item.getShoppingCarId()));
} }
}); });
...@@ -238,7 +294,9 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -238,7 +294,9 @@ public class PurchaseOrderDeliveryDetailService {
condition.setUpgradeGoodsId(record.getUpgradeGoodsId()); condition.setUpgradeGoodsId(record.getUpgradeGoodsId());
condition.setDeliveryDetailId(record.getId()); condition.setDeliveryDetailId(record.getId());
List<VdCardDTO> cardList = vdCardService.list(condition); List<VdCardDTO> cardList = vdCardService.list(condition);
record.setDeliveryCardList(cardList.stream().map(VdCardDTO::getVdCardCode).collect(Collectors.toList())); if (CollectionUtils.isNotEmpty(cardList)) {
record.setDeliveryCardList(cardList.stream().map(VdCardDTO::getVdCardCode).collect(Collectors.toList()));
}
} }
public void compileWarehousingInfos(PurchaseOrderDeliveryDetailDTO record) { public void compileWarehousingInfos(PurchaseOrderDeliveryDetailDTO record) {
...@@ -271,13 +329,26 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -271,13 +329,26 @@ public class PurchaseOrderDeliveryDetailService {
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class) @Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void markPuttedInStatus(Long orderDeliveryId, Long purchaseOrderGoodsId, String oprBy){ public void markPuttedInStatus(Long orderDeliveryId, Long purchaseOrderGoodsId, String oprBy){
RpcAssert.assertNotNull(orderDeliveryId, DefaultErrorEnum.DATA_NULL,"orderDeliveryId not be null");
RpcAssert.assertNotNull(purchaseOrderGoodsId, DefaultErrorEnum.DATA_NULL,"purchaseOrderGoodsId not be null"); RpcAssert.assertNotNull(purchaseOrderGoodsId, DefaultErrorEnum.DATA_NULL,"purchaseOrderGoodsId not be null");
markPuttedInStatus(orderDeliveryId, purchaseOrderGoodsId, null, oprBy);
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void markPuttedInStatus(Long orderDeliveryId, Long purchaseOrderGoodsId, Long allocateOrderGoodsId, String oprBy){
RpcAssert.assertNotNull(orderDeliveryId, DefaultErrorEnum.DATA_NULL,"orderDeliveryId not be null");
RpcAssert.assertNotEmpty(oprBy, DefaultErrorEnum.DATA_NULL,"oprBy not be empty"); RpcAssert.assertNotEmpty(oprBy, DefaultErrorEnum.DATA_NULL,"oprBy not be empty");
try{ try{
PurchaseOrderDeliveryDetail record = PurchaseOrderDeliveryDetail.builder().putStatus(PurchaseOrderEnum.PutStatus.YES.getValue()).updatedBy(oprBy).updatedDate(new Date()).build(); PurchaseOrderDeliveryDetail record = PurchaseOrderDeliveryDetail.builder().putStatus(PurchaseOrderEnum.PutStatus.YES.getValue()).updatedBy(oprBy).updatedDate(new Date()).build();
Example example = new Example(PurchaseOrderDeliveryDetail.class); Example example = new Example(PurchaseOrderDeliveryDetail.class);
example.createCriteria().andEqualTo("orderDeliveryId", orderDeliveryId).andEqualTo("purchaseOrderGoodsId", purchaseOrderGoodsId).andEqualTo("deletedFlag", DeletedFlagEnum.N.name()); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("orderDeliveryId", orderDeliveryId).andEqualTo("deletedFlag", DeletedFlagEnum.N.name());
if (Objects.nonNull(purchaseOrderGoodsId)) {
criteria.andEqualTo("purchaseOrderGoodsId", purchaseOrderGoodsId);
} else if (Objects.nonNull(allocateOrderGoodsId)) {
criteria.andEqualTo("allocateOrderGoodsId", allocateOrderGoodsId);
} else {
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL, "purchaseOrderGoodsId or allocateOrderGoodsId not be null");
}
purchaseOrderDeliveryDetailMapper.updateByExampleSelective(record, example); purchaseOrderDeliveryDetailMapper.updateByExampleSelective(record, example);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
...@@ -287,7 +358,7 @@ public class PurchaseOrderDeliveryDetailService { ...@@ -287,7 +358,7 @@ public class PurchaseOrderDeliveryDetailService {
public List<PurchaseOrderDeliveryDetailDTO> list(PurchaseOrderDeliveryDetailDTO dto){ public List<PurchaseOrderDeliveryDetailDTO> list(PurchaseOrderDeliveryDetailDTO dto){
try{ try{
return purchaseOrderDeliveryDetailMapper.list(dto); return purchaseOrderDeliveryDetailMapper.list(dto);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR); throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
......
...@@ -160,6 +160,17 @@ public class PurchaseOrderGoodsService { ...@@ -160,6 +160,17 @@ public class PurchaseOrderGoodsService {
} }
} }
public List<OrderGoodsDTO> listById(Long id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id not be null");
try {
OrderGoodsDTO orderGoodsDTO = OrderGoodsDTO.builder().idList(Collections.singletonList(id)).build();
return purchaseOrderGoodsMapper.list(orderGoodsDTO);
} catch (Exception e) {
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e);
}
}
public List<PurchaseOrderGoods> listByOrderCode(String orderCode){ public List<PurchaseOrderGoods> listByOrderCode(String orderCode){
RpcAssert.assertNotNull(orderCode, DefaultErrorEnum.DATA_NULL, "orderCode not be null"); RpcAssert.assertNotNull(orderCode, DefaultErrorEnum.DATA_NULL, "orderCode not be null");
...@@ -436,7 +447,7 @@ public class PurchaseOrderGoodsService { ...@@ -436,7 +447,7 @@ public class PurchaseOrderGoodsService {
purchaseOrderDeliveryDetailList = purchaseOrderDeliveryDetailList.stream().filter(x -> purchaseOrderDeliveryIdList.contains(x.getOrderDeliveryId())).collect(Collectors.toList()); purchaseOrderDeliveryDetailList = purchaseOrderDeliveryDetailList.stream().filter(x -> purchaseOrderDeliveryIdList.contains(x.getOrderDeliveryId())).collect(Collectors.toList());
i.setPurchaseOrderDeliveryDetailList(purchaseOrderDeliveryDetailList); i.setPurchaseOrderDeliveryDetailList(purchaseOrderDeliveryDetailList);
//商品筛选日期范围内发货数量 //商品筛选日期范围内发货数量
Integer totalDeliveryCount = purchaseOrderDeliveryDetailList.stream().map(PurchaseOrderDeliveryDetailDTO::getPurchaseNumber).reduce(Integer::sum).orElse(0); Integer totalDeliveryCount = purchaseOrderDeliveryDetailList.stream().map(PurchaseOrderDeliveryDetailDTO::getPurchaseNumber).reduce(BigDecimal::add).map(BigDecimal::intValue).orElse(0);
i.setPurchaseNumber(totalDeliveryCount); i.setPurchaseNumber(totalDeliveryCount);
} }
}); });
...@@ -456,4 +467,11 @@ public class PurchaseOrderGoodsService { ...@@ -456,4 +467,11 @@ public class PurchaseOrderGoodsService {
} }
public OrderGoodsDTO getH5GoodsDetail(Long id) {
List<OrderGoodsDTO> purchaseOrderGoodsList = listById(id);
if (CollectionUtils.isNotEmpty(purchaseOrderGoodsList)) {
return purchaseOrderGoodsList.get(0);
}
return null;
}
} }
...@@ -185,7 +185,7 @@ public class SendWorkWechatMessageService { ...@@ -185,7 +185,7 @@ public class SendWorkWechatMessageService {
log.info("sendMessage resp:{}", JSON.toJSONString(sendWorkWechatMessageResponseDTORpcResponse)); log.info("sendMessage resp:{}", JSON.toJSONString(sendWorkWechatMessageResponseDTORpcResponse));
if (!sendWorkWechatMessageResponseDTORpcResponse.isSuccess()) { if (!sendWorkWechatMessageResponseDTORpcResponse.isSuccess()) {
logger.info("发送企微消息,参数为:{},异常:{}", sendWorkWechatMessageRequestDTO, logger.info("发送企微消息,参数为:{},异常:{}", sendWorkWechatMessageRequestDTO,
sendWorkWechatMessageResponseDTORpcResponse.getException().getMessage()); sendWorkWechatMessageResponseDTORpcResponse.getException());
return false; return false;
} }
return true; return true;
......
...@@ -576,6 +576,7 @@ public class ConstructionInfoService { ...@@ -576,6 +576,7 @@ public class ConstructionInfoService {
goodsList.add(goods); goodsList.add(goods);
} }
reduceStock.setGoodsList(goodsList); reduceStock.setGoodsList(goodsList);
reduceStock.setOperatorName(request.getOperatorName());
goodsOrderService.orderReduceStock(reduceStock); goodsOrderService.orderReduceStock(reduceStock);
} }
...@@ -680,6 +681,7 @@ public class ConstructionInfoService { ...@@ -680,6 +681,7 @@ public class ConstructionInfoService {
public void handlerOrderWareInfoIfNeed(GoodsInventoryDTO request, String orderCode) { public void handlerOrderWareInfoIfNeed(GoodsInventoryDTO request, String orderCode) {
RefundWarehousingDTO dto = new RefundWarehousingDTO(); RefundWarehousingDTO dto = new RefundWarehousingDTO();
dto.setOrderCode(orderCode); dto.setOrderCode(orderCode);
dto.setOperator(request.getOperatorName());
List<RefundWarehousingDTO.RefundWarehousingGoods> goodsList = new ArrayList<>(); List<RefundWarehousingDTO.RefundWarehousingGoods> goodsList = new ArrayList<>();
//遍历分组 //遍历分组
for (ConstructionSubOrderRelation entry : request.getSubOrderList()) { for (ConstructionSubOrderRelation entry : request.getSubOrderList()) {
......
...@@ -50,6 +50,15 @@ public class OnlineStatementAccountDailyBalanceService { ...@@ -50,6 +50,15 @@ public class OnlineStatementAccountDailyBalanceService {
} }
} }
public OnlineStatementAccountDailyBalanceDTO countTotal(OnlineStatementAccountDailyBalanceDTO condition) {
try {
return onlineStatementAccountDailyBalanceMapper.countTotal(condition);
} catch (Exception e) {
log.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public OnlineStatementAccountDailyBalance get(Integer yqMerchantId,String reportDate) { public OnlineStatementAccountDailyBalance get(Integer yqMerchantId,String reportDate) {
RpcAssert.assertNotNull(yqMerchantId, DefaultErrorEnum.DATA_NULL,"yqMerchantId not be null"); RpcAssert.assertNotNull(yqMerchantId, DefaultErrorEnum.DATA_NULL,"yqMerchantId not be null");
RpcAssert.assertNotNull(reportDate, DefaultErrorEnum.DATA_NULL,"reportDate not be null"); RpcAssert.assertNotNull(reportDate, DefaultErrorEnum.DATA_NULL,"reportDate not be null");
......
package cn.com.glsx.dj.smartcarlife.service.stock; package cn.com.glsx.dj.smartcarlife.service.stock;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.dto.*; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.stock.MerchantShopGoodsStockDTO; import cn.com.glsx.dj.smartcarlife.dto.stock.MerchantShopGoodsStockDTO;
import cn.com.glsx.dj.smartcarlife.enums.SavePolicyEnum; import cn.com.glsx.dj.smartcarlife.enums.SavePolicyEnum;
...@@ -106,7 +107,7 @@ public class MerchantShopGoodsStockService { ...@@ -106,7 +107,7 @@ public class MerchantShopGoodsStockService {
RpcAssert.assertNotNull(record.getStock(), DefaultErrorEnum.DATA_NULL,"record.getStock() not be null"); RpcAssert.assertNotNull(record.getStock(), DefaultErrorEnum.DATA_NULL,"record.getStock() not be null");
BigDecimal stock = existRecord != null ? existRecord.getStock() : BigDecimal.ZERO; BigDecimal stock = existRecord != null ? existRecord.getStock() : BigDecimal.ZERO;
if (stock.compareTo(BigDecimal.valueOf(-1).multiply(record.getStock())) == -1) { if (stock.compareTo(BigDecimal.valueOf(-1).multiply(record.getStock())) == -1) {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "库存不足"); throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, CommonConstants.STOCK_INSUFFICIENT);
} }
if (existRecord != null) { if (existRecord != null) {
record.setId(existRecord.getId()); record.setId(existRecord.getId());
...@@ -331,4 +332,14 @@ public class MerchantShopGoodsStockService { ...@@ -331,4 +332,14 @@ public class MerchantShopGoodsStockService {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR); throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
} }
} }
public List<MerchantShopGoodsStock> findByGoodsIds(Integer callOutYqMerchantId,
List<Integer> merchantIds, List<Integer> goodIds) {
try{
return merchantShopGoodsStockMapper.findByGoodsIds(callOutYqMerchantId,merchantIds,goodIds);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
} }
package cn.com.glsx.dj.smartcarlife.service.stock;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.smartcarlife.mapper.StockAllocateAuditDetailMapper;
import cn.com.glsx.dj.smartcarlife.model.StockAllocateAuditDetail;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class StockAllocateAuditDetailService {
@Lazy
@Autowired
private StockAllocateAuditDetailService thiz;
@Autowired
private StockAllocateAuditDetailMapper stockAllocateAuditDetailMapper;
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void add(StockAllocateAuditDetail record) {
RpcAssert.assertNotNull(record, DefaultErrorEnum.DATA_NULL,"record not be null");
RpcAssert.assertNotEmpty(record.getAllocateCode(), DefaultErrorEnum.DATA_NULL,"record.allocateCode not be empty");
RpcAssert.assertNotNull(record.getStatus(), DefaultErrorEnum.DATA_NULL,"record.getStatus() not be null");
RpcAssert.assertNotEmpty(record.getReviewedBy(), DefaultErrorEnum.DATA_NULL,"record.getReviewedBy() not be empty");
RpcAssert.assertNotNull(record.getReviewedDate(), DefaultErrorEnum.DATA_NULL,"record.getReviewedDate() not be null");
RpcAssert.assertNotEmpty(record.getUpdatedBy(), DefaultErrorEnum.DATA_NULL,"record.getUpdatedBy() not be empty");
try{
Date now = new Date();
record.setCreatedBy(record.getUpdatedBy());
record.setCreatedDate(now);
record.setUpdatedDate(now);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
stockAllocateAuditDetailMapper.insertUseGeneratedKeys(record);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public List<StockAllocateAuditDetail> listByAllocateCode(String allocateCode){
RpcAssert.assertNotEmpty(allocateCode, DefaultErrorEnum.DATA_NULL,"allocateCode not be empty");
try{
StockAllocateAuditDetail record = StockAllocateAuditDetail.builder().allocateCode(allocateCode).build();
return stockAllocateAuditDetailMapper.list(record);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public StockAllocateAuditDetail getRejectCauseByAllocateCode(String allocateCode){
RpcAssert.assertNotEmpty(allocateCode, DefaultErrorEnum.DATA_NULL,"allocateCode not be empty");
try{
return stockAllocateAuditDetailMapper.getRejectCauseByAllocateCode(allocateCode);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
}
...@@ -173,6 +173,7 @@ public class StockCheckRecordService { ...@@ -173,6 +173,7 @@ public class StockCheckRecordService {
.eventType(ReduceStockEventTypeEnum.CHECK.getValue()) .eventType(ReduceStockEventTypeEnum.CHECK.getValue())
.productCode(detailDTO.getProductCode()) .productCode(detailDTO.getProductCode())
.filmRollNo(detailDTO.getFilmRollNo()) .filmRollNo(detailDTO.getFilmRollNo())
.updatedUserName(record.getOperator())
.build(); .build();
merchantGoodsStockReduceRecordService.reduceStock(stockReduceRecord, StockUpdateTypeEnum.REDUCE); merchantGoodsStockReduceRecordService.reduceStock(stockReduceRecord, StockUpdateTypeEnum.REDUCE);
} }
...@@ -188,6 +189,7 @@ public class StockCheckRecordService { ...@@ -188,6 +189,7 @@ public class StockCheckRecordService {
.increaseStockType(IncreaseStockTypeEnum.CHECK.getValue()).businessCode(record.getCheckCode()) .increaseStockType(IncreaseStockTypeEnum.CHECK.getValue()).businessCode(record.getCheckCode())
.createdBy(record.getUpdatedBy()).createdDate(date).updatedBy(record.getUpdatedBy()).updatedDate(date) .createdBy(record.getUpdatedBy()).createdDate(date).updatedBy(record.getUpdatedBy()).updatedDate(date)
.filmRollNo(detailDTO.getFilmRollNo()) .filmRollNo(detailDTO.getFilmRollNo())
.updatedUserName(record.getOperator())
.deletedFlag(BaseModel.DeletedFlagEnum.N.name()).build(); .deletedFlag(BaseModel.DeletedFlagEnum.N.name()).build();
goodsWarehousingInfoService.addGoodsWarehousingInfo(dto); goodsWarehousingInfoService.addGoodsWarehousingInfo(dto);
} }
......
package cn.com.glsx.dj.smartcarlife.service.stock;
import cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO;
import cn.com.glsx.dj.smartcarlife.mapper.StockFlowMapper;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class StockFlowService {
@Autowired
private StockFlowMapper stockFlowMapper;
public Page<StockFlowDTO> page(RpcPagination<StockFlowDTO> pagination) {
try {
StockFlowDTO condition = pagination.getCondition();
// 将统一出入库类型编码(flowTypes)转换为各自的入库/出库子类型列表
condition.parseInOutTypes();
Page<StockFlowDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(), pagination.isNeedCount());
stockFlowMapper.listStockFlow(pagination.getCondition());
return page;
} catch (Exception e) {
log.error("StockFlowService.page error", e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
}
package cn.com.glsx.dj.smartcarlife.service.stock;
import java.util.Objects;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import java.io.Serializable;
@Getter
@EqualsAndHashCode
public class StockKey implements Serializable {
private final Integer yqMerchantId;
private final Integer merchantId;
private final Integer goodsId;
private final String filmRollNo; // null 安全
public StockKey(Integer yqMerchantId, Integer merchantId, Integer goodsId, String filmRollNo) {
this.yqMerchantId = yqMerchantId;
this.merchantId = merchantId;
this.goodsId = goodsId;
this.filmRollNo = filmRollNo;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StockKey stockKey = (StockKey) o;
return Objects.equals(yqMerchantId, stockKey.yqMerchantId) &&
Objects.equals(merchantId, stockKey.merchantId) &&
Objects.equals(goodsId, stockKey.goodsId) &&
Objects.equals(filmRollNo, stockKey.filmRollNo);
}
@Override
public int hashCode() {
return Objects.hash(yqMerchantId, merchantId, goodsId, filmRollNo);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,7 @@ import java.util.Objects; ...@@ -6,6 +6,7 @@ import java.util.Objects;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.RandomUtils;
import org.oreframework.distribute.lock.annotation.GlsxDistributeLockable; import org.oreframework.distribute.lock.annotation.GlsxDistributeLockable;
...@@ -91,7 +92,7 @@ public class StockRefundRecordService { ...@@ -91,7 +92,7 @@ public class StockRefundRecordService {
record.getStockRefundDetailList().stream().forEach(item ->{ record.getStockRefundDetailList().stream().forEach(item ->{
MerchantShopGoodsStockDTO stock = merchantShopGoodsStockService.get(record.getYqMerchantId(), record.getMerchantId(), item.getUpgradeGoodsId(), item.getFilmRollNo()); MerchantShopGoodsStockDTO stock = merchantShopGoodsStockService.get(record.getYqMerchantId(), record.getMerchantId(), item.getUpgradeGoodsId(), item.getFilmRollNo());
RpcAssert.assertNotNull(stock, DefaultErrorEnum.SERVER_ERROR,"库存数据不存在"); RpcAssert.assertNotNull(stock, DefaultErrorEnum.SERVER_ERROR,"库存数据不存在");
RpcAssert.assertIsTrue(stock.getStock().compareTo(item.getRefundStock()) >=0, DefaultErrorEnum.SERVER_ERROR,"库存不足"); RpcAssert.assertIsTrue(stock.getStock().compareTo(item.getRefundStock()) >=0, DefaultErrorEnum.SERVER_ERROR, CommonConstants.STOCK_INSUFFICIENT);
}); });
} }
} }
...@@ -211,6 +212,7 @@ public class StockRefundRecordService { ...@@ -211,6 +212,7 @@ public class StockRefundRecordService {
.reduceStockNum(detail.getRefundStock()).updatedBy(record.getUpdatedBy()) .reduceStockNum(detail.getRefundStock()).updatedBy(record.getUpdatedBy())
.eventType(ReduceStockEventTypeEnum.REFUND.getValue()) .eventType(ReduceStockEventTypeEnum.REFUND.getValue())
.filmRollNo(detail.getFilmRollNo()) .filmRollNo(detail.getFilmRollNo())
.updatedUserName(record.getUpdatedBy())
.build(); .build();
merchantGoodsStockReduceRecordService.reduceStock(stockReduceRecord, StockUpdateTypeEnum.REDUCE_ONLY_ENOUGH); merchantGoodsStockReduceRecordService.reduceStock(stockReduceRecord, StockUpdateTypeEnum.REDUCE_ONLY_ENOUGH);
} }
...@@ -237,7 +239,7 @@ public class StockRefundRecordService { ...@@ -237,7 +239,7 @@ public class StockRefundRecordService {
old.getStockRefundDetailList().stream().forEach(item ->{ old.getStockRefundDetailList().stream().forEach(item ->{
MerchantShopGoodsStockDTO stock = merchantShopGoodsStockService.get(old.getYqMerchantId(), old.getMerchantId(), item.getUpgradeGoodsId(), item.getFilmRollNo()); MerchantShopGoodsStockDTO stock = merchantShopGoodsStockService.get(old.getYqMerchantId(), old.getMerchantId(), item.getUpgradeGoodsId(), item.getFilmRollNo());
RpcAssert.assertNotNull(stock, DefaultErrorEnum.SERVER_ERROR,"库存数据不存在"); RpcAssert.assertNotNull(stock, DefaultErrorEnum.SERVER_ERROR,"库存数据不存在");
RpcAssert.assertIsTrue(stock.getStock().compareTo(item.getRefundStock()) >=0, DefaultErrorEnum.SERVER_ERROR,"库存不足"); RpcAssert.assertIsTrue(stock.getStock().compareTo(item.getRefundStock()) >=0, DefaultErrorEnum.SERVER_ERROR,CommonConstants.STOCK_INSUFFICIENT);
}); });
u.setRefundTime(now); u.setRefundTime(now);
......
...@@ -23,19 +23,21 @@ ...@@ -23,19 +23,21 @@
<result column="film_roll_no" jdbcType="VARCHAR" property="filmRollNo" /> <result column="film_roll_no" jdbcType="VARCHAR" property="filmRollNo" />
<result column="warehousing_batch" jdbcType="VARCHAR" property="warehousingBatch" /> <result column="warehousing_batch" jdbcType="VARCHAR" property="warehousingBatch" />
<result column="purchase_order_goods_id" property="purchaseOrderGoodsId"/> <result column="purchase_order_goods_id" property="purchaseOrderGoodsId"/>
<result column="allocate_order_goods_id" property="allocateOrderGoodsId"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy" /> <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" /> <result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" /> <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" /> <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" />
<result column="deleted_flag" jdbcType="CHAR" property="deletedFlag" /> <result column="deleted_flag" jdbcType="CHAR" property="deletedFlag" />
<result column="updated_user_name" property="updatedUserName" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, upgrade_goods_id, increase_time, increase_stock_num, increase_stock_money, increase_stock_type, business_code, id, upgrade_goods_id, increase_time, increase_stock_num, increase_stock_money, increase_stock_type, business_code,
delivery_number, yq_merchant_id, yq_merchant_name, shop_type, merchant_id, merchant_name,purchase_order_goods_id, delivery_number, yq_merchant_id, yq_merchant_name, shop_type, merchant_id, merchant_name,purchase_order_goods_id,allocate_order_goods_id,
created_by, created_date, updated_by, updated_date, deleted_flag created_by, created_date, updated_by, updated_date, deleted_flag, updated_user_name
</sql> </sql>
<resultMap extends="BaseResultMap" id="DTOResultMap" type="cn.com.glsx.dj.smartcarlife.dto.GoodsWarehousingInfoDTO"> <resultMap extends="BaseResultMap" id="DTOResultMap" type="cn.com.glsx.dj.smartcarlife.dto.GoodsWarehousingInfoDTO">
...@@ -140,6 +142,9 @@ ...@@ -140,6 +142,9 @@
<if test="purchaseOrderGoodsId != null"> <if test="purchaseOrderGoodsId != null">
and dclgwi.purchase_order_goods_id=#{purchaseOrderGoodsId} and dclgwi.purchase_order_goods_id=#{purchaseOrderGoodsId}
</if> </if>
<if test="allocateOrderGoodsId != null">
and dclgwi.allocate_order_goods_id=#{allocateOrderGoodsId}
</if>
</where> </where>
</sql> </sql>
...@@ -147,8 +152,8 @@ ...@@ -147,8 +152,8 @@
select dclgwi.id, upgrade_goods_id, dclug.upgrade_goods_name, increase_time, dclgi.goods_name as goods_series, dclgi.goods_type_name, select dclgwi.id, upgrade_goods_id, dclug.upgrade_goods_name, increase_time, dclgi.goods_name as goods_series, dclgi.goods_type_name,
dclgi.goods_type, increase_stock_num, increase_stock_money, increase_stock_type, business_code, dclgwi.film_roll_no,dclgwi.warehousing_batch, dclgi.goods_type, increase_stock_num, increase_stock_money, increase_stock_type, business_code, dclgwi.film_roll_no,dclgwi.warehousing_batch,
delivery_number, yq_merchant_id, yq_merchant_name, shop_type, dclgwi.merchant_id, merchant_name,dclgwi.upgrade_flag, dclgwi.delivery_detail_id, delivery_number, yq_merchant_id, yq_merchant_name, shop_type, dclgwi.merchant_id, merchant_name,dclgwi.upgrade_flag, dclgwi.delivery_detail_id,
dclgwi.purchase_order_goods_id, dclgwi.purchase_order_goods_id,dclgwi.allocate_order_goods_id,
dclgwi.created_by, dclgwi.created_date, dclgwi.updated_by, dclgwi.updated_date, dclgwi.deleted_flag, dclug.type as product_code, dclgwi.created_by, dclgwi.created_date, dclgwi.updated_by, dclgwi.updated_date, dclgwi.deleted_flag, dclgwi.updated_user_name, dclug.type as product_code,
dclug.specification_data,dclug.specification_type_sequence dclug.specification_data,dclug.specification_type_sequence
from dj_car_life_goods_warehousing_info dclgwi from dj_car_life_goods_warehousing_info dclgwi
left join dj_car_life_upgrade_goods dclug on dclgwi.upgrade_goods_id = dclug.id left join dj_car_life_upgrade_goods dclug on dclgwi.upgrade_goods_id = dclug.id
...@@ -202,8 +207,8 @@ ...@@ -202,8 +207,8 @@
select select
dclgwi.id, upgrade_goods_id, dclug.upgrade_goods_name, increase_time, dclgi.goods_name as goods_series, dclgi.goods_type_name, dclgwi.id, upgrade_goods_id, dclug.upgrade_goods_name, increase_time, dclgi.goods_name as goods_series, dclgi.goods_type_name,
dclgi.goods_type, increase_stock_num, increase_stock_money, increase_stock_type, business_code, dclgi.goods_type, increase_stock_num, increase_stock_money, increase_stock_type, business_code,
dclgwi.purchase_order_goods_id, dclgwi.purchase_order_goods_id,dclgwi.allocate_order_goods_id,
yq_merchant_id, yq_merchant_name, dclgwi.created_by, dclgwi.created_date, dclgwi.updated_by, dclgwi.updated_date, yq_merchant_id, yq_merchant_name, dclgwi.created_by, dclgwi.created_date, dclgwi.updated_by, dclgwi.updated_date, dclgwi.updated_user_name,
dclgwi.deleted_flag, dclgwi.deleted_flag,
dclsar.call_out_yq_merchant_id as dclsar_call_out_yq_merchant_id dclsar.call_out_yq_merchant_id as dclsar_call_out_yq_merchant_id
from dj_car_life_goods_warehousing_info dclgwi from dj_car_life_goods_warehousing_info dclgwi
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<result column="reduce_stock_num" jdbcType="DECIMAL" property="reduceStockNum" /> <result column="reduce_stock_num" jdbcType="DECIMAL" property="reduceStockNum" />
<result column="reduce_stock_money" jdbcType="DECIMAL" property="reduceStockMoney" /> <result column="reduce_stock_money" jdbcType="DECIMAL" property="reduceStockMoney" />
<result column="business_code" jdbcType="VARCHAR" property="businessCode" /> <result column="business_code" jdbcType="VARCHAR" property="businessCode" />
<result column="delivery_number" jdbcType="VARCHAR" property="deliveryNumber" />
<result column="event_type" jdbcType="TINYINT" property="eventType" /> <result column="event_type" jdbcType="TINYINT" property="eventType" />
<result column="upgrade_flag" jdbcType="VARCHAR" property="upgradeFlag" /> <result column="upgrade_flag" jdbcType="VARCHAR" property="upgradeFlag" />
<result column="film_roll_no" jdbcType="VARCHAR" property="filmRollNo" /> <result column="film_roll_no" jdbcType="VARCHAR" property="filmRollNo" />
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
--> -->
id, yq_merchant_id, yq_merchant_name, shop_type, merchant_id, merchant_name, upgrade_goods_id, id, yq_merchant_id, yq_merchant_name, shop_type, merchant_id, merchant_name, upgrade_goods_id,
reduce_date, reduce_stock_num, reduce_stock_money, reduce_date, reduce_stock_num, reduce_stock_money,
business_code, event_type, created_by, created_date, updated_by, updated_date, deleted_flag, store_usage business_code, delivery_number, event_type, created_by, created_date, updated_by, updated_date, deleted_flag, store_usage
</sql> </sql>
<sql id="listCondition"> <sql id="listCondition">
<where> <where>
......
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
<if test="merchantId != null"> <if test="merchantId != null">
and dclmsgs.merchant_id = #{merchantId} and dclmsgs.merchant_id = #{merchantId}
</if> </if>
<if test="merchantName !=null and merchantName !=''">
and dclmsgs.merchant_name like CONCAT('%', #{merchantName},'%')
</if>
<if test="upgradeGoodsId != null"> <if test="upgradeGoodsId != null">
and dclmsgs.upgrade_goods_id = #{upgradeGoodsId} and dclmsgs.upgrade_goods_id = #{upgradeGoodsId}
</if> </if>
...@@ -268,7 +271,7 @@ ...@@ -268,7 +271,7 @@
and (dclug.upgrade_goods_name like CONCAT('%', #{upgradeGoodsNameOrSeries},'%') or dclgi.goods_name like CONCAT('%', #{upgradeGoodsNameOrSeries},'%')) and (dclug.upgrade_goods_name like CONCAT('%', #{upgradeGoodsNameOrSeries},'%') or dclgi.goods_name like CONCAT('%', #{upgradeGoodsNameOrSeries},'%'))
</if> </if>
<choose> <choose>
<when test="filmRollNo != null"> <when test="filmRollNo != null and filmRollNo !=''">
and dclmsgs.film_roll_no = #{filmRollNo} and dclmsgs.film_roll_no = #{filmRollNo}
</when> </when>
<otherwise> <otherwise>
...@@ -278,5 +281,21 @@ ...@@ -278,5 +281,21 @@
</where> </where>
order by dclmsgs.stock desc order by dclmsgs.stock desc
</select> </select>
<select id="findByGoodsIds"
resultMap="BaseResultMap">
SELECT
*
FROM dj_car_life_merchant_shop_goods_stock
WHERE deleted_flag = 'N'
and yq_merchant_id=#{callOutYqMerchantId}
and merchant_id in
<foreach collection="merchantIds" item="merchantId" open="(" separator="," close=")">
#{merchantId}
</foreach>
AND upgrade_goods_id IN
<foreach collection="goodsIds" item="goodsId" open="(" separator="," close=")">
#{goodsId}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -37,8 +37,26 @@ ...@@ -37,8 +37,26 @@
deleted_flag deleted_flag
</sql> </sql>
<sql id="conditionSql">
<where>
osadb.deleted_flag = 'N'
<if test="startTradeTime != null and startTradeTime !=''">
<![CDATA[ and osadb.report_date >= #{startTradeTime} ]]>
</if>
<if test="endTradeTime != null and endTradeTime !=''">
<![CDATA[ and osadb.report_date <= #{endTradeTime} ]]>
</if>
<if test="yqMerchantName != null and yqMerchantName !=''">
and osadb.yq_merchant_name like concat('%', #{yqMerchantName}, '%')
</if>
<if test="merchantName != null and merchantName != ''">
and osadb.merchant_name like concat('%', #{merchantName}, '%')
</if>
</where>
</sql>
<select id="list" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountDailyBalanceDTO" resultMap="DTOResultMap"> <select id="list" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountDailyBalanceDTO" resultMap="DTOResultMap">
select select * from (
select
yq_merchant_id, yq_merchant_name, yq_merchant_id, yq_merchant_name,
ifnull(sum(osadb.receive_amount),0) as receive_amount, ifnull(sum(osadb.receive_amount),0) as receive_amount,
if(count(distinct merchant_id)>1,null,merchant_id) as merchant_id, if(count(distinct merchant_id)>1,null,merchant_id) as merchant_id,
...@@ -68,23 +86,72 @@ ...@@ -68,23 +86,72 @@
</if> </if>
),0) as wait_input_money ),0) as wait_input_money
from dj_car_life_online_statement_account_daily_balance osadb from dj_car_life_online_statement_account_daily_balance osadb
<include refid="conditionSql"/>
GROUP BY osadb.yq_merchant_id
) t
<where> <where>
osadb.deleted_flag = 'N' <if test="filterAllZero != null and filterAllZero == true">
<if test="startTradeTime != null and startTradeTime !=''"> <![CDATA[
<![CDATA[ and osadb.report_date >= #{startTradeTime} ]]> and (
</if> receive_amount > 0 or
<if test="endTradeTime != null and endTradeTime !=''"> shop_division_money >0 or
<![CDATA[ and osadb.report_date <= #{endTradeTime} ]]> fws_division_money > 0 or
</if> gl_division_money > 0 or
<if test="yqMerchantName != null and yqMerchantName !=''"> service_charge > 0 or
and osadb.yq_merchant_name like concat('%', #{yqMerchantName}, '%') day_start_balance > 0 or
</if> day_end_balance > 0 or
<if test="merchantName != null and merchantName != ''"> wait_input_money > 0
and osadb.merchant_name like concat('%', #{merchantName}, '%') )
]]>
</if> </if>
</where> </where>
GROUP BY osadb.yq_merchant_id
<!-- 按收款金额降序排序 --> <!-- 按收款金额降序排序 -->
ORDER BY receive_amount desc ORDER BY receive_amount desc
</select> </select>
<select id="countTotal" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountDailyBalanceDTO" resultMap="DTOResultMap">
select
sum(receive_amount) as receive_amount,
sum(day_start_balance) as day_start_balance,
sum(day_end_balance) as day_end_balance,
sum(shop_division_money) as shop_division_money,
sum(fws_division_money) as fws_division_money,
sum(gl_division_money) as gl_division_money,
sum(service_charge) as service_charge,
sum(wait_input_money) as wait_input_money
from (
select
yq_merchant_id, yq_merchant_name,
ifnull(sum(osadb.receive_amount),0) as receive_amount,
if(count(distinct merchant_id)>1,null,merchant_id) as merchant_id,
if(count(distinct merchant_id)>1,null,merchant_name) as merchant_name,
ifnull((
select a.day_start_balance from dj_car_life_online_statement_account_daily_balance a
where a.deleted_flag='N' and a.yq_merchant_id=osadb.yq_merchant_id and a.report_date= min(osadb.report_date)
),0) as day_start_balance,
ifnull((
select a.day_end_balance from dj_car_life_online_statement_account_daily_balance a
where a.deleted_flag='N' and a.yq_merchant_id=osadb.yq_merchant_id and a.report_date= max(osadb.report_date)
),0) as day_end_balance,
ifnull(sum(osadb.shop_division_money),0) as shop_division_money,
ifnull(sum(osadb.fws_division_money),0) as fws_division_money,
ifnull(sum(osadb.gl_division_money),0) as gl_division_money,
ifnull(sum(osadb.service_charge),0) as service_charge,
ifnull((
select sum(trade_amount) from dj_car_life_online_statement_account_trade_detail osatd
left join dj_car_life_pay_order po on po.id=osatd.pay_order_id
where osatd.deleted_flag='N' and osatd.yq_merchant_id=osadb.yq_merchant_id
and osatd.division_flag='N' and po.order_code is null
<if test="startTradeTime != null and startTradeTime !=''">
<![CDATA[ and osatd.trade_time>= CONCAT(#{startTradeTime},' 00:00:00') ]]>
</if>
<if test="endTradeTime != null and endTradeTime !=''">
<![CDATA[ and osatd.trade_time<= CONCAT(#{endTradeTime},' 23:59:59') ]]>
</if>
),0) as wait_input_money
from dj_car_life_online_statement_account_daily_balance osadb
<include refid="conditionSql"/>
GROUP BY osadb.yq_merchant_id
) t
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result column="goods_type_name" jdbcType="VARCHAR" property="goodsTypeName" /> <result column="goods_type_name" jdbcType="VARCHAR" property="goodsTypeName" />
<result column="upgrade_goods_id" jdbcType="INTEGER" property="upgradeGoodsId" /> <result column="upgrade_goods_id" jdbcType="INTEGER" property="upgradeGoodsId" />
<result column="purchase_order_goods_id" property="purchaseOrderGoodsId"/> <result column="purchase_order_goods_id" property="purchaseOrderGoodsId"/>
<result column="allocate_order_goods_id" property="allocateOrderGoodsId"/>
<result column="type" jdbcType="VARCHAR" property="type" /> <result column="type" jdbcType="VARCHAR" property="type" />
<result column="upgrade_goods_name" jdbcType="VARCHAR" property="upgradeGoodsName" /> <result column="upgrade_goods_name" jdbcType="VARCHAR" property="upgradeGoodsName" />
<result column="purchase_number" jdbcType="DECIMAL" property="purchaseNumber" /> <result column="purchase_number" jdbcType="DECIMAL" property="purchaseNumber" />
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, order_delivery_id, order_code, goods_code, goods_name, goods_type, goods_type_name, id, order_delivery_id, order_code, goods_code, goods_name, goods_type, goods_type_name,
upgrade_goods_id,purchase_order_goods_id, type, upgrade_goods_name, purchase_number, stock_num, put_status, delivery_remark, created_by, upgrade_goods_id,purchase_order_goods_id, allocate_order_goods_id, type, upgrade_goods_name, purchase_number, stock_num, put_status, delivery_remark, created_by,
created_date, updated_by, updated_date, deleted_flag created_date, updated_by, updated_date, deleted_flag
</sql> </sql>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO" extends="BaseResultMap"> <resultMap id="DTOResultMap" type="cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO" extends="BaseResultMap">
...@@ -43,6 +44,20 @@ ...@@ -43,6 +44,20 @@
<result column="specification_data" jdbcType="VARCHAR" property="specificationData" /> <result column="specification_data" jdbcType="VARCHAR" property="specificationData" />
<result column="shopping_car_id" property="shoppingCarId"/> <result column="shopping_car_id" property="shoppingCarId"/>
<result column="remark" property="remark"/> <result column="remark" property="remark"/>
<result column="order_type" property="orderType"/>
<result column="contact_name" property="contactName"/>
<result column="contact_phone" property="contactPhone"/>
<result column="contact_address" property="contactAddress"/>
<result column="call_out_yq_merchant_id" property="callOutYqMerchantId" jdbcType="INTEGER"/>
<result column="call_out_yq_merchant_name" property="callOutYqMerchantName" jdbcType="VARCHAR"/>
<result column="call_out_merchant_id" property="callOutMerchantId" jdbcType="INTEGER"/>
<result column="call_out_merchant_name" property="callOutMerchantName" jdbcType="VARCHAR"/>
<result column="call_in_yq_merchant_id" property="callInYqMerchantId" jdbcType="INTEGER"/>
<result column="call_in_yq_merchant_name" property="callInYqMerchantName" jdbcType="VARCHAR"/>
<result column="call_in_merchant_id" property="callInMerchantId" jdbcType="INTEGER"/>
<result column="call_in_merchant_name" property="callInMerchantName" jdbcType="VARCHAR"/>
<result column="upload_file" property="uploadFileUrl" jdbcType="VARCHAR"/>
<result column="film_roll_no" property="filmRollNo" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
...@@ -79,6 +94,9 @@ ...@@ -79,6 +94,9 @@
<if test="purchaseOrderGoodsId != null"> <if test="purchaseOrderGoodsId != null">
and purchase_order_goods_id = #{purchaseOrderGoodsId} and purchase_order_goods_id = #{purchaseOrderGoodsId}
</if> </if>
<if test="allocateOrderGoodsId != null">
and allocate_order_goods_id = #{allocateOrderGoodsId}
</if>
</where> </where>
</select> </select>
<select id="getTotalDeliveryNum" resultType="java.math.BigDecimal" parameterType="cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO"> <select id="getTotalDeliveryNum" resultType="java.math.BigDecimal" parameterType="cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO">
...@@ -101,27 +119,41 @@ ...@@ -101,27 +119,41 @@
</select> </select>
<select id="list" parameterType="cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO" resultMap="DTOResultMap"> <select id="list" parameterType="cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO" resultMap="DTOResultMap">
select select
dclpodd.id, dclpodd.order_delivery_id, dclpodd.order_code, dclpodd.goods_code, dclpodd.goods_name, dclpodd.goods_type, dclpodd.purchase_order_goods_id, dclpodd.id, dclpodd.order_delivery_id, dclpodd.order_code, dclpodd.goods_code, dclpodd.goods_name, dclpodd.goods_type, dclpodd.purchase_order_goods_id, dclpodd.allocate_order_goods_id,
dclpodd.goods_type_name, dclpodd.upgrade_goods_id, dclpodd.type, dclpodd.upgrade_goods_name, dclpodd.purchase_number, dclpodd.goods_type_name, dclpodd.upgrade_goods_id, dclpodd.type, dclpodd.upgrade_goods_name, dclpodd.purchase_number,
dclpodd.stock_num, dclpodd.put_status, dclpodd.stock_num, dclpodd.put_status,
dclpod.delivery_company, dclpod.delivery_number, dclpod.delivery_date, dclpod.delivery_company, dclpod.delivery_number, dclpod.delivery_date,
dclpo.merchant_id, dclpo.merchant_name, dclpog.specification_data,dclpog.shopping_car_id,dclpog.remark dclpod.order_type, dclpod.contact_name, dclpod.contact_phone, dclpod.contact_address, dclpod.upload_file,
if(dclpod.order_type = 1, sar.call_in_yq_merchant_id, dclpo.merchant_id) as merchant_id,
if(dclpod.order_type = 1, sar.call_in_yq_merchant_name, dclpo.merchant_name) as merchant_name,
if(dclpod.order_type = 1, sad.specification_data, dclpog.specification_data) as specification_data,
dclpog.shopping_car_id,
dclpog.remark,
sar.call_in_merchant_id, sar.call_in_merchant_name,
sar.call_in_yq_merchant_id, sar.call_in_yq_merchant_name,
sar.call_out_merchant_id, sar.call_out_merchant_name,
sar.call_out_yq_merchant_id, sar.call_out_yq_merchant_name,
sad.film_roll_no
from dj_car_life_purchase_order_delivery_detail dclpodd from dj_car_life_purchase_order_delivery_detail dclpodd
left join dj_car_life_purchase_order_delivery dclpod left join dj_car_life_purchase_order_delivery dclpod on dclpodd.order_delivery_id = dclpod.id and dclpod.deleted_flag = 'N'
on dclpodd.order_delivery_id = dclpod.id and dclpod.deleted_flag = 'N' left join dj_car_life_purchase_order dclpo on dclpo.order_code = dclpodd.order_code and dclpo.deleted_flag = 'N'
left join dj_car_life_purchase_order dclpo on dclpo.order_code = dclpodd.order_code and dclpo.deleted_flag = 'N' left join dj_car_life_purchase_order_goods dclpog on dclpog.order_code = dclpodd.order_code and dclpog.id = dclpodd.purchase_order_goods_id and dclpog.deleted_flag = 'N'
left join dj_car_life_purchase_order_goods dclpog left join dj_car_life_stock_allocate_detail sad on sad.deleted_flag = 'N' and sad.id = dclpodd.allocate_order_goods_id
on dclpog.order_code = dclpodd.order_code and dclpog.id = dclpodd.purchase_order_goods_id and dclpog.deleted_flag = 'N' left join dj_car_life_stock_allocate_record sar on sar.allocate_code = sad.allocate_code and sar.deleted_flag = 'N'
<where> <where>
dclpodd.deleted_flag = 'N' dclpodd.deleted_flag = 'N'
<if test="id != null"> <if test="id != null">
and dclpodd.id = #{id} and dclpodd.id = #{id}
</if> </if>
<if test="yqMerchantIds != null and yqMerchantIds.size()>0"> <if test="yqMerchantIds != null and yqMerchantIds.size()>0">
and dclpo.merchant_id in and (dclpo.merchant_id in
<foreach collection="yqMerchantIds" item="item" open="(" separator="," close=")" > <foreach collection="yqMerchantIds" item="item" open="(" separator="," close=")" >
#{item} #{item}
</foreach> </foreach>
or sar.call_in_yq_merchant_id in
<foreach collection="yqMerchantIds" item="item" open="(" separator="," close=")" >
#{item}
</foreach>)
</if> </if>
<if test="upgradeGoodsName != null and upgradeGoodsName != ''"> <if test="upgradeGoodsName != null and upgradeGoodsName != ''">
and dclpodd.upgrade_goods_name like CONCAT('%', #{upgradeGoodsName},'%') and dclpodd.upgrade_goods_name like CONCAT('%', #{upgradeGoodsName},'%')
...@@ -151,7 +183,8 @@ ...@@ -151,7 +183,8 @@
and dclpodd.order_code like CONCAT('%', #{orderCode},'%') and dclpodd.order_code like CONCAT('%', #{orderCode},'%')
</if> </if>
<if test="merchantName != null and merchantName != ''"> <if test="merchantName != null and merchantName != ''">
and dclpo.merchant_name like CONCAT('%', #{merchantName},'%') and (dclpo.merchant_name like CONCAT('%', #{merchantName},'%')
or sar.call_in_yq_merchant_name like CONCAT('%', #{merchantName},'%'))
</if> </if>
<if test="putStatus != null"> <if test="putStatus != null">
and dclpodd.put_status = #{putStatus} and dclpodd.put_status = #{putStatus}
...@@ -164,6 +197,10 @@ ...@@ -164,6 +197,10 @@
and dclpodd.purchase_order_goods_id = #{purchaseOrderGoodsId} and dclpodd.purchase_order_goods_id = #{purchaseOrderGoodsId}
</if> </if>
<if test="orderType != null">
and dclpod.order_type = #{orderType}
</if>
<if test="orderDeliveryId != null"> <if test="orderDeliveryId != null">
and dclpodd.order_delivery_id = #{orderDeliveryId} and dclpodd.order_delivery_id = #{orderDeliveryId}
</if> </if>
......
...@@ -189,6 +189,23 @@ ...@@ -189,6 +189,23 @@
</where> </where>
</select> </select>
<select id="selectById" parameterType="cn.com.glsx.dj.smartcarlife.model.PurchaseOrderGoods" resultMap="DTOResultMap">
select
dclpog.id, dclpog.order_code, dclpog.goods_code, dclpog.goods_name, dclpog.goods_type, dclpog.goods_type_name, dclpog.thumb_url, dclpog.conversion_value,
dclpog.upgrade_goods_id, dclpog.upgrade_goods_commodity_code, dclpog.upgrade_goods_name, dclpog.upgrade_purchase_price, dclpog.specification_data,
dclpog.upgrade_goods_position, dclpog.position_deduction_value, dclpog.goods_number, dclpog.goods_total_price,
dclpog.purchase_number,dclpog.input_number,dclpog.shipper_uuid,dclpog.shipper,
dclpog.created_by, dclpog.created_date, dclpog.updated_by, dclpog.updated_date, dclpog.deleted_flag,
dclpog.put_yq_merchant_id, dclpog.put_yq_merchant_name, dclpog.put_merchant_id,dclpog.put_merchant_name,
dclpog.refund_status,
dclug.type as type,dclug.entity_card_flag
from dj_car_life_purchase_order_goods dclpog
left join dj_car_life_upgrade_goods dclug on dclug.id = dclpog.upgrade_goods_id and dclug.deleted_flag ='N'
<where>
dclpog.deleted_flag = 'N' and dclpog.id =#{id}
</where>
</select>
<update id="updatePurchaseOrderGoodsPurchaseNumber"> <update id="updatePurchaseOrderGoodsPurchaseNumber">
update dj_car_life_purchase_order_goods og update dj_car_life_purchase_order_goods og
set og.purchase_number = set og.purchase_number =
......
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
<result column="dd_purchase_number" jdbcType="DECIMAL" property="purchaseNumber" /> <result column="dd_purchase_number" jdbcType="DECIMAL" property="purchaseNumber" />
<result column="dd_upgrade_goods_id" jdbcType="INTEGER" property="upgradeGoodsId" /> <result column="dd_upgrade_goods_id" jdbcType="INTEGER" property="upgradeGoodsId" />
<result column="dd_purchase_order_goods_id" jdbcType="INTEGER" property="purchaseOrderGoodsId" /> <result column="dd_purchase_order_goods_id" jdbcType="INTEGER" property="purchaseOrderGoodsId" />
<result column="dd_allocate_order_goods_id" jdbcType="INTEGER" property="allocateOrderGoodsId" />
<result column="od_delivery_number" property="deliveryNumber" jdbcType="VARCHAR" /> <result column="od_delivery_number" property="deliveryNumber" jdbcType="VARCHAR" />
<result column="od_delivery_company" property="deliveryCompany" jdbcType="VARCHAR" /> <result column="od_delivery_company" property="deliveryCompany" jdbcType="VARCHAR" />
<result column="od_delivery_date" property="deliveryDate" jdbcType="TIMESTAMP" /> <result column="od_delivery_date" property="deliveryDate" jdbcType="TIMESTAMP" />
......
<?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="cn.com.glsx.dj.smartcarlife.mapper.StockAllocateAuditDetailMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.smartcarlife.model.StockAllocateAuditDetail" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="allocate_code" property="allocateCode" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="rejected_status" property="rejectedStatus" jdbcType="TINYINT" />
<result column="reviewed_by" property="reviewedBy" jdbcType="VARCHAR" />
<result column="reviewed_date" property="reviewedDate" jdbcType="TIMESTAMP" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="reject_cause" property="rejectCause" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, allocate_code, status, rejected_status, reviewed_by, reviewed_date, remark, reject_cause,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<sql id="listCondition">
<if test="allocateCode != null and allocateCode != ''">
and allocate_code = #{allocateCode}
</if>
</sql>
<select id="list" parameterType="cn.com.glsx.dj.smartcarlife.model.StockAllocateAuditDetail" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from dj_car_life_stock_allocate_audit_detail
<where>
deleted_flag = 'N'
<include refid="listCondition" />
order by id desc
</where>
</select>
<select id="getRejectCauseByAllocateCode" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT * FROM dj_car_life_stock_allocate_audit_detail
WHERE allocate_code = #{allocateCode} and deleted_flag = 'N' and status in(4,6,7) order by reviewed_date DESC limit 1
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -21,6 +21,14 @@ ...@@ -21,6 +21,14 @@
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" /> <result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" /> <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="conversion_value" property="conversionValue" jdbcType="DECIMAL" />
<result column="delivery_number" property="deliveryNumber" jdbcType="INTEGER" />
<result column="delivery_status" property="deliveryStatus" jdbcType="TINYINT" />
<result column="upgrade_purchase_price" property="upgradePurchasePrice" jdbcType="DECIMAL" />
<result column="input_number" property="inputNumber" jdbcType="DECIMAL" />
<result column="specification_data" property="specificationData" jdbcType="VARCHAR" />
<result column="out_stock_qty" property="outStockQty"/>
<result column="in_stock_qty" property="inStockQty"/>
</resultMap> </resultMap>
<resultMap id="StockAllocateDetailDTOMap" type="cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO" extends="BaseResultMap"> <resultMap id="StockAllocateDetailDTOMap" type="cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO" extends="BaseResultMap">
...@@ -34,18 +42,112 @@ ...@@ -34,18 +42,112 @@
--> -->
id, allocate_code, goods_id, goods_name,product_code, source_material_id, source_material_name, id, allocate_code, goods_id, goods_name,product_code, source_material_id, source_material_name,
goods_type, goods_type_name, allocate_number, deleted_flag, created_by, created_date, goods_type, goods_type_name, allocate_number, deleted_flag, created_by, created_date,
updated_by, updated_date,product_code updated_by, updated_date,product_code,conversion_value, delivery_number, delivery_status, upgrade_purchase_price,input_number,specification_data,
out_stock_qty,in_stock_qty
</sql> </sql>
<delete id="delDetailByAllocateCode">
update dj_car_life_stock_allocate_detail set deleted_flag = 'D',updated_by = #{updatedBy},updated_date = now() where allocate_code = #{allocateCode}
</delete>
<select id="listStockAllocateDetailPage" resultMap="StockAllocateDetailDTOMap"> <select id="listStockAllocateDetailPage" resultMap="StockAllocateDetailDTOMap">
select select
sad.id,sad.allocate_code, sad.goods_id, ug.upgrade_goods_name as goods_name,sad.source_material_id,gi.goods_name as source_material_name, sad.id,sad.allocate_code, sad.goods_id, ug.upgrade_goods_name as goods_name,sad.source_material_id,gi.goods_name as source_material_name,
sad.conversion_value,sad.upgrade_purchase_price,sad.input_number,
<!--specification_data,-->
sad.out_stock_qty,sad.in_stock_qty,
gi.goods_type,gi.goods_type_name,sad.allocate_number,sad.deleted_flag,sad.created_by,sad.created_date, gi.goods_type,gi.goods_type_name,sad.allocate_number,sad.deleted_flag,sad.created_by,sad.created_date,
sad.updated_by, sad.updated_date, ug.type as product_code, sad.film_roll_no, sad.updated_by, sad.updated_date, ug.type as product_code, sad.film_roll_no, sad.delivery_number, sad.input_number, sad.delivery_status,
ug.specification_data,ug.specification_type_sequence ug.specification_data,ug.specification_type_sequence
from dj_car_life_stock_allocate_detail sad from dj_car_life_stock_allocate_detail sad
left join dj_car_life_upgrade_goods ug on sad.goods_id = ug.id and ug.deleted_flag ='N' left join dj_car_life_upgrade_goods ug on sad.goods_id = ug.id and ug.deleted_flag ='N'
left join dj_car_life_goods_info gi on gi.goods_code= ug.goods_code and gi.deleted_flag ='N' left join dj_car_life_goods_info gi on gi.goods_code= ug.goods_code and gi.deleted_flag ='N'
where sad.allocate_code = #{allocateCode} and sad.deleted_flag = 'N' where sad.deleted_flag = 'N'
<if test="allocateCode != null and allocateCode !=''">
and sad.allocate_code = #{allocateCode}
</if>
<if test="goodsId != null">
and sad.goods_id = #{goodsId}
</if>
<if test="idList != null and idList.size() > 0">
and sad.id in
<foreach collection="idList" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
</select> </select>
<update id="updateDetailInputNumber">
update dj_car_life_stock_allocate_detail og
set og.input_number =
(select ifnull(sum(increase_stock_num), 0) as total_stock_num
from dj_car_life_goods_warehousing_info wi
where wi.deleted_flag = 'N'
and wi.increase_stock_type = 3
and wi.allocate_order_goods_id=og.id),
og.updated_by = #{updatedBy},
og.updated_date = now()
where
og.deleted_flag = 'N'
and og.id = #{id}
</update>
<select id="updateBatchOutStockQty">
update dj_car_life_stock_allocate_detail sad,dj_car_life_stock_allocate_record sar
set sad.out_stock_qty=ifnull((
select msgs.stock from dj_car_life_merchant_shop_goods_stock msgs where msgs.deleted_flag='N'
and msgs.yq_merchant_id=sar.call_out_yq_merchant_id and msgs.merchant_id=sar.call_out_merchant_id
and msgs.upgrade_goods_id=sad.goods_id
and ((msgs.film_roll_no is null and sad.film_roll_no is null ) or (msgs.film_roll_no=sad.film_roll_no))
order by id desc limit 1
),0)
where sad.deleted_flag='N' and sar.allocate_code=sad.allocate_code and sar.deleted_flag='N' and sar.allocate_code=#{allocateCode}
</select>
<select id="getTotalAllocateNumByAllocateCode" resultType="java.math.BigDecimal">
select sum(allocate_number) from dj_car_life_stock_allocate_detail
where deleted_flag = 'N' and allocate_code = #{allocateCode}
</select>
<select id="getTotalDeliveryNumByOrderCode" resultType="java.math.BigDecimal">
select sum(dd.purchase_number)
from dj_car_life_purchase_order_delivery_detail dd
inner join dj_car_life_stock_allocate_detail ad on ad.allocate_code = dd.order_code and ad.deleted_flag = 'N' and ad.id = dd.allocate_order_goods_id
where dd.deleted_flag = 'N' and dd.order_code = #{allocateCode}
</select>
<!-- <select id="getTotalDeliveryNumByOrderCode" resultType="java.math.BigDecimal">
select sum(dd.purchase_number) from dj_car_life_purchase_order_delivery_detail dd
inner join dj_car_life_purchase_order_goods og on og.order_code = dd.order_code and og.deleted_flag = 'N' and og.refund_status = 'N' and og.id = dd.purchase_order_goods_id
where dd.deleted_flag = 'N' and dd.order_code = #{orderCode}
</select>-->
<update id="updateAllocateOrderGoodsDeliveryNumber">
update dj_car_life_stock_allocate_detail ad
set ad.delivery_number =
(select ifnull(sum(purchase_number), 0) as purchase_number
from dj_car_life_purchase_order_delivery_detail
where deleted_flag = 'N'
and allocate_order_goods_id = ad.id),
ad.updated_by = #{updatedBy},
ad.updated_date = now()
where ad.deleted_flag = 'N'
and ad.id = #{id}
</update>
<update id="updateAllocateOrderGoodsDeliveryStatus">
update dj_car_life_stock_allocate_detail ad
set ad.delivery_status =
CASE
WHEN delivery_number = 0 THEN 1
WHEN delivery_number = allocate_number AND allocate_number &gt; 0 THEN 2
WHEN delivery_number &lt; allocate_number THEN 3
ELSE delivery_status
END,
ad.updated_by = #{updatedBy},
ad.updated_date = now()
where deleted_flag = 'N'
and ad.id = #{id};
</update>
</mapper> </mapper>
<?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="cn.com.glsx.dj.smartcarlife.mapper.StockFlowMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO">
<result column="flow_time" property="flowTime" jdbcType="TIMESTAMP"/>
<result column="upgrade_goods_name" property="upgradeGoodsName" jdbcType="VARCHAR"/>
<result column="product_code" property="productCode" jdbcType="VARCHAR"/>
<result column="specification_data" property="specificationData" jdbcType="VARCHAR"/>
<result column="specification_type_sequence" property="specificationTypeSequence" jdbcType="VARCHAR"/>
<result column="goods_series" property="goodsSeries" jdbcType="VARCHAR"/>
<result column="goods_type" property="goodsType" jdbcType="INTEGER"/>
<result column="goods_type_name" property="goodsTypeName" jdbcType="VARCHAR"/>
<result column="stock_num" property="stockNum" jdbcType="DECIMAL"/>
<result column="stock_money" property="stockMoney" jdbcType="DECIMAL"/>
<result column="business_code" property="businessCode" jdbcType="VARCHAR"/>
<result column="delivery_number" property="deliveryNumber" jdbcType="VARCHAR"/>
<result column="film_roll_no" property="filmRollNo" jdbcType="VARCHAR"/>
<result column="yq_merchant_name" property="yqMerchantName" jdbcType="VARCHAR"/>
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR"/>
<result column="operator" property="operator" jdbcType="VARCHAR"/>
<result column="technician_name" property="technicianName" jdbcType="VARCHAR"/>
<result column="flow_type" property="flowType" jdbcType="INTEGER"/>
<result column="upgrade_flag" property="upgradeFlag" jdbcType="VARCHAR"/>
</resultMap>
<select id="listStockFlow" resultMap="BaseResultMap" parameterType="cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO">
SELECT * FROM (
<trim suffixOverrides="UNION ALL">
<!-- 入库子查询:将公共过滤条件下推,便于索引命中 -->
SELECT
i.increase_time AS flow_time,
ug.upgrade_goods_name,
ug.type AS product_code,
ug.specification_data,
ug.specification_type_sequence,
gi.goods_name as goods_series,
gi.goods_type as goods_type,
gi.goods_type_name as goods_type_name,
i.increase_stock_num AS stock_num,
i.increase_stock_money AS stock_money,
i.business_code,
i.delivery_number,
i.film_roll_no AS film_roll_no,
i.yq_merchant_name,
i.merchant_name AS merchant_name,
i.updated_user_name AS operator,
NULL AS technician_name,
ifnull(i.increase_stock_type + 200, null) AS flow_type,
i.upgrade_flag,
i.yq_merchant_id
FROM dj_car_life_goods_warehousing_info i
LEFT JOIN dj_car_life_upgrade_goods ug ON i.upgrade_goods_id = ug.id
left join dj_car_life_goods_info gi on gi.deleted_flag = 'N' and gi.goods_code = ug.goods_code
WHERE i.deleted_flag = 'N'
<if test="yqMerchantIds != null and yqMerchantIds.size() > 0">
AND i.yq_merchant_id IN
<foreach collection="yqMerchantIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="upgradeGoodsName != null and upgradeGoodsName != ''">
AND ug.upgrade_goods_name LIKE CONCAT('%', #{upgradeGoodsName}, '%')
</if>
<if test="productCode != null and productCode != ''">
AND ug.type LIKE CONCAT('%', #{productCode}, '%')
</if>
<if test="startDate != null">
AND i.increase_time &gt;= #{startDate}
</if>
<if test="endDate != null">
AND i.increase_time &lt;= #{endDate}
</if>
<if test="businessCode != null and businessCode != ''">
AND (i.business_code LIKE CONCAT('%', #{businessCode}, '%') OR i.delivery_number LIKE CONCAT('%', #{businessCode}, '%'))
</if>
<if test="increaseStockTypes != null and increaseStockTypes.size() > 0">
AND i.increase_stock_type IN
<foreach collection="increaseStockTypes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL
<!-- 出库子查询:将公共过滤条件下推,便于索引命中 -->
SELECT
r.reduce_date AS flow_time,
ug.upgrade_goods_name,
ug.`type` AS product_code,
ug.specification_data,
ug.specification_type_sequence,
gi.goods_name as goods_series,
gi.goods_type as goods_type,
gi.goods_type_name as goods_type_name,
r.reduce_stock_num AS stock_num,
r.reduce_stock_money AS stock_money,
r.business_code,
r.delivery_number,
r.film_roll_no,
r.yq_merchant_name,
r.merchant_name,
r.updated_user_name AS operator,
r.technician_name,
ifnull(r.event_type + 100, null) AS flow_type,
r.upgrade_flag,
r.yq_merchant_id
FROM dj_car_life_merchant_goods_stock_reduce_record r
LEFT JOIN dj_car_life_upgrade_goods ug ON r.upgrade_goods_id = ug.id
left join dj_car_life_goods_info gi on gi.deleted_flag = 'N' and gi.goods_code = ug.goods_code
WHERE r.deleted_flag = 'N'
<if test="yqMerchantIds != null and yqMerchantIds.size() > 0">
AND r.yq_merchant_id IN
<foreach collection="yqMerchantIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="upgradeGoodsName != null and upgradeGoodsName != ''">
AND ug.upgrade_goods_name LIKE CONCAT('%', #{upgradeGoodsName}, '%')
</if>
<if test="productCode != null and productCode != ''">
AND ug.type LIKE CONCAT('%', #{productCode}, '%')
</if>
<if test="startDate != null">
AND r.reduce_date &gt;= #{startDate}
</if>
<if test="endDate != null">
AND r.reduce_date &lt;= #{endDate}
</if>
<if test="businessCode != null and businessCode != ''">
AND r.business_code LIKE CONCAT('%', #{businessCode}, '%')
</if>
<if test="eventTypes != null and eventTypes.size() > 0">
AND r.event_type IN
<foreach collection="eventTypes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</trim>
) t
ORDER BY t.flow_time DESC
</select>
</mapper>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="to_user" property="toUser" jdbcType="VARCHAR" /> <result column="to_user" property="toUser" jdbcType="VARCHAR" />
<result column="re_push" property="rePush" jdbcType="VARCHAR" /> <result column="re_push" property="rePush" jdbcType="VARCHAR" />
<result column="push_url" property="pushUrl" jdbcType="VARCHAR" /> <result column="push_url" property="pushUrl" jdbcType="VARCHAR" />
<result column="order_type" property="orderType"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR" /> <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" /> <result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" /> <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, order_code, review_type, to_user, re_push, push_url, created_by, created_date, updated_by, updated_date, id, order_code, review_type, to_user, re_push, push_url,order_type, created_by, created_date, updated_by, updated_date,
deleted_flag deleted_flag
</sql> </sql>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.smartcarlife.service; package cn.com.glsx.dj.smartcarlife.service;
import org.junit.jupiter.api.Test; import cn.com.glsx.dj.smartcarlife.dto.GoodsWarehousingInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDTO;
import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderDeliveryDetailDTO;
import cn.com.glsx.dj.smartcarlife.dto.StockFlowDTO;
import cn.com.glsx.dj.smartcarlife.enums.purchaseGoods.DeliveryOrderTypeEnum;
import cn.com.glsx.dj.smartcarlife.service.stock.StockFlowService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.github.pagehelper.Page;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import static org.junit.jupiter.api.Assertions.*; import java.math.BigDecimal;
import java.util.Collections;
class PurchaseOrderServiceTest extends BaseServiceTest{ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class PurchaseOrderServiceTest extends BaseServiceTest{
@Autowired @Autowired
private PurchaseOrderService purchaseOrderService; private PurchaseOrderService purchaseOrderService;
@Autowired
private PurchaseOrderDeliveryService purchaseOrderDeliveryService;
@Autowired
private StockFlowService stockFlowService;
//
// @MockBean
// private PurchaseOrderMapper purchaseOrderMapper;
//
// @MockBean
// private SendWorkWechatMessageService sendWorkWechatMessageService;
//
// @MockBean
// private PurchaseOrderWechatMessageRecordService purchaseOrderWechatMessageRecordService;
//
// @MockBean
// private Environment env;
//
// @MockBean
// private PurchaseOrderDeliveryMapper purchaseOrderDeliveryMapper;
//
// @MockBean
// private StockFlowService stockFlowService;
@Test @Test
void sendPurchaseOrderWechatMessage() { public void sendPurchaseOrderWechatMessage() {
purchaseOrderService.sendPurchaseOrderWechatMessage("CG25112416120845", 2, "cxserviceShop", false); purchaseOrderService.sendPurchaseOrderWechatMessage("CG25112416120845", 2, "cxserviceShop", false);
} }
}
\ No newline at end of file \ No newline at end of file
@Test
public void warehousing() {
try {
PurchaseOrderDeliveryDTO record = new PurchaseOrderDeliveryDTO();
record.setId(202L);
record.setCreatedBy("tester");
record.setUpdatedBy("tester");
// PurchaseOrderDelivery delivery = new PurchaseOrderDelivery();
// delivery.setId(1L);
// delivery.setOrderType(DeliveryOrderTypeEnum.PURCHASE_ORDER.getValue());
// when(purchaseOrderDeliveryMapper.selectOne(any())).thenReturn(delivery);
// when(purchaseOrderDeliveryMapper.listOrderDeliveryPage(any(PurchaseOrderDeliveryDTO.class))).thenReturn(Collections.emptyList());
PurchaseOrderDeliveryDetailDTO detail = new PurchaseOrderDeliveryDetailDTO();
detail.setOrderDeliveryId(202L);
detail.setOrderCode("DB202512040001");
detail.setUpgradeGoodsId(100853);
detail.setAllocateOrderGoodsId(84L);
detail.setGoodsName("天儿太阳膜系列");
detail.setGoodsType(1);
detail.setGoodsTypeName("太阳膜");
detail.setId(261L);
detail.setPurchaseNumber(BigDecimal.valueOf(3));
detail.setStockNum(BigDecimal.valueOf(30));
GoodsWarehousingInfoDTO warehousing = new GoodsWarehousingInfoDTO();
warehousing.setIncreaseStockNum(BigDecimal.valueOf(30));
warehousing.setYqMerchantId(44211545);
warehousing.setYqMerchantName("cx园区店 lyjtest");
warehousing.setMerchantId(44211545);
warehousing.setMerchantName("cx园区店 lyjtest");
detail.setGoodsWarehousingList(Collections.singletonList(warehousing));
record.setDeliveryDetailList(Collections.singletonList(detail));
// when(purchaseOrderDeliveryMapper.selectOne(any(PurchaseOrderDelivery.class))).thenReturn(delivery);
// when(purchaseOrderDeliveryMapper.selectByPrimaryKey(anyLong())).thenReturn(delivery);
// when(purchaseOrderDeliveryMapper.selectOne(any(PurchaseOrderDelivery.class))).thenReturn(delivery);
// when(purchaseOrderDeliveryMapper.selectByPrimaryKey(anyLong())).thenReturn(delivery);
// when(purchaseOrderDeliveryMapper.listOrderDeliveryDetailPage(any(PurchaseOrderDeliveryDTO.class))).thenReturn(Collections.emptyList());
Boolean res = purchaseOrderDeliveryService.warehousing(record);
System.out.println(res);
assertTrue(res);
}catch (Exception e){
e.printStackTrace();
}
}
@Test
public void deliverySign() {
try {
PurchaseOrderDeliveryDTO dto = new PurchaseOrderDeliveryDTO();
dto.setId(202L);
dto.setUpdatedBy("tester");
dto.setSignFileUrl("http://example.com/sign.png");
dto.setUploadFileUrl("http://example.com/sign.png,http://example.com/sign.png,http://example.com/sign.png");
dto.setSignName("李四");
dto.setOrderType(DeliveryOrderTypeEnum.ALLOCATE_ORDER.getValue());
// PurchaseOrderDelivery delivery = new PurchaseOrderDelivery();
// delivery.setId(2L);
// delivery.setPutStatus(PurchaseOrderEnum.PutStatus.NO_SIGN.getValue());
// when(purchaseOrderDeliveryMapper.selectByPrimaryKey(2L)).thenReturn(delivery);
Boolean res = purchaseOrderDeliveryService.deliverySign(dto);
assertTrue(res);
}catch (Exception e){
e.printStackTrace();
}
}
@Test
public void deliveryPage() {
RpcPagination<PurchaseOrderDeliveryDTO> pagination = new RpcPagination<>();
PurchaseOrderDeliveryDTO cond = new PurchaseOrderDeliveryDTO();
pagination.setPageNum(1);
pagination.setPageSize(10);
pagination.setCondition(cond);
// PurchaseOrderDeliveryDTO item = new PurchaseOrderDeliveryDTO();
// PurchaseOrderDeliveryDetailDTO detail = new PurchaseOrderDeliveryDetailDTO();
// detail.setId(10L);
// detail.setUpgradeGoodsId(101);
// item.setDeliveryDetailList(Collections.singletonList(detail));
// Page<PurchaseOrderDeliveryDTO> page = new Page<>(1, 10);
// page.add(item);
// when(purchaseOrderDeliveryMapper.listOrderDeliveryPage(any(PurchaseOrderDeliveryDTO.class))).thenAnswer(invocation -> {
// return Arrays.asList(item);
// });
// when(stockFlowService.page(any())).thenReturn(new Page<>(1,10));
Object res = purchaseOrderDeliveryService.deliveryPage(pagination);
cond.setOrderType(1);
System.out.println(purchaseOrderDeliveryService.deliveryPage(pagination));
assertNotNull(res);
}
@Test
public void getDeliveryDetail() {
// PurchaseOrderDeliveryDTO dto = new PurchaseOrderDeliveryDTO();
// dto.setId(3L);
// dto.setOrderCode("CG0003");
// PurchaseOrderDeliveryDetailDTO detail = new PurchaseOrderDeliveryDetailDTO();
// detail.setId(30L);
// detail.setUpgradeGoodsId(102);
// dto.setDeliveryDetailList(Collections.singletonList(detail));
// when(purchaseOrderDeliveryMapper.listOrderDeliveryPage(any(PurchaseOrderDeliveryDTO.class))).thenReturn(Collections.singletonList(dto));
Object res = purchaseOrderDeliveryService.getDeliveryDetail(202L);
System.out.println(res);
assertNotNull(res);
}
@Test
public void stockFlowPage() {
RpcPagination<StockFlowDTO> pagination = new RpcPagination<>();
StockFlowDTO cond = new StockFlowDTO();
pagination.setPageNum(1);
pagination.setPageSize(10);
pagination.setCondition(cond);
// Page<StockFlowDTO> page = new Page<>(1,10);
// page.add(new StockFlowDTO());
// when(stockFlowService.page(any())).thenReturn(page);
Page<StockFlowDTO> res = stockFlowService.page(pagination);
System.out.println(res);
assertNotNull(res.getResult());
}
@Test
public void myTestBatch() {
deliveryPage();
getDeliveryDetail();
stockFlowPage();
deliverySign();
warehousing();
}
}
package cn.com.glsx.dj.smartcarlife.service;
import cn.com.glsx.dj.smartcarlife.dto.SaveStockAllocateDetailDTO;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateDetailDTO;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordDTO;
import cn.com.glsx.dj.smartcarlife.dto.StockAllocateRecordExportDTO;
import cn.com.glsx.dj.smartcarlife.enums.purchaseGoods.DeliveryStatusEnum;
import cn.com.glsx.dj.smartcarlife.service.stock.StockAllocateRecordService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test; // ← JUnit 4
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author 11$
* @version V1.0
* @Title StockAllocateRecordServiceTest
* @Description:
* @date 2026/1/31 15:27
* @Company:didihu.com.cn
*/
@Slf4j
public class StockAllocateRecordServiceTest extends BaseServiceTest{
@Autowired
private StockAllocateRecordService stockAllocateRecordService;
@Test
public void saveStockAllocateRecord() {
StockAllocateRecordDTO stockAllocateRecordDTO = new StockAllocateRecordDTO();
stockAllocateRecordDTO.setCallInYqMerchantId(44209880);
stockAllocateRecordDTO.setCallInYqMerchantName("明明崇文园区店");
stockAllocateRecordDTO.setCallInMerchantId(44211227);
stockAllocateRecordDTO.setCallInMerchantName("明明崇文4s店A");
stockAllocateRecordDTO.setCallOutYqMerchantId(44211545);
stockAllocateRecordDTO.setCallOutYqMerchantName("cx园区店");
stockAllocateRecordDTO.setCallOutMerchantId(44211653);
stockAllocateRecordDTO.setCallOutMerchantName("晨星测试4s店11");
stockAllocateRecordDTO.setPhone("12345678901");
stockAllocateRecordDTO.setReceiver("测试");
stockAllocateRecordDTO.setAddress("测试");
stockAllocateRecordDTO.setUpdatedBy("11$");
stockAllocateRecordDTO.setRemark("12345678901");
stockAllocateRecordDTO.setBillStatus((byte) 1);
List<SaveStockAllocateDetailDTO> stockAllocateDetailDTOList = new java.util.ArrayList<>();
SaveStockAllocateDetailDTO stockAllocateDetailDTO = new SaveStockAllocateDetailDTO();
stockAllocateDetailDTO.setGoodsId(100816);
stockAllocateDetailDTO.setGoodsName("测试");
stockAllocateDetailDTO.setProductCode("测试");
stockAllocateDetailDTO.setSourceMaterialId(1);
stockAllocateDetailDTO.setSourceMaterialName("测试");
stockAllocateDetailDTO.setGoodsType(1);
stockAllocateDetailDTO.setGoodsTypeName("测试");
stockAllocateDetailDTO.setAllocateNumber(BigDecimal.valueOf(19));
stockAllocateDetailDTOList.add(stockAllocateDetailDTO);
SaveStockAllocateDetailDTO stockAllocateDetailDTO1 = new SaveStockAllocateDetailDTO();
stockAllocateDetailDTO1.setGoodsId(100793);
stockAllocateDetailDTO1.setGoodsName("测试");
stockAllocateDetailDTO1.setProductCode("测试");
stockAllocateDetailDTO1.setSourceMaterialId(1);
stockAllocateDetailDTO1.setSourceMaterialName("测试");
stockAllocateDetailDTO1.setGoodsType(1);
stockAllocateDetailDTO1.setGoodsTypeName("测试");
stockAllocateDetailDTO1.setAllocateNumber(BigDecimal.valueOf(19));
/* stockAllocateDetailDTOList.add(stockAllocateDetailDTO1);*/
stockAllocateRecordDTO.setSaveStockAllocateDetailList(stockAllocateDetailDTOList);
stockAllocateRecordService.saveStockAllocateRecord(stockAllocateRecordDTO);
}
@Test
public void updateStockAllocateRecord() {
StockAllocateRecordDTO stockAllocateRecordDTO = new StockAllocateRecordDTO();
stockAllocateRecordDTO.setId(62L);
stockAllocateRecordDTO.setCallInYqMerchantId(44211545);
stockAllocateRecordDTO.setCallInYqMerchantName("cx园区店");
stockAllocateRecordDTO.setCallInMerchantId(44217622);
stockAllocateRecordDTO.setCallInMerchantName("武汉百乘汽车销售有限公司91");
stockAllocateRecordDTO.setCallOutYqMerchantId(44211545);
stockAllocateRecordDTO.setCallOutYqMerchantName("cx园区店");
stockAllocateRecordDTO.setCallOutMerchantId(44211800);
stockAllocateRecordDTO.setCallOutMerchantName("晨星测试客户10");
stockAllocateRecordDTO.setPhone("12345678901");
stockAllocateRecordDTO.setReceiver("测试");
stockAllocateRecordDTO.setAddress("测试");
stockAllocateRecordDTO.setUpdatedBy("11$");
stockAllocateRecordDTO.setBillStatus((byte) 2);
List<SaveStockAllocateDetailDTO> stockAllocateDetailDTOList = new java.util.ArrayList<>();
SaveStockAllocateDetailDTO stockAllocateDetailDTO = new SaveStockAllocateDetailDTO();
stockAllocateDetailDTO.setGoodsId(1);
stockAllocateDetailDTO.setGoodsName("测试");
stockAllocateDetailDTO.setProductCode("测试");
stockAllocateDetailDTO.setSourceMaterialId(1);
stockAllocateDetailDTO.setSourceMaterialName("测试");
stockAllocateDetailDTO.setGoodsType(1);
stockAllocateDetailDTO.setGoodsTypeName("测试");
stockAllocateDetailDTO.setAllocateNumber(BigDecimal.valueOf(1));
stockAllocateDetailDTO.setFilmRollNo("测试");
stockAllocateDetailDTO.setOutStockQty(BigDecimal.valueOf(20));
stockAllocateDetailDTOList.add(stockAllocateDetailDTO);
stockAllocateRecordDTO.setSaveStockAllocateDetailList(stockAllocateDetailDTOList);
stockAllocateRecordService.updateStockAllocateRecord(stockAllocateRecordDTO);
}
@Test
public void updateStockAllocateRecordStatus() {
StockAllocateRecordDTO stockAllocateRecordDTO = new StockAllocateRecordDTO();
stockAllocateRecordDTO.setId(62L);
stockAllocateRecordDTO.setBillStatus((byte) -1);
stockAllocateRecordService.updateStockAllocateRecordStatus(stockAllocateRecordDTO);
}
@Test
public void listStockAllocateRecordPage() {
RpcPagination<StockAllocateRecordDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
StockAllocateRecordDTO stockAllocateRecordDTO = new StockAllocateRecordDTO();
stockAllocateRecordDTO.setBillStatusList(Arrays.asList((byte) 1));
stockAllocateRecordDTO.setDeliveryStatus(DeliveryStatusEnum.UNDELIVERED.getCode());
stockAllocateRecordDTO.setId(62L);
pagination.setCondition(stockAllocateRecordDTO);
Page<StockAllocateRecordDTO> stockAllocateRecordDTOS = stockAllocateRecordService.listStockAllocateRecordPage(
pagination);
log.info("stockAllocateRecordDTOS:{}", JSONObject.toJSONString(stockAllocateRecordDTOS));
}
@Test
public void listStockAllocateRecordExport() {
RpcPagination<StockAllocateRecordDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(200);
StockAllocateRecordDTO stockAllocateRecordDTO = new StockAllocateRecordDTO();
stockAllocateRecordDTO.setAllocateCode("DB20260210");
pagination.setCondition(stockAllocateRecordDTO);
Page<StockAllocateRecordExportDTO> stockAllocateRecordExportDTOS = stockAllocateRecordService.listStockAllocateRecordExport(
pagination);
log.info("stockAllocateRecordDTOS:{}", JSONObject.toJSONString(stockAllocateRecordExportDTOS));
}
}
package cn.com.glsx.dj.smartcarlife.service.onlineStatementAccount;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountDailyBalanceDTO;
import cn.com.glsx.dj.smartcarlife.service.BaseServiceTest;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
public class OnlineStatementAccountDailyBalanceServiceTest extends BaseServiceTest{
@Autowired
private OnlineStatementAccountDailyBalanceService onlineStatementAccountDailyBalanceService;
@org.junit.jupiter.api.Test
public void testListWithPage() {
RpcPagination<OnlineStatementAccountDailyBalanceDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
pagination.setCondition(OnlineStatementAccountDailyBalanceDTO.builder().build());
System.out.println(onlineStatementAccountDailyBalanceService.listWithPage(pagination));
pagination.setCondition(OnlineStatementAccountDailyBalanceDTO.builder().filterAllZero(true).build());
System.out.println(onlineStatementAccountDailyBalanceService.listWithPage(pagination));
System.out.println(onlineStatementAccountDailyBalanceService.countTotal(OnlineStatementAccountDailyBalanceDTO.builder().build()));
}
}
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<!-- <table tableName="dj_car_life_merchant_goods_voucher" domainObjectName="MerchantGoodsVoucher" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false"> <!-- <table tableName="dj_car_life_merchant_goods_voucher" domainObjectName="MerchantGoodsVoucher" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/> <generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>--> </table>-->
<table tableName="dj_car_life_construction_service_category_config" domainObjectName="ConstructionServiceCategoryConfig" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false"> <table tableName="dj_car_life_stock_allocate_audit_detail" domainObjectName="StockAllocateAuditDetail" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/> <generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table> </table>
<!-- <table tableName="dj_car_life_vd_quotation_refund_records" domainObjectName="VdQuotationRefundRecords" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">--> <!-- <table tableName="dj_car_life_vd_quotation_refund_records" domainObjectName="VdQuotationRefundRecords" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">-->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!