采购单入库单修改

master
ljw 2025-12-29 16:04:22 +08:00
parent b0dd6de8a7
commit ca407c5f07
17 changed files with 57 additions and 58 deletions

View File

@ -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;
/**
* Idwh_purchase_order.id
*/

View File

@ -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;
/**
* Idwh_sales_order.id
*/

View File

@ -28,6 +28,16 @@ public class PurchaseOrderEntity {
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* id
*/
private Long orderId;
/**
* id
*/
private Long orderTransId;
/**
*
*/

View File

@ -28,6 +28,16 @@ public class SalesOrderEntity {
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* id
*/
private Long orderId;
/**
* id
*/
private Long orderTransId;
/**
*
*/

View File

@ -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;
/**
* Idsys_user.id
*/
@ -38,16 +31,6 @@ public class AddInOrderParam {
*/
private String location;
/**
*
*/
private LocalDateTime inTime;
/**
* XiaoShou-->CaiGou-->QiTa-->
*/
private String orderCategory;
/**
* Idwh_purchase_order.id
*/

View File

@ -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;
/**
* Idwh_sales_order.id
*/

View File

@ -24,6 +24,16 @@ public class AddSalesOrderParam {
*/
private String sn;
/**
* id
*/
private Long orderId;
/**
* id
*/
private Long orderTransId;
/**
* JinXingZhong-->YiFaHuo-->YiChuKu-->YiQuXiao-->
*/

View File

@ -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;
}

View File

@ -29,10 +29,5 @@ public class SearchOutOrderParam {
*/
private Long goodsId;
/**
* XiaoShou-->CaiGou-->QiTa-->
*/
private String orderCategory;
private String keywords;
}

View File

@ -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;
/**
* Idwh_purchase_order.id
*/

View File

@ -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;
/**
* Idwh_sales_order.id
*/

View File

@ -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;
}
}

View File

@ -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)

View File

@ -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())

View File

@ -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())

View File

@ -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,

View File

@ -9,7 +9,6 @@
warehouse_id,
location,
out_time,
order_category,
order_id,
order_sn,
goods_category_id,