Browse Source

增加转库存品、取消库存品日志,自提扫描增加仓库字段

dist.1.3.0
汤建军 10 months ago
parent
commit
ed6a161648
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionBillLadingScanEntity.java
  3. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforStockArticleVO.java
  4. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderMainVO.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  6. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  8. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  9. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  10. 15
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

1
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -52,6 +52,7 @@ public enum WorkNodeEnums implements Serializable {
SPLIT_SHIPPING_ORDER(201070, "运单拆单"),
EMPTY_PALLET(201080, "托盘空置"),
STOCK_TRANSFER(201090, "转库存"),
CANCEL_STOCK_TRANSFER(201090, "取消转库存"),
PACKAGE_TRANSFER(2010100, "转包件"),
SPLIT_ORDER(2010110, "拆单"),
INVENTORY_STOCKING(2010120, "库存品入库"),

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionBillLadingScanEntity.java

@ -69,6 +69,9 @@ public class DistributionBillLadingScanEntity extends BaseEntity {
@ApiModelProperty(value = "库存品id")
private Long stockListId;
@ApiModelProperty(value = "仓库Id")
private Long warehouseId;
@ApiModelProperty(value = "扫描操作人")
private String scanUser;

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforStockArticleVO.java

@ -212,11 +212,6 @@ public class DistributionSignforStockArticleVO implements Serializable {
@ApiModelProperty(value = "签收扫描时间")
private Date scanSigningTime;
/**
* 签收复核时间
*/
@ApiModelProperty(value = "签收复核时间")
private Date signingTime;
/**

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderMainVO.java

@ -22,6 +22,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 提货单 视图实体类
@ -42,5 +43,6 @@ public class DistrilbutionAppBillLadingOrderMainVO implements Serializable {
private List<DistrilbutionAppBillLadingOrderVO> list = new ArrayList<>();
private List<DistrilbutionBillLadingAppVO> inventoryList = new ArrayList<>();
private List<DistrilbutionAppBillLadingZeroOrderVO> billLadingZeroOrderVOS = new ArrayList<>();
private List<Map<String,Object>> packageList ;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -722,7 +722,7 @@
<select id="selectBillLadingPackage"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT ldpl.* FROM logpm_distrilbution_bill_package AS ldbp LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
WHERE packet_bar_status != '3' AND bill_lading_id in
WHERE ldbp.packet_bar_status != '2' AND ldbp.bill_lading_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -49,6 +49,7 @@ import com.logpm.distribution.vo.DistributionParcelListNodeVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelListZeroVO;
import com.logpm.distribution.vo.PackageStockupVO;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
@ -56,6 +57,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
@ -65,6 +67,7 @@ import org.springblade.common.node.PackageNode;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -81,17 +84,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -143,6 +136,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private IBasicdataClientClient basicdataClientClient;
@Autowired
private IUserClient userClient;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
// private final IDistributionStockArticleService distributionStockArticleService;
@Override
@ -510,6 +505,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
throw new ServiceException("有包件未维护物料信息,请维护后在进行操作!!");
}
if (!list1.isEmpty()) {
List<JSONObject> aaa = new ArrayList<>();
Set<Long> listString = new HashSet<>();
log.info("###############包件信息>>>>>>>>>>>>,{}", list1);
Map<Long, List<DistributionParcelListEntity>> listMap = list1.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getMaterialId));
@ -552,6 +548,10 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
listString.add(i.getStockArticleId());
//生成包件转库存品记录
packageIds.add(parcelList.getId());
//生成转库存品的日志记录
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"转库存品,"+"批次号:"+i.getOrderCode()+"物料名称:"+i.getMaterialName()+"物料编码:"+i.getMaterialCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), i.getOrderPackageCode(), content, WorkNodeEnums.STOCK_TRANSFER.getCode());
aaa.add(js);
});
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(v.get(0), parcelListEntity);
@ -608,6 +608,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionStockArticleMapper.updateById(distributionStockArticleEntity);
}
});
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
return R.success("操作成功!");
}
return R.fail("没有可用数据!");
@ -1294,4 +1297,24 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findOrderCodesByOrderPackageCodes(orderPackageCodes,warehouseId);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}

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

@ -2872,7 +2872,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 包件解托下架
content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"后台签收,装车方式:补录装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog =handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),loadscanEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
trunklinePackageTrackLog =handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),distributionLoadscanEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
}catch (Exception e){
log.error("装车日志数据错误",e);
}

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

@ -40,6 +40,7 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionMerchantStockListVO;
import com.logpm.distribution.vo.app.StockMallVO;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
@ -48,6 +49,7 @@ import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.utils.QRCodeUtil;
@ -120,6 +122,9 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
@Lazy
private IDisStockListDetailService disStockListDetailService;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@ -1085,6 +1090,10 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
.set(DistributionParcelListEntity::getMaterialCode, null)
.set(DistributionParcelListEntity::getMaterialUnit, null)
.in(DistributionParcelListEntity::getId, packageIds);
//清理包件的物料信息
boolean update = distributionParcelListService.update(up);
//维护订单信息
@ -1099,9 +1108,39 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
}
//清理库存品入库记录
distributionStockListInfoService.removeBatchByIds(Func.toLongList(distributionStockListDTO.getStockListInfoIds()));
List<JSONObject> aaa = new ArrayList<>();
//增加撤销转库存品日志
parcelListEntities.forEach(p->{
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"撤销转库存品,"+"批次号:"+stockListEntity.getIncomingBatch()+"物料名称:"+stockListEntity.getDescriptionGoods()+"物料编码:"+stockListEntity.getCargoNumber();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_STOCK_TRANSFER.getCode());
aaa.add(js);
});
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
return R.success("操作成功");
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}
// @Override

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -2380,6 +2380,31 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (entityList.isEmpty()) {
mainVO.setList(null);
return mainVO;
}else {
List<DistrilbutionBillPackageEntity> packageEntities = distrilbutionBillPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getBillLadingId, billLadingId)
.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!packageEntities.isEmpty()) {
List<Long> packageIds = packageEntities.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList());
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(packageIds);
if (!distributionParcelListEntities.isEmpty()) {
List<Map<String,Object>> mapList = new ArrayList<>();
distributionParcelListEntities.forEach(p->{
Map<String,Object> map = new HashMap<>();
map.put("orderPackageCode",p.getOrderPackageCode());
map.put("isSign",p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
map.put("category",p.getSecond());
map.put("orderId",p.getStockArticleId());
map.put("num",p.getQuantity());
mapList.add(map);
});
if (!mapList.isEmpty()) {
mainVO.setPackageList(mapList);
}
}
}
}
@ -2882,6 +2907,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionBillLadingScan.setMaterialType(type);
distributionBillLadingScan.setBillLadingId(Long.parseLong(billLadingId.toString()));
distributionBillLadingScan.setScanType(1);
distributionBillLadingScan.setWarehouseId(myCurrentWarehouse.getId());
distributionBillLadingScan.setScanUser(AuthUtil.getUser().getNickName());
return processScan(type, billLadingId, coding, distributionBillLadingScan, myCurrentWarehouse, billLadingEntity1.getPickupBatch());

15
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -186,8 +186,6 @@ public class DistributionDatarepair {
@XxlJob("pushNotification")
public ReturnT<String> pushNotification(String params) {
// 得到当前仓库所有的签收任务
Integer parmeId = null;
if(StringUtil.isNotBlank(params)){
parmeId = Integer.parseInt(params);
@ -204,10 +202,6 @@ public class DistributionDatarepair {
log.error(">>> 推送失败 id="+id);
}
}
return ReturnT.SUCCESS;
}
@ -223,10 +217,8 @@ public class DistributionDatarepair {
parmeId = Integer.parseInt(params);
}
List<JSONObject> allSignfor = warehouseMappingDataMapper.findAllBillSign(parmeId);
for (JSONObject entries : allSignfor) {
Long id = entries.getLong("billId");
Boolean b =distrilbutionBillLadingClient.clerkBillCheckPushData(id);
if(b!=null&&b){
warehouseMappingDataMapper.updateClearSignforStatus(id, entries.getLong("warehouseId"), 1);
@ -234,10 +226,7 @@ public class DistributionDatarepair {
}else{
log.error(">>> pushBillNotification 失败 id="+id);
}
}
return ReturnT.SUCCESS;
}
@ -250,9 +239,7 @@ public class DistributionDatarepair {
@XxlJob("sendFactorySignforInfo")
public ReturnT<String> sendFactorySignforInfo(String params) {
// 得到当前仓库所有的签收任务
Boolean b =distrilbutionBillLadingClient.sendFactorySignforInfo(params);
Boolean b =distrilbutionBillLadingClient.sendFactorySignforInfo(params);
return ReturnT.SUCCESS;
}

Loading…
Cancel
Save