Browse Source

Merge branch 'dev' into pre-production

master
汤建军 10 months ago
parent
commit
ea475c6766
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java
  2. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  4. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  5. 397
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  6. 65
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java

@ -239,7 +239,7 @@ public class DistributionSignforAppController {
if(StringUtils.isBlank(orderPackageCodes)){
orderPackageCodes = packageCode+"";
}else{
orderPackageCodes = orderPackageCodes + "," +packageCode;
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java

@ -153,7 +153,20 @@ public class DistributionStockListController extends BladeController {
return R.fail(e.getMessage());
}
return R.data(orderPackgeCodeDataVo);
}
@GetMapping("/showInventoryPackgeCode")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "返回模板和模板内容")
public R showOrderPackgeCode(@ApiIgnore @RequestParam Long id){
OrderPackgeCodeDataVO orderPackgeCodeDataVo= null;
try {
orderPackgeCodeDataVo = distributionStockListService.showInvnetoryPackgeCode(id);
} catch (Exception e) {
return R.fail(e.getMessage());
}
return R.data(orderPackgeCodeDataVo);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -121,9 +121,7 @@
FROM
logpm_distribution_stockup_info AS ldsi
LEFT JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id
WHERE
ldsi.reservation_id = lds.reservation_id
) AS t ON t.reservation_id = ldsi.reservation_id
) AS t ON t.reservation_id = lds.reservation_id
<where>
lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0
</where>

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java

@ -196,6 +196,12 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
R cancelAddStockListByPackage(DistributionStockListDTO distributionStockListDTO);
/**
* 查询库存品包件二维码
* @param id
* @return
*/
OrderPackgeCodeDataVO showInvnetoryPackgeCode(Long id);
// /**

397
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -56,6 +56,7 @@ import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.billLading.BillLadingStatusConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant;
@ -3968,13 +3969,17 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
@Transactional
public R oneclickPDA(DistributionSignforDTO distributionSignfor) {
String method= "######################DistributionSignforServiceImpl.oneclickPDA";
BladeUser user = AuthUtil.getUser();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "仓库信息不能为空");
// throw new CustomerException(403, "仓库信息不能为/**/空");
}
int loadingPackageNum = 0;
int loadingInventoryNum = 0;
int signingPackageNum = 0;
int signingInventoryNum = 0;
// ------------------------------------2023-09-08 一键签收调整------------------------------------------
//1、查询本次一键签收操作是否有效 ---- > 这里一件签收针对的就是制定的任务下的包件和库存品
@ -3986,16 +3991,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 2、多个车次的配送任务进行一件签收状态、在没有进行装车操作的时候
//
// 3、对于已经装车的库存品或者包件在一件签收的时候需要进行过滤
// Map<String, List<DistributionSignPrintDTO>> map = distributionSignfor.getMap();
// if (Func.isEmpty(map)){
// log.error("#############无图片信息:{}", map);
// return R.fail("无图片信息");
// }
this.updatePicture(distributionSignfor);
//2、维护状态
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(distributionSignfor.getReservationId());
if (Func.isEmpty(reservationEntity)) {
log.error("#############reservationEntity参数错误:{}", reservationEntity);
log.error(method+"reservationEntity参数错误:{}", reservationEntity);
return R.fail("服务器正忙~~");
}
//查询数据
@ -4007,7 +4009,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//获取计划配送用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignfor.getDeliveryId());
if (Func.isEmpty(distributionDeliveryListEntity)) {
log.error("#############deliveryId参数错误:{}", distributionSignfor.getDeliveryId());
log.error(method+"查询配送单失败deliveryId:{}", reservationEntity);
return R.fail("服务器正忙~~");
}
DistributionDeliverySelfEntity distributionDeliverySelfEntity = null;
@ -4029,13 +4031,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.equals(distributionSignforEntity.getDriverSigning(), SignforDriverSigningStatusConstant.yiqianshou.getValue())) {
log.error("###############重复签收+{" + distributionSignforEntity + "}");
log.error(method+"重复签收deliveryId:{}", reservationEntity);
return R.fail("签收失败");
}
//处理库存品
//查询出该客户下的库存品信息
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId());
if (detailEntities.size() > 0 && Func.isNotEmpty(detailEntities)) {
loadingInventoryNum+=detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum();
signingInventoryNum+=detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum();
boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode()));
//只要库存品没有进行备货操作则不能进行一件装车操作
if (flag) {
@ -4059,11 +4063,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscaninvnService.updateById(loadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), AuthUtil.getUser());
distributionAsyncService.checkSignStatus(null, loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId());
}
} else {
//不存在装车数据 这里需要进行装车数据的补录
@ -4113,12 +4115,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
newLoadscaninvnEntity.setMsg("司机一键签收数据补录");
}
distributionLoadscaninvnService.save(newLoadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和装车数量
Integer j = distributionSignforMapper.updateLoadAndsignforByinvn(newLoadscaninvnEntity.getDeliveryId(), newLoadscaninvnEntity.getReservationId(), newLoadscaninvnEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(newLoadscaninvnEntity.getDeliveryId(), newLoadscaninvnEntity.getReservationId(), AuthUtil.getUser());
//维护预约库存品数据
//扣减库存
DistributionStockListEntity stockListEntity = distributionStockListService.getById(detailEntity.getStockListId());
@ -4126,7 +4122,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - newLoadscaninvnEntity.getPackageNub());
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + newLoadscaninvnEntity.getPackageNub());
distributionStockListService.updateById(stockListEntity);
distributionAsyncService.checkSignStatus(null, newLoadscaninvnEntity.getReservationId(), newLoadscaninvnEntity.getDeliveryId());
}
}
} else {
@ -4141,8 +4136,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询该客户下的所有零担信息
List<DistributionParcelNumberDTO> parcelNumberEntityList = distributionReservationMapper.selectZeroPackageListByReservationId(distributionSignforEntity.getReservationId());
if (Func.isNotEmpty(parcelNumberEntityList)) {
loadingPackageNum += parcelNumberEntityList.stream().mapToInt(DistributionParcelNumberDTO::getReservationNum).sum();
signingPackageNum += parcelNumberEntityList.stream().mapToInt(DistributionParcelNumberDTO::getReservationNum).sum();
for (DistributionParcelNumberDTO parcelNumberEntity : parcelNumberEntityList) {
DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId()).eq(DistributionLoadscanEntity::getPackageId, parcelNumberEntity.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
DistributionParcelNumberEntity parcelNumberServiceById = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, parcelNumberEntity.getId()));
Integer outboundQuantity = 0;
Integer signinQuantity = 0;
Integer deliveryQuantity = 0;
Integer handQuantity = 0;
if (Func.isNotEmpty(distributionLoadscanEntity)) {
//情况列举:
// 1、装车件数未按照计划数量
@ -4150,67 +4152,42 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 3、部分签收
// 4、完成签收
//不论什么情况均进行一次重新签收维护数量
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getById(parcelNumberEntity.getId());
BigDecimal signinQuantity = new BigDecimal(distributionParcelNumberEntity.getSigninQuantity());
BigDecimal reservationNum = new BigDecimal(parcelNumberEntity.getReservationNum());
BigDecimal deliveryQuantity = new BigDecimal(distributionParcelNumberEntity.getDeliveryQuantity());
BigDecimal handQuantity = new BigDecimal(distributionParcelNumberEntity.getHandQuantity());
BigDecimal outboundQuantity = new BigDecimal(distributionParcelNumberEntity.getOutboundQuantity());
BigDecimal loadedQuantity = new BigDecimal(distributionLoadscanEntity.getLoadedNub());
BigDecimal receivedQuantity = new BigDecimal(distributionLoadscanEntity.getReceivedQuantity());
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, parcelNumberEntity.getId()));
if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//装车数量和签收数量只会一样,
if (distributionLoadscanEntity.getReceivedQuantity() > 0) {
distributionParcelNumberEntity.setSigninQuantity(signinQuantity.add(reservationNum).subtract(receivedQuantity).intValue());
distributionParcelNumberEntity.setHandQuantity(handQuantity.add(receivedQuantity).subtract(reservationNum).intValue());
distributionParcelNumberEntity.setOutboundQuantity(outboundQuantity.add(reservationNum).subtract(receivedQuantity).intValue());
distributionParcelNumberEntity.setDeliveryQuantity(deliveryQuantity.add(receivedQuantity).subtract(reservationNum).intValue());
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
if (distributionLoadscanEntity.getReceivedQuantity() > 0 && distributionLoadscanEntity.getReceivedQuantity() <= parcelNumberEntity.getReservationNum()) {
outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() + distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum();
signinQuantity = distributionParcelNumberEntity.getSigninQuantity() + distributionLoadscanEntity.getReceivedQuantity() - parcelNumberEntity.getReservationNum();
deliveryQuantity = distributionParcelNumberEntity.getDeliveryQuantity() + distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum();
handQuantity = distributionParcelNumberEntity.getHandQuantity() + distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum();
//装车按照计划完成装车
distributionLoadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setReceivedQuantity(parcelNumberEntity.getReservationNum());
distributionLoadscanService.updateById(distributionLoadscanEntity);
} else {
log.error("################扫描签收零担订单数量为0:{}", distributionLoadscanEntity);
return Resp.scanFail("服务器正忙...", "请稍后重试");
log.error("################扫描签收零担订单数量异常:{}", distributionLoadscanEntity);
return Resp.scanFail("数量录入错误", "数量录入错误");
}
} else if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.weiqianshou.getValue())) {
if (distributionLoadscanEntity.getLoadedNub().equals(parcelNumberEntity.getReservationNum())) {
//装车数量和计划数量一致,这里进行签收数量的维护
//修改这里装车数量已经维护好了,只需要维护签收数量
distributionParcelNumberEntity.setSigninQuantity(signinQuantity.add(reservationNum).intValue());
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() + (distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum());
signinQuantity = distributionParcelNumberEntity.getSigninQuantity() + distributionLoadscanEntity.getReceivedQuantity();
deliveryQuantity = distributionParcelNumberEntity.getDeliveryQuantity() + (distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum());
handQuantity = distributionParcelNumberEntity.getHandQuantity() + (distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setReceivedQuantity(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
if (distributionSignfor.getIsClerk()) {
distributionLoadscanEntity.setMsg("文员一键签收数据补录");
} else {
if (distributionLoadscanEntity.getLoadedNub() > 0) {
distributionParcelNumberEntity.setSigninQuantity(signinQuantity.add(reservationNum).intValue());
distributionParcelNumberEntity.setHandQuantity(handQuantity.add(loadedQuantity).subtract(reservationNum).intValue());
distributionParcelNumberEntity.setOutboundQuantity(outboundQuantity.add(reservationNum).subtract(loadedQuantity).intValue());
distributionParcelNumberEntity.setDeliveryQuantity(deliveryQuantity.add(loadedQuantity).subtract(reservationNum).intValue());
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
}
distributionLoadscanEntity.setMsg("司机一键签收数据补录");
}
} else {
log.error("##################扫描签收状态异常:{}", distributionLoadscanEntity.getId());
throw new RuntimeException("服务器正忙...");
}
distributionLoadscanEntity.setReceivedQuantity(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum());
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
if (distributionSignfor.getIsClerk()) {
distributionLoadscanEntity.setMsg("文员一键签收数据补录");
} else {
distributionLoadscanEntity.setMsg("司机一键签收数据补录");
distributionLoadscanService.updateById(distributionLoadscanEntity);
}
distributionLoadscanService.updateById(distributionLoadscanEntity);
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//维护签收数量
DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, distributionLoadscanEntity.getReservationId()));
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber());
BigDecimal signingReceivedQuantity = new BigDecimal(signforEntity.getReceivedQuantity());
signforEntity.setLoadedNumber(loadedNumber.subtract(loadedQuantity).add(reservationNum).intValue());
signforEntity.setReceivedQuantity(signingReceivedQuantity.subtract(receivedQuantity).add(reservationNum).intValue());
distributionSignforMapper.updateById(signforEntity);
} else {
}else {
//不存在装车数据
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
loadscanEntity.setPackageId(parcelNumberEntity.getParcelListId());
@ -4221,7 +4198,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setScanTime(simpleDateFormat.format(new Date()));
loadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum());
loadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum());
loadscanEntity.setSigningUser(user.getUserName());
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setSigningUserId(user.getUserId());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
@ -4255,165 +4232,145 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setMsg("司机一键签收数据补录");
}
distributionLoadscanService.save(loadscanEntity);
distributionAsyncService.checkSignStatus(loadscanEntity.getPackageId(), loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId());
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和装车数量
Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//维护出库数量和签收数量
DistributionParcelNumberEntity parcelNumberServiceById = distributionParcelNumberService.getById(parcelNumberEntity.getId());
BigDecimal signinQuantity = new BigDecimal(parcelNumberServiceById.getSigninQuantity());
BigDecimal reservationNum = new BigDecimal(parcelNumberEntity.getReservationNum());
BigDecimal deliveryQuantity = new BigDecimal(parcelNumberServiceById.getDeliveryQuantity());
BigDecimal handQuantity = new BigDecimal(parcelNumberServiceById.getHandQuantity());
BigDecimal outboundQuantity = new BigDecimal(parcelNumberServiceById.getOutboundQuantity());
parcelNumberServiceById.setSigninQuantity(signinQuantity.add(reservationNum).intValue());
parcelNumberServiceById.setDeliveryQuantity(deliveryQuantity.subtract(reservationNum).intValue());
parcelNumberServiceById.setOutboundQuantity(outboundQuantity.add(reservationNum).intValue());
parcelNumberServiceById.setHandQuantity(handQuantity.subtract(reservationNum).intValue());
distributionParcelNumberService.updateById(parcelNumberServiceById);
}
//维护出库数量和签收数量
parcelNumberServiceById.setSigninQuantity(signinQuantity);
parcelNumberServiceById.setDeliveryQuantity(deliveryQuantity);
parcelNumberServiceById.setOutboundQuantity(outboundQuantity);
parcelNumberServiceById.setHandQuantity(handQuantity);
log.info(method + "维护零担信息:{}", parcelNumberServiceById);
distributionParcelNumberService.updateById(parcelNumberServiceById);
}
}
String signingTime = simpleDateFormat.format(new Date());
List<Long> packageIds = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntityList)) {
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
//查询是否进行装车
DistributionLoadscanEntity loadscanEntities = distributionLoadscanService.getOne(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()));
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
if (Func.isEmpty(loadscanEntities)) {
//没有进行过装车操作
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.getNickName());
loadscanEntity.setScanTime(signingTime);
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setSigningUserId(user.getUserId());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
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(signingTime);
if (distributionSignfor.getIsClerk()) {
loadscanEntity.setMsg("文员一键签收数据补录");
} else {
loadscanEntity.setMsg("司机一键签收数据补录");
}
distributionLoadscanService.save(loadscanEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和装车数量
Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
} else {
//存在装车数据
if (distributionSignfor.getIsClerk()) {
loadscanEntities.setMsg("文员一键签收数据补录");
String signingTime = simpleDateFormat.format(new Date());
List<Long> packageIds = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntityList)) {
loadingPackageNum+=parcelListEntityList.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
signingPackageNum+=parcelListEntityList.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
//查询是否进行装车
DistributionLoadscanEntity loadscanEntities = distributionLoadscanService.getOne(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()));
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
if (Func.isEmpty(loadscanEntities)) {
//没有进行过装车操作
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.getNickName());
loadscanEntity.setScanTime(signingTime);
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setSigningUserId(user.getUserId());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
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(signingTime);
if (distributionSignfor.getIsClerk()) {
loadscanEntity.setMsg("文员一键签收数据补录");
} else {
loadscanEntity.setMsg("司机一键签收数据补录");
}
distributionLoadscanService.save(loadscanEntity);
} else {
loadscanEntities.setMsg("司机一键签收数据补录");
}
if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//已经进行过装车 这里不需要进行订制品订单在库数量扣减
loadscanEntities.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setOneClick(1);
loadscanEntities.setOneQclick(2);
loadscanEntities.setSigningUser(user.getNickName());
loadscanEntities.setSigningUserId(user.getUserId());
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setSigningTime(signingTime);
distributionLoadscanService.updateById(loadscanEntities);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收数量
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), loadscanEntities.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), AuthUtil.getUser());
distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(), loadscanEntities.getReservationId(), loadscanEntities.getDeliveryId());
//存在装车数据
if (distributionSignfor.getIsClerk()) {
loadscanEntities.setMsg("文员一键签收数据补录");
} else {
loadscanEntities.setMsg("司机一键签收数据补录");
}
if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//已经进行过装车 这里不需要进行订制品订单在库数量扣减
loadscanEntities.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setOneClick(1);
loadscanEntities.setOneQclick(2);
loadscanEntities.setSigningUser(user.getNickName());
loadscanEntities.setSigningUserId(user.getUserId());
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setSigningTime(signingTime);
distributionLoadscanService.updateById(loadscanEntities);
}
}
distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
packageIds.add(parcelListEntity.getId());
orderCodes.add(parcelListEntity.getOrderCode());
}
//批量维护订单信息
if (Func.isNotEmpty(orderCodes)) {
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId());
}
distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
packageIds.add(parcelListEntity.getId());
orderCodes.add(parcelListEntity.getOrderCode());
}
//批量维护订单信息
if (Func.isNotEmpty(orderCodes)) {
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId());
}
if (Func.isNotEmpty(packageIds)) {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
//批量推送
distributionAsyncService.sendReviewFactory(distributionSignforEntity.getId(), myCurrentWarehouse.getName(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(packageIds)) {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
//批量推送
distributionAsyncService.sendReviewFactory(distributionSignforEntity.getId(), myCurrentWarehouse.getName(), myCurrentWarehouse.getId());
}
}
}
//维护客户信息状态
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue());
distributionReservationMapper.updateById(reservationEntity);
//维护签收状态
// distributionAsyncService.checkDeliverySignStatusByReservation(distributionSignforEntity.getDeliveryId());
// distributionDeliveryListEntity.setDeliveryListLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
// if (distributionSignfor.getIsClerk()) {
// distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
// } else {
// distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue());
// }
// distributionDeliveryListMapper.updateById(distributionDeliveryListEntity);
LambdaUpdateWrapper<DistributionSignforEntity> set = 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(DistributionSignforEntity::getDriverSigning, 2)
.set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks())
.set(DistributionSignforEntity::getDriverSigning, 2);
boolean update = this.update(set);
//维护配送信息
return R.status(true);
}
//维护客户信息状态
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue());
distributionReservationMapper.updateById(reservationEntity);
//更新配送装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
//更新装车人
Integer m = distributionSignforMapper.updateSignUser(distributionDeliveryListEntity.getId(),distributionSignfor.getReservationId(), AuthUtil.getUser());
log.info(method+"装车包件数>>>>>>>>>>>>>>:{}",loadingPackageNum);
log.info(method+"装车库存品数>>>>>>>>>>>>>>:{}",loadingInventoryNum);
log.info(method+"签收包件数>>>>>>>>>>>>>>:{}",signingPackageNum);
log.info(method+"签收库存品数>>>>>>>>>>>>>>:{}",signingPackageNum);
LambdaUpdateWrapper<DistributionSignforEntity> set = 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( DistributionSignforEntity::getLoadedinNumber, loadingInventoryNum)
.set( DistributionSignforEntity::getLoadedNumber, loadingPackageNum)
.set( DistributionSignforEntity::getReceivedinQuantity, signingInventoryNum)
.set( DistributionSignforEntity::getReceivedQuantity, signingPackageNum)
.set(DistributionSignforEntity::getDriverSigning, 2)
.set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks())
.set(DistributionSignforEntity::getDriverSigning, 2);
boolean update = this.update(set);
//维护配送信息
return R.status(true);
}
@Override

65
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -108,6 +108,9 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
@Autowired
@Lazy
private IDistributionStockArticleService distributionStockArticleService;
@Autowired
@Lazy
private IDisStockListDetailService disStockListDetailService;
@ -743,7 +746,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
throw new ServiceException("查询库存品信息失败");
}
for (DisStockListDetailEntity disStockListDetailEntity : stockUpStockListPack) {
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class);
Map<String, Object> map =JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class);
map.put("id",disStockListDetailEntity.getId());
map.put("customerName",distributionReservationEntity.getConsignee());
map.put("customerTelephone",distributionReservationEntity.getDeliveryPhone());
@ -765,6 +768,66 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return orderPackgeCodeDataVO;
}
@Override
public OrderPackgeCodeDataVO showInvnetoryPackgeCode(Long id) {
OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();
List<Map> data = new ArrayList<>();
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_11.getValue());
if (ObjectUtil.isEmpty(template)) {
throw new ServiceException("模板内容未找到");
}
String html = null;
try {
html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
orderPackgeCodeDataVO.setTemplateHtml(html);
orderPackgeCodeDataVO.setTemplateId(template.getId());
//查询库存品包件
DisStockListDetailEntity disStockListDetail = disStockListDetailService.getById(id);
if (Func.isEmpty(disStockListDetail)){
log.error("##################查询库存品包件失败id:{}",id);
throw new ServiceException("库存品包件查询失败");
}
//查询库存品信息
DistributionStockListEntity stockListEntity = this.getById(disStockListDetail.getStockListId());
if (Func.isEmpty(stockListEntity)){
log.info("##############查询ID:{}",disStockListDetail.getStockListId());
throw new ServiceException("查询库存品信息失败");
}
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(disStockListDetail.getReservationId());
if (Func.isEmpty(distributionReservationEntity)){
log.info("##############查询ID:{}",distributionReservationEntity);
throw new ServiceException("查询库存品信息失败");
}
Map<String, Object> map =JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class);
map.put("id",disStockListDetail.getId());
map.put("customerName",distributionReservationEntity.getConsignee());
map.put("customerTelephone",distributionReservationEntity.getDeliveryPhone());
map.put("customerAddress",distributionReservationEntity.getDeliveryAddress());
map.put("shipperName"," ");
map.put("shipperAddress"," ");
map.put("stockPackageCode",disStockListDetail.getStockPackageCode());
String filename = QRCodeUtil.createCodeToFile(disStockListDetail.getStockPackageCode());
map.put("img", QRCodeUtil.getEmpAutograph(filename));
if (Func.isNotEmpty(stockListEntity.getOrderCode())){
String fileTypeName = QRCodeUtil.createCodeToFile(stockListEntity.getOrderCode());
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
}
data.add(map);
orderPackgeCodeDataVO.setDataList(data);
return orderPackgeCodeDataVO;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public OrderPackgeCodeDataVO showInventorySourcePackageCode(String incomingBatch, Long packageIds) throws Exception {
OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();

Loading…
Cancel
Save