采购单入库单修改
parent
b0dd6de8a7
commit
ca407c5f07
|
|
@ -10,6 +10,7 @@ import java.time.LocalDateTime;
|
|||
|
||||
/**
|
||||
* 入库单
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -49,11 +50,6 @@ public class InOrderEntity {
|
|||
*/
|
||||
private LocalDateTime inTime;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
/**
|
||||
* 采购单 Id;wh_purchase_order.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.time.LocalDateTime;
|
|||
|
||||
/**
|
||||
* 出库单
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -49,11 +50,6 @@ public class OutOrderEntity {
|
|||
*/
|
||||
private LocalDateTime outTime;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
/**
|
||||
* 销售单 Id;wh_sales_order.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ public class PurchaseOrderEntity {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 预约单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 运输信息id
|
||||
*/
|
||||
private Long orderTransId;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ public class SalesOrderEntity {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 预约单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 运输信息id
|
||||
*/
|
||||
private Long orderTransId;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import lombok.Setter;
|
|||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 入库单
|
||||
*
|
||||
|
|
@ -18,11 +16,6 @@ import java.time.LocalDateTime;
|
|||
@Accessors(chain = true)
|
||||
public class AddInOrderParam {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 责任人 Id;sys_user.id
|
||||
*/
|
||||
|
|
@ -38,16 +31,6 @@ public class AddInOrderParam {
|
|||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private LocalDateTime inTime;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
/**
|
||||
* 采购单 Id;wh_purchase_order.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.time.LocalDateTime;
|
|||
|
||||
/**
|
||||
* 出库单
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -40,11 +41,6 @@ public class AddOutOrderParam {
|
|||
*/
|
||||
private LocalDateTime outTime;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
/**
|
||||
* 销售单 Id;wh_sales_order.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,6 +24,16 @@ public class AddSalesOrderParam {
|
|||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 预约单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 运输信息id
|
||||
*/
|
||||
private Long orderTransId;
|
||||
|
||||
/**
|
||||
* 状态,JinXingZhong-->进行中、YiFaHuo-->已发货、YiChuKu-->已出库、YiQuXiao-->已取消
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.experimental.Accessors;
|
|||
|
||||
/**
|
||||
* 入库单
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -28,10 +29,5 @@ public class SearchInOrderParam {
|
|||
*/
|
||||
private Long goodsId;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
private String keywords;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,5 @@ public class SearchOutOrderParam {
|
|||
*/
|
||||
private Long goodsId;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
private String keywords;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.time.LocalDateTime;
|
|||
|
||||
/**
|
||||
* 入库单
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -49,11 +50,6 @@ public class SearchInOrderResult {
|
|||
*/
|
||||
private LocalDateTime inTime;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
/**
|
||||
* 采购单 Id;wh_purchase_order.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.time.LocalDateTime;
|
|||
|
||||
/**
|
||||
* 出库单
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -49,11 +50,6 @@ public class SearchOutOrderResult {
|
|||
*/
|
||||
private LocalDateTime outTime;
|
||||
|
||||
/**
|
||||
* 单据类型,XiaoShou-->销售、CaiGou-->采购、QiTa-->其他
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
/**
|
||||
* 销售单 Id;wh_sales_order.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.common.sn.support.SnUtil;
|
||||
import com.njzscloud.dispose.wh.mapper.InOrderMapper;
|
||||
import com.njzscloud.dispose.wh.pojo.entity.InOrderEntity;
|
||||
import com.njzscloud.dispose.wh.pojo.param.AddInOrderParam;
|
||||
|
|
@ -16,10 +17,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入库单
|
||||
*
|
||||
* @author ljw
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
@ -33,6 +36,8 @@ public class InOrderService extends ServiceImpl<InOrderMapper, InOrderEntity> {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(AddInOrderParam addInOrderParam) {
|
||||
InOrderEntity entity = BeanUtil.copyProperties(addInOrderParam, InOrderEntity.class);
|
||||
entity.setSn(this.generateSn());
|
||||
entity.setInTime(LocalDateTime.now());
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
|
|
@ -65,14 +70,12 @@ public class InOrderService extends ServiceImpl<InOrderMapper, InOrderEntity> {
|
|||
String sn = searchInOrderParam.getSn();
|
||||
Long warehouseId = searchInOrderParam.getWarehouseId();
|
||||
Long goodsId = searchInOrderParam.getGoodsId();
|
||||
String orderCategory = searchInOrderParam.getOrderCategory();
|
||||
String keywords = searchInOrderParam.getKeywords();
|
||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query()
|
||||
.eq("a.deleted", 0)
|
||||
.eq(StrUtil.isNotBlank(sn), "a.sn", sn)
|
||||
.eq(warehouseId != null, "a.warehouse_id", warehouseId)
|
||||
.eq(goodsId != null, "a.goods_id", goodsId)
|
||||
.eq(StrUtil.isNotBlank(orderCategory), "a.order_category", orderCategory)
|
||||
.and(StrUtil.isNotBlank(keywords), it -> it
|
||||
.like("a.location", keywords)
|
||||
.or().like("a.order_sn", keywords)
|
||||
|
|
@ -82,4 +85,18 @@ public class InOrderService extends ServiceImpl<InOrderMapper, InOrderEntity> {
|
|||
)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成入库单号
|
||||
*
|
||||
* @return sn 入库单号
|
||||
*/
|
||||
public String generateSn() {
|
||||
String sn = SnUtil.next("In-Order-SN");
|
||||
if (this.exists(Wrappers.<InOrderEntity>lambdaQuery().eq(InOrderEntity::getSn, sn)
|
||||
.eq(InOrderEntity::getDeleted, Boolean.FALSE))) {
|
||||
this.generateSn();
|
||||
}
|
||||
return sn;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,14 +66,12 @@ public class OutOrderService extends ServiceImpl<OutOrderMapper, OutOrderEntity>
|
|||
String sn = searchOutOrderParam.getSn();
|
||||
Long warehouseId = searchOutOrderParam.getWarehouseId();
|
||||
Long goodsId = searchOutOrderParam.getGoodsId();
|
||||
String orderCategory = searchOutOrderParam.getOrderCategory();
|
||||
String keywords = searchOutOrderParam.getKeywords();
|
||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query()
|
||||
.eq("a.deleted", 0)
|
||||
.eq(StrUtil.isNotBlank(sn), "a.sn", sn)
|
||||
.eq(warehouseId != null, "a.warehouse_id", warehouseId)
|
||||
.eq(goodsId != null, "a.goods_id", goodsId)
|
||||
.eq(StrUtil.isNotBlank(orderCategory), "a.order_category", orderCategory)
|
||||
.and(StrUtil.isNotBlank(keywords), it -> it
|
||||
.like("a.location", keywords)
|
||||
.or().like("a.order_sn", keywords)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public class PurchaseOrderService extends ServiceImpl<PurchaseOrderMapper, Purch
|
|||
public void add(Long transOrderId) {
|
||||
OrderTransResult orderTrans = orderTransMapper.getById(transOrderId);
|
||||
this.add(BeanUtil.copyProperties(orderTrans, PurchaseOrderEntity.class)
|
||||
.setOrderTransId(transOrderId)
|
||||
.setSn(this.generateSn())
|
||||
.setPurchaseOrderStatus(PurchaseOrderStatus.YiDaoHuo)
|
||||
.setPurchaseDate(orderTrans.getOrderTime().toLocalDate())
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public class SalesOrderService extends ServiceImpl<SalesOrderMapper, SalesOrderE
|
|||
public void add(Long transOrderId) {
|
||||
OrderTransResult orderTrans = orderTransMapper.getById(transOrderId);
|
||||
this.add(BeanUtil.copyProperties(orderTrans, AddSalesOrderParam.class)
|
||||
.setOrderTransId(transOrderId)
|
||||
.setSn(this.generateSn())
|
||||
.setSalesOrderStatus(SalesOrderStatus.YiFaHuo)
|
||||
.setOrderDate(orderTrans.getOrderTime().toLocalDate())
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
wio.warehouse_id AS warehouse_id,
|
||||
wio.location AS location,
|
||||
wio.in_time AS in_time,
|
||||
wio.order_category AS order_category,
|
||||
wio.order_id AS order_id,
|
||||
wio.order_sn AS order_sn,
|
||||
wio.goods_category_id AS goods_category_id,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
warehouse_id,
|
||||
location,
|
||||
out_time,
|
||||
order_category,
|
||||
order_id,
|
||||
order_sn,
|
||||
goods_category_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue