tao.mo

biz-customer | 修改 | 根据运单号查找30天之内运单信息

mt
2024年12月19日16:22:46
......@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.time.LocalDate;
import java.util.Date;
import java.util.Objects;
......@@ -51,7 +52,13 @@ public class ConsignmentUtil {
Date nowDate = new Date();
//如果没有运单id,则是通过add添加进来的运单
if (Objects.isNull(consignment)) {
consignment = new Consignment();
//根据运单号查询运单表最近30天内是否存在已提交的运单
LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30);
consignment = consignmentRepository.findByConsignmentCode(consignmentBo.getConsignmentCode(),thirtyDaysAgo);
//如果最近30天内没有提交过该运单,则新建
if(consignment == null){
consignment = new Consignment();
}
//用户录入数据拷贝
BeanUtils.copyProperties(consignmentBo, consignment);
//用户录入shipperaccount
......