收货生成批次号;
This commit is contained in:
+4
@@ -160,5 +160,9 @@ public class StockReceiptOrder extends BaseVOEntity {
|
||||
@Excel(name = "业务单号")
|
||||
private String businessOrderNo;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String batchNo;
|
||||
|
||||
|
||||
}
|
||||
+4
@@ -190,4 +190,8 @@ public class StockReceiptOrderPO extends StockInOrderBasePO {
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String businessOrderNo;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String batchNo;
|
||||
}
|
||||
+4
@@ -196,4 +196,8 @@ public class StockReceiptOrderDO extends StockInOrderBaseDO {
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String businessOrderNo;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String batchNo;
|
||||
}
|
||||
+29
@@ -85,6 +85,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -179,6 +180,34 @@ public class StockReceiptOrderDomainService {
|
||||
stockReceiptOrder.setUpdateBy(loginUser.getUserid());
|
||||
stockReceiptOrder.setUpdateByName(userRealName);
|
||||
stockReceiptOrder.setUpdateTime(new Date());
|
||||
|
||||
// 查询当天创建的入库单数量,用于生成batchNo
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String todayStr = dateFormat.format(new Date());
|
||||
String todayStart = todayStr + " 00:00:00";
|
||||
String todayEnd = todayStr + " 23:59:59";
|
||||
SimpleDateFormat fullDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Date todayStartDate = null;
|
||||
try {
|
||||
todayStartDate = fullDateFormat.parse(todayStart);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Date todayEndDate = null;
|
||||
try {
|
||||
todayEndDate = fullDateFormat.parse(todayEnd);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// 查询当天创建的入库单总数
|
||||
long todayStockInOrderCount = stockInOrderService.count(new LambdaQueryWrapper<StockInOrder>()
|
||||
.ge(StockInOrder::getCreateTime, todayStartDate)
|
||||
.le(StockInOrder::getCreateTime, todayEndDate)
|
||||
.eq(StockInOrder::getDelFlag, 1));
|
||||
stockReceiptOrder.setBatchNo("PC"+stockReceiptOrder.getInOrderNumber()+"-"+todayStockInOrderCount);
|
||||
|
||||
stockReceiptOrderList.add(stockReceiptOrder);
|
||||
stockReceiptOrderDO.getMaterialDetailList().forEach(materialDetailDO -> {
|
||||
ReceiptMaterialDetail receiptMaterialDetail = new ReceiptMaterialDetail();
|
||||
|
||||
+4
@@ -167,4 +167,8 @@ public class StockReceiptOrderDTO extends StockInOrderBaseDTO {
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String businessOrderNo;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String batchNo;
|
||||
}
|
||||
Reference in New Issue
Block a user