|
|
|
@ -42,9 +42,20 @@ import com.logpm.distribution.vo.DistributionStockArticleVO;
|
|
|
|
|
import com.logpm.distribution.vo.app.*; |
|
|
|
|
import com.logpm.distribution.wrapper.DistributionParcelListWrapper; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadingIsInsertConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; |
|
|
|
|
import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.signing.SignforDriverSigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.signing.SignforStatusConstant; |
|
|
|
|
import org.springblade.common.serviceConstant.ServiceConstant; |
|
|
|
|
import org.springblade.common.utils.GaoDeApiUtil; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
@ -60,6 +71,7 @@ import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -70,6 +82,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@Slf4j |
|
|
|
|
public class DistributionSignforServiceImpl extends BaseServiceImpl<DistributionSignforMapper, DistributionSignforEntity> implements IDistributionSignforService { |
|
|
|
|
|
|
|
|
|
private final DistributionLoadscanServiceImpl distributionLoadscanService; |
|
|
|
@ -88,6 +101,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
private final IDistributionReservationPackageService reservationPackageService; |
|
|
|
|
private final IDistributionAsyncService distributionAsyncService; |
|
|
|
|
private final IBasicdataWarehouseClient basicdataWarehouseClient; |
|
|
|
|
private final DistributionReservationMapper distributionReservationMapper; |
|
|
|
|
private final IDisStockListDetailService disStockListDetailService; |
|
|
|
|
private final IDistributionStockListService distributionStockListService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) { |
|
|
|
@ -113,14 +129,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
Long deliveryId = d.getDeliveryId(); |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.<DistributionDeliveryListEntity>query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); |
|
|
|
|
List<String> list = new ArrayList<>(); |
|
|
|
|
if (Func.equals(deliveryListEntity.getKind(), ServiceConstant.DELIVERLIST_KIND_SELF)){ |
|
|
|
|
if (Func.equals(deliveryListEntity.getKind(), ServiceConstant.DELIVERLIST_KIND_SELF)) { |
|
|
|
|
List<DistributionDeliverySelfEntity> distributionDeliverySelfEntities = distributionDeliverySelfMapper.selectList(Wrappers.<DistributionDeliverySelfEntity>query().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, deliveryId)); |
|
|
|
|
distributionDeliverySelfEntities.forEach(s->list.add(s.getDriverPhone())); |
|
|
|
|
}else { |
|
|
|
|
distributionDeliverySelfEntities.forEach(s -> list.add(s.getDriverPhone())); |
|
|
|
|
} else { |
|
|
|
|
DistributionDeliveryTripartiteEntity tripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, deliveryId)); |
|
|
|
|
list.add(tripartiteEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
d.setDeliveryDriverPhone(String.join(",",list)); |
|
|
|
|
d.setDeliveryDriverPhone(String.join(",", list)); |
|
|
|
|
}); |
|
|
|
|
return page.setRecords(distributionSignforVOS); |
|
|
|
|
} |
|
|
|
@ -172,7 +188,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntities.forEach(l -> { |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(l.getPackageId()); |
|
|
|
|
// distributionAsyncService.changeOrderSignforStatus(parcelListEntity);
|
|
|
|
|
distributionAsyncService.changeDeliverySignforListStatus(deliveryId,parcelListEntity); |
|
|
|
|
distributionAsyncService.changeDeliverySignforListStatus(deliveryId, parcelListEntity); |
|
|
|
|
}); |
|
|
|
|
//这里签收还需要进行管乐配送任务的签收状态修改
|
|
|
|
|
//查询出这个配送任务的所有订单
|
|
|
|
@ -588,22 +604,33 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R oneclick(DistributionSignforDTO distributionSignfor) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------2023-09-08 一键签收调整------------------------------------------
|
|
|
|
|
//1、查询本次一键签收操作是否有效 ---- > 这里一件签收针对的就是制定的任务下的包件和库存品
|
|
|
|
|
// 无效 -- > 直接提示该次操作无效 无效的场景快速点击操作两次签收的动作,司机已经进行了所有的包件签收扫描但是还未进行签收确认的动作
|
|
|
|
|
// 有效 -- >
|
|
|
|
|
// 查询该车次任务中装车的包件和库存品 此时一键签收就需要将该车次中的所有包件和库存品都进行签收
|
|
|
|
|
// 此时考虑多种场景:
|
|
|
|
|
// 1、存在库存品 库存品未进行备货操作无法进行一件装车,但是对于已备货的库存品可以进行装车
|
|
|
|
|
// 2、多个车次的配送任务进行一件签收状态、在没有进行装车操作的时候
|
|
|
|
|
// 3、对于已经装车的库存品或者包件在一件签收的时候需要进行过滤
|
|
|
|
|
|
|
|
|
|
//2、维护状态
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(distributionSignfor.getReservationId()); |
|
|
|
|
if (Func.isEmpty(reservationEntity)){ |
|
|
|
|
log.error("#############reservationEntity参数错误:{}",reservationEntity); |
|
|
|
|
return R.fail("服务器正忙~~"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询数据
|
|
|
|
|
DistributionSignforEntity distributionSignforEntity = baseMapper.selectOne(new QueryWrapper<DistributionSignforEntity>().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getDeliveryId, distributionSignfor.getDeliveryId()) |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (distributionSignfor.getIsClerk()) { |
|
|
|
|
if (null != distributionSignforEntity.getSigningType()) { |
|
|
|
|
return R.fail(3010, "已经签收"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (null != distributionSignforEntity.getSjsigningTime()) { |
|
|
|
|
return R.fail(3010, "已经签收"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//获取当前用户司机
|
|
|
|
|
//获取计划配送用户司机
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignfor.getDeliveryId()); |
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = null; |
|
|
|
|
if (distributionDeliveryListEntity.getKind().equals("1")) { |
|
|
|
@ -620,156 +647,401 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); |
|
|
|
|
} |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
|
|
|
|
//先查询有数据的
|
|
|
|
|
List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionDeliveryListMapper.selectdeliverOne(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId()); |
|
|
|
|
//查询所有的库存品(拆包)
|
|
|
|
|
List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntitiesopen = distributionDeliveryListMapper.selectdeliverOnevnopen(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId()); |
|
|
|
|
//将该客户所有的物品上该车辆
|
|
|
|
|
if (distributionLoadscanEntities.size() > 0) { |
|
|
|
|
//配送订单数据
|
|
|
|
|
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { |
|
|
|
|
//查询该包件是否扫码
|
|
|
|
|
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, 1) |
|
|
|
|
); |
|
|
|
|
if (distributionLoadscanEntitiesflag.size() > 0) { |
|
|
|
|
//有扫码记录
|
|
|
|
|
// 修改该记录
|
|
|
|
|
for (DistributionLoadscanEntity loadscanEntity : distributionLoadscanEntitiesflag) { |
|
|
|
|
if (loadscanEntity.getSignforState() == 2) break; |
|
|
|
|
distributionLoadscanService.update(new UpdateWrapper<DistributionLoadscanEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) |
|
|
|
|
.set(DistributionLoadscanEntity::getSigningTime, simpleDateFormat.format(new Date())) |
|
|
|
|
.set(DistributionLoadscanEntity::getSignforState, 2) |
|
|
|
|
.set(DistributionLoadscanEntity::getReceivedQuantity, 1) |
|
|
|
|
); |
|
|
|
|
//修改签收数量
|
|
|
|
|
distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Func.equals(distributionSignforEntity.getDriverSigning(), SignforDriverSigningStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
log.error("###############重复签收+{" + distributionSignforEntity + "}"); |
|
|
|
|
return R.fail("签收失败"); |
|
|
|
|
} |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
|
|
|
|
|
//处理库存品
|
|
|
|
|
//查询出该客户下的库存品信息
|
|
|
|
|
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId()); |
|
|
|
|
if (detailEntities.size()>0 && Func.isNotEmpty(detailEntities)){ |
|
|
|
|
boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode())); |
|
|
|
|
//只要库存品没有进行备货操作则不能进行一件装车操作
|
|
|
|
|
if (flag){ |
|
|
|
|
//库存品均已备货
|
|
|
|
|
List<DisStockListDetailEntity> unLoadingiNventoryList = detailEntities.stream().filter(i -> i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(unLoadingiNventoryList) && unLoadingiNventoryList.size()>0) { |
|
|
|
|
for (DisStockListDetailEntity disStockListDetailEntity : unLoadingiNventoryList) { |
|
|
|
|
// --------------------修改库存品包件装车和签收状态——————————————————————————————————————————
|
|
|
|
|
disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
|
|
|
|
|
DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity(); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
loadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
loadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
loadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
loadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
loadscaninvnEntity.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode()); |
|
|
|
|
loadscaninvnEntity.setInventoryId(disStockListDetailEntity.getStockListId()); |
|
|
|
|
loadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId()); |
|
|
|
|
loadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId()); |
|
|
|
|
loadscaninvnEntity.setScanUser(user.getUserName()); |
|
|
|
|
loadscaninvnEntity.setScanTime(new Date()); |
|
|
|
|
loadscaninvnEntity.setPackageNub(disStockListDetailEntity.getNum()); |
|
|
|
|
loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); |
|
|
|
|
loadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); |
|
|
|
|
loadscaninvnEntity.setScanType("1"); |
|
|
|
|
loadscaninvnEntity.setType(2); |
|
|
|
|
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
loadscaninvnEntity.setIsSignfor(1); |
|
|
|
|
loadscaninvnEntity.setReceivedQuantity(disStockListDetailEntity.getNum()); |
|
|
|
|
loadscaninvnEntity.setOneClick(2); |
|
|
|
|
loadscaninvnEntity.setOneQclick(2); |
|
|
|
|
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
loadscaninvnEntity.setMsg("一键签收数据补录"); |
|
|
|
|
distributionLoadscaninvnService.save(loadscaninvnEntity); |
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); |
|
|
|
|
//更新签收表的签收数量和装车数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
} |
|
|
|
|
// distributionLoadscanService.update()
|
|
|
|
|
continue; |
|
|
|
|
}else{ |
|
|
|
|
//没有扫码数据
|
|
|
|
|
//依次插入该装车记录,设置车辆,
|
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue()); |
|
|
|
|
distributionLoadscanEntity.setReceivedQuantity(1); |
|
|
|
|
if (null == distributionLoadscanEntity.getPackageNub()) { |
|
|
|
|
distributionLoadscanEntity.setPackageNub(1); |
|
|
|
|
distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setScanType("1"); |
|
|
|
|
distributionLoadscanEntity.setMsg("司机签收"); |
|
|
|
|
if (distributionSignfor.getIsClerk()) { |
|
|
|
|
distributionLoadscanEntity.setMsg("文员签收"); |
|
|
|
|
} |
|
|
|
|
// distributionLoadscanEntity.setOneClick(2);
|
|
|
|
|
distributionLoadscanEntity.setSignforState(2); |
|
|
|
|
distributionLoadscanEntity.setOneQclick(2); |
|
|
|
|
// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); |
|
|
|
|
//维护预约库存品数据
|
|
|
|
|
//扣减库存
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId()); |
|
|
|
|
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub()); |
|
|
|
|
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub()); |
|
|
|
|
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub()); |
|
|
|
|
distributionStockListService.updateById(stockListEntity); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
distributionLoadscanService.save(distributionLoadscanEntity); |
|
|
|
|
} |
|
|
|
|
//查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
|
|
|
|
|
//更新签收表的签收数量和装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//库存品扫描记录补充
|
|
|
|
|
for (DisStockListDetailEntity detailEntity : detailEntities) { |
|
|
|
|
if (detailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())){ |
|
|
|
|
detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
disStockListDetailService.updateById(detailEntity); |
|
|
|
|
//查询出对于的装车扫描记录
|
|
|
|
|
List<DistributionLoadscaninvnEntity> list = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionSignfor.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getReservationId, distributionSignfor.getReservationId()) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode()) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
if (list.size()==1){ |
|
|
|
|
//正常进行扫描记录签收修改
|
|
|
|
|
DistributionLoadscaninvnEntity loadscaninvnEntity = list.get(0); |
|
|
|
|
loadscaninvnEntity.setMsg("一键签收数据补录"); |
|
|
|
|
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); |
|
|
|
|
loadscaninvnEntity.setOneClick(1); |
|
|
|
|
loadscaninvnEntity.setOneQclick(2); |
|
|
|
|
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); |
|
|
|
|
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscaninvnService.updateById(loadscaninvnEntity); |
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); |
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); |
|
|
|
|
}else { |
|
|
|
|
log.error("################库存品未进行备货操作+{}"+list); |
|
|
|
|
//此时说明在同一配送任务下,同一客户出现了相同的库存品包件码
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//对库存品包件上级的状态维护
|
|
|
|
|
distributionAsyncService.checkStockArticleListSigningStatus(detailEntity); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error("################库存品未进行备货操作+{}"+detailEntities); |
|
|
|
|
return R.fail("一键装车失败!!!库存品都备货了!?"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (distributionLoadscanvnEntitiesopen.size() > 0) { |
|
|
|
|
//库存品数据
|
|
|
|
|
for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) { |
|
|
|
|
//查询是否重复扫码
|
|
|
|
|
List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, 1) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getSignforState, 2) |
|
|
|
|
); |
|
|
|
|
if (distributionLoadscaninvnEntitiesflag.size() > 0) { |
|
|
|
|
// 修改该记录
|
|
|
|
|
for (DistributionLoadscaninvnEntity loadscanEntity : distributionLoadscaninvnEntitiesflag) { |
|
|
|
|
if (loadscanEntity.getSignforState() == 2) break; |
|
|
|
|
distributionLoadscaninvnService.update(new UpdateWrapper<DistributionLoadscaninvnEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) |
|
|
|
|
.set(DistributionLoadscaninvnEntity::getSigningTime, simpleDateFormat.format(new Date())) |
|
|
|
|
.set(DistributionLoadscaninvnEntity::getSignforState, 2) |
|
|
|
|
.set(DistributionLoadscaninvnEntity::getReceivedQuantity, 1) |
|
|
|
|
); |
|
|
|
|
//更新签收表的签收数量和装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
} |
|
|
|
|
// distributionLoadscanService.update()
|
|
|
|
|
continue; |
|
|
|
|
//查询出该签收任务下的客户对应的所有包件和库存品信息
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distributionSignforEntity.getReservationId()); |
|
|
|
|
//包件不需要考虑备货、装车直接可进行签收 过滤已装车的包件
|
|
|
|
|
List<DistributionParcelListEntity> noLoadingPackage = parcelListEntityList.stream().filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { |
|
|
|
|
if (Func.equals(parcelListEntity.getOrderPackageStockupStatus(), OrderPackageStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
continue; |
|
|
|
|
} else if (Func.equals(parcelListEntity.getOrderPackageLoadingStatus(), OrderPackageLoadingStatusConstant.yizhuangche.getValue())) { |
|
|
|
|
//修改包件的状态为出库状态
|
|
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
//查询出对应的装车扫描信息进行修改
|
|
|
|
|
List<DistributionLoadscanEntity> list = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distributionSignforEntity.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
if (list.size() == 1) { |
|
|
|
|
DistributionLoadscanEntity loadscanEntity = list.get(0); |
|
|
|
|
loadscanEntity.setMsg("一键签收数据补录"); |
|
|
|
|
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity()); |
|
|
|
|
loadscanEntity.setOneClick(1); |
|
|
|
|
loadscanEntity.setOneQclick(2); |
|
|
|
|
loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity()); |
|
|
|
|
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanService.updateById(loadscanEntity); |
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); |
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
} else { |
|
|
|
|
//一个配送任务下,同一个客户出现了相同的包件信息
|
|
|
|
|
log.error("#########相同的包件信息={}" + parcelListEntity.getId()); |
|
|
|
|
} |
|
|
|
|
//依次插入该装车记录,设置车辆
|
|
|
|
|
if (null != distributionDeliverySelfEntity.getDriverId()) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
}else { |
|
|
|
|
log.error("#########包件异常{}" + parcelListEntity.getId()); |
|
|
|
|
} |
|
|
|
|
distributionAsyncService.checkStockArticleSignStatus(parcelListEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(noLoadingPackage) && noLoadingPackage.size() > 0) { |
|
|
|
|
//存在有未装车的包件信息
|
|
|
|
|
//统计新装车的包件数
|
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : noLoadingPackage) { |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
loadscanEntity.setPackageId(parcelListEntity.getId()); |
|
|
|
|
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); |
|
|
|
|
loadscanEntity.setDeliveryId(distributionSignforEntity.getDeliveryId()); |
|
|
|
|
loadscanEntity.setReservationId(distributionSignforEntity.getReservationId()); |
|
|
|
|
loadscanEntity.setScanUser(user.getUserName()); |
|
|
|
|
loadscanEntity.setScanTime(new Date()); |
|
|
|
|
loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue()); |
|
|
|
|
distributionLoadscanEntity.setScanType("1"); |
|
|
|
|
distributionLoadscanEntity.setReceivedQuantity(1); |
|
|
|
|
// distributionLoadscanEntity.setOneClick(2);
|
|
|
|
|
distributionLoadscanEntity.setSignforState(2); |
|
|
|
|
distributionLoadscanEntity.setOneQclick(2); |
|
|
|
|
distributionLoadscanEntity.setMsg("司机签收"); |
|
|
|
|
if (distributionSignfor.getIsClerk()) { |
|
|
|
|
distributionLoadscanEntity.setMsg("文员签收"); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
if (null == distributionLoadscanEntity.getPackageNub()) { |
|
|
|
|
distributionLoadscanEntity.setPackageNub(1); |
|
|
|
|
distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
if (null != distributionDeliverySelfEntity.getDriverPhone()) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (null != distributionDeliverySelfEntity.getVehicleId()) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
//查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
|
|
|
|
|
//更新签收表的装车数量和签收数量
|
|
|
|
|
Integer j = distributionSignforMapper.updatesignforByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); |
|
|
|
|
loadscanEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); |
|
|
|
|
loadscanEntity.setScanType("1"); |
|
|
|
|
loadscanEntity.setType(2); |
|
|
|
|
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
loadscanEntity.setIsSignfor(1); |
|
|
|
|
loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity()); |
|
|
|
|
loadscanEntity.setOneClick(2); |
|
|
|
|
loadscanEntity.setOneQclick(2); |
|
|
|
|
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
loadscanEntity.setMsg("一键签收数据补录"); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); |
|
|
|
|
//更新签收表的签收数量和装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
distributionAsyncService.checkStockArticleSignStatus(parcelListEntity); |
|
|
|
|
|
|
|
|
|
// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
|
|
|
|
|
//保存完成签收包件装车数量累加
|
|
|
|
|
} |
|
|
|
|
distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//维护客户信息状态
|
|
|
|
|
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
distributionReservationMapper.updateById(reservationEntity); |
|
|
|
|
|
|
|
|
|
boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getId, distributionSignforEntity.getId()) |
|
|
|
|
.set(StringUtils.isNotBlank(distributionSignfor.getDeliverySignPictures()), DistributionSignforEntity::getDeliverySignPictures, distributionSignfor.getDeliverySignPictures()) |
|
|
|
|
.set(StringUtils.isNotBlank(distributionSignfor.getSigningType()), DistributionSignforEntity::getSigningType, distributionSignfor.getSigningType()) |
|
|
|
|
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningStatus, 2) |
|
|
|
|
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningStatus, 1) |
|
|
|
|
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getDriverSigning, 2) |
|
|
|
|
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningTime, simpleDateFormat.format(new Date())) |
|
|
|
|
.set(distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getClerkSignRemarks()), DistributionSignforEntity::getSigningStatus, distributionSignfor.getClerkSignRemarks()) |
|
|
|
|
.set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks()) |
|
|
|
|
.set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getDriverSigning, 2) |
|
|
|
|
.set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date())) |
|
|
|
|
); |
|
|
|
|
return R.status(update); |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// distributionSignforEntity.setSigningTime(simpleDateFormat.format(new Date()));
|
|
|
|
|
// distributionSignforEntity.setSigneeName(user.getUserName());
|
|
|
|
|
// distributionSignforEntity.setDriverSigning(SignforDriverSigningStatusConstant.yiqianshou.getValue());
|
|
|
|
|
// this.updateById(distributionSignforEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (distributionSignfor.getIsClerk()) {
|
|
|
|
|
// if (null != distributionSignforEntity.getSigningType()) {
|
|
|
|
|
// return R.fail(3010, "已经签收");
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (null != distributionSignforEntity.getSjsigningTime()) {
|
|
|
|
|
// return R.fail(3010, "已经签收");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// //先查询有数据的
|
|
|
|
|
// List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionDeliveryListMapper.selectdeliverOne(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId());
|
|
|
|
|
// //查询所有的库存品(拆包)
|
|
|
|
|
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntitiesopen = distributionDeliveryListMapper.selectdeliverOnevnopen(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId());
|
|
|
|
|
// //将该客户所有的物品上该车辆
|
|
|
|
|
// if (distributionLoadscanEntities.size() > 0) {
|
|
|
|
|
// //配送订单数据
|
|
|
|
|
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
|
|
|
|
|
// //查询该包件是否扫码
|
|
|
|
|
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
|
|
|
|
|
// );
|
|
|
|
|
// if (distributionLoadscanEntitiesflag.size() > 0) {
|
|
|
|
|
// //有扫码记录
|
|
|
|
|
// // 修改该记录
|
|
|
|
|
// for (DistributionLoadscanEntity loadscanEntity : distributionLoadscanEntitiesflag) {
|
|
|
|
|
// if (loadscanEntity.getSignforState() == 2) break;
|
|
|
|
|
// distributionLoadscanService.update(new UpdateWrapper<DistributionLoadscanEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .set(DistributionLoadscanEntity::getSigningTime, simpleDateFormat.format(new Date()))
|
|
|
|
|
// .set(DistributionLoadscanEntity::getSignforState, 2)
|
|
|
|
|
// .set(DistributionLoadscanEntity::getReceivedQuantity, 1)
|
|
|
|
|
// );
|
|
|
|
|
// //修改签收数量
|
|
|
|
|
// distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
// //更新签收表的签收数量和装车数量
|
|
|
|
|
//// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
//// distributionLoadscanService.update()
|
|
|
|
|
// continue;
|
|
|
|
|
// }else{
|
|
|
|
|
// //没有扫码数据
|
|
|
|
|
// //依次插入该装车记录,设置车辆,
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
|
|
|
|
|
// distributionLoadscanEntity.setReceivedQuantity(1);
|
|
|
|
|
// if (null == distributionLoadscanEntity.getPackageNub()) {
|
|
|
|
|
// distributionLoadscanEntity.setPackageNub(1);
|
|
|
|
|
// distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setScanType("1");
|
|
|
|
|
// distributionLoadscanEntity.setMsg("司机签收");
|
|
|
|
|
// if (distributionSignfor.getIsClerk()) {
|
|
|
|
|
// distributionLoadscanEntity.setMsg("文员签收");
|
|
|
|
|
// }
|
|
|
|
|
//// distributionLoadscanEntity.setOneClick(2);
|
|
|
|
|
// distributionLoadscanEntity.setSignforState(2);
|
|
|
|
|
// distributionLoadscanEntity.setOneQclick(2);
|
|
|
|
|
//// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
|
|
|
|
|
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
|
|
|
|
|
// distributionLoadscanService.save(distributionLoadscanEntity);
|
|
|
|
|
// }
|
|
|
|
|
// //查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
|
|
|
|
|
// //更新签收表的签收数量和装车数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (distributionLoadscanvnEntitiesopen.size() > 0) {
|
|
|
|
|
// //库存品数据
|
|
|
|
|
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) {
|
|
|
|
|
// //查询是否重复扫码
|
|
|
|
|
// List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1)
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getSignforState, 2)
|
|
|
|
|
// );
|
|
|
|
|
// if (distributionLoadscaninvnEntitiesflag.size() > 0) {
|
|
|
|
|
// // 修改该记录
|
|
|
|
|
// for (DistributionLoadscaninvnEntity loadscanEntity : distributionLoadscaninvnEntitiesflag) {
|
|
|
|
|
// if (loadscanEntity.getSignforState() == 2) break;
|
|
|
|
|
// distributionLoadscaninvnService.update(new UpdateWrapper<DistributionLoadscaninvnEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .set(DistributionLoadscaninvnEntity::getSigningTime, simpleDateFormat.format(new Date()))
|
|
|
|
|
// .set(DistributionLoadscaninvnEntity::getSignforState, 2)
|
|
|
|
|
// .set(DistributionLoadscaninvnEntity::getReceivedQuantity, 1)
|
|
|
|
|
// );
|
|
|
|
|
// //更新签收表的签收数量和装车数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
//// distributionLoadscanService.update()
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// //依次插入该装车记录,设置车辆
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getDriverId()) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
|
|
|
|
|
// distributionLoadscanEntity.setScanType("1");
|
|
|
|
|
// distributionLoadscanEntity.setReceivedQuantity(1);
|
|
|
|
|
//// distributionLoadscanEntity.setOneClick(2);
|
|
|
|
|
// distributionLoadscanEntity.setSignforState(2);
|
|
|
|
|
// distributionLoadscanEntity.setOneQclick(2);
|
|
|
|
|
// distributionLoadscanEntity.setMsg("司机签收");
|
|
|
|
|
// if (distributionSignfor.getIsClerk()) {
|
|
|
|
|
// distributionLoadscanEntity.setMsg("文员签收");
|
|
|
|
|
// }
|
|
|
|
|
//// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
// if (null == distributionLoadscanEntity.getPackageNub()) {
|
|
|
|
|
// distributionLoadscanEntity.setPackageNub(1);
|
|
|
|
|
// distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
|
|
|
|
|
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
// }
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
|
|
|
|
|
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
// }
|
|
|
|
|
// //查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
|
|
|
|
|
// //更新签收表的装车数量和签收数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updatesignforByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda()
|
|
|
|
|
// .eq(DistributionSignforEntity::getId, distributionSignforEntity.getId())
|
|
|
|
|
// .set(StringUtils.isNotBlank(distributionSignfor.getDeliverySignPictures()), DistributionSignforEntity::getDeliverySignPictures, distributionSignfor.getDeliverySignPictures())
|
|
|
|
|
// .set(StringUtils.isNotBlank(distributionSignfor.getSigningType()), DistributionSignforEntity::getSigningType, distributionSignfor.getSigningType())
|
|
|
|
|
// .set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningStatus, 2)
|
|
|
|
|
// .set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningTime, simpleDateFormat.format(new Date()))
|
|
|
|
|
// .set(distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getClerkSignRemarks()), DistributionSignforEntity::getSigningStatus, distributionSignfor.getClerkSignRemarks())
|
|
|
|
|
// .set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks())
|
|
|
|
|
// .set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getDriverSigning, 2)
|
|
|
|
|
// .set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date()))
|
|
|
|
|
// );
|
|
|
|
|
// return R.status(true);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R offline(String offlineJson) { |
|
|
|
|
|
|
|
|
@ -782,7 +1054,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
DistributionSignforEntity signforEntity = this.getById(signforId); |
|
|
|
|
List<DistributionParcelListEntity> parcelListEntities = baseMapper.getSignforPackageList(signforEntity.getReservationId()); |
|
|
|
|
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntities); |
|
|
|
|
parcelListVOS.forEach(p->{ |
|
|
|
|
parcelListVOS.forEach(p -> { |
|
|
|
|
DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getPackageId, p.getId())); |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity)) { |
|
|
|
|
//该包件存在扫描记录
|
|
|
|
@ -801,13 +1073,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
p.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity.getSigningTime())){ |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity.getSigningTime())) { |
|
|
|
|
p.setSigningTime(distributionLoadscanEntity.getSigningTime()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity.getScanUser())){ |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity.getScanUser())) { |
|
|
|
|
p.setScanUser(distributionLoadscanEntity.getScanUser()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity.getDriverName())){ |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity.getDriverName())) { |
|
|
|
|
p.setDriverName(distributionLoadscanEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|