Browse Source

备货日志增加

dist.1.3.0
汤建军 7 months ago
parent
commit
af36390d23
  1. 52
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

52
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -36,6 +36,7 @@ import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.DistributionReservationMapper; import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.service.*; import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.*;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.feign.*; import com.logpm.warehouse.feign.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -46,6 +47,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
@ -60,12 +62,14 @@ import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionDefinition;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -123,6 +127,7 @@ public class DistributionStockupAppController extends BladeController {
private final IWarehouseUpdownStockUpAreaClient warehouseUpdownStockUpAreaClient; private final IWarehouseUpdownStockUpAreaClient warehouseUpdownStockUpAreaClient;
private final BladeRedis redis; private final BladeRedis redis;
private final ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
/** /**
@ -1587,6 +1592,13 @@ public class DistributionStockupAppController extends BladeController {
switch (integer) { switch (integer) {
case 1: case 1:
DistributionStockupEntity distributionStockupEntity = distributionStockupService.getById(stockupDTO.getStockupId()); DistributionStockupEntity distributionStockupEntity = distributionStockupService.getById(stockupDTO.getStockupId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
List<JSONObject> aaa = new ArrayList<>();
if (Func.isEmpty(reservationEntity)){
log.warn("##################查询预约任务错误:{}",reservationId);
return R.fail("预约信息错误");
}
//正常 //正常
//先保存扫码包件信息,后续由队列来出来余下补充信息 //先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity(); DistributionStockEntity entity = new DistributionStockEntity();
@ -1598,16 +1610,11 @@ public class DistributionStockupAppController extends BladeController {
entity.setStockArticle(one.getStockArticleId()); entity.setStockArticle(one.getStockArticleId());
entity.setCoding(packetBarCode); entity.setCoding(packetBarCode);
entity.setScanUser(AuthUtil.getUser().getNickName()); entity.setScanUser(AuthUtil.getUser().getNickName());
// entity.setStockupArea(stockupArea);
entity.setStockupId(stockupId); entity.setStockupId(stockupId);
entity.setStockupId(stockupId); entity.setStockupId(stockupId);
entity.setParcelListId(one.getId()); entity.setParcelListId(one.getId());
entity.setStockQuantity(1); entity.setStockQuantity(1);
// //修改包件备货状态 // //修改包件备货状态
// DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
// parcelListEntity.setId(one.getId());
// parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
// distributionParcelListService.updateById(parcelListEntity);
if ("3".equals(distributionStockupEntity.getTypeService())) { if ("3".equals(distributionStockupEntity.getTypeService())) {
entity.setBillLadingId(reservationId); entity.setBillLadingId(reservationId);
DistributionStockupEntity byId = distributionStockupService.getById(stockupId); DistributionStockupEntity byId = distributionStockupService.getById(stockupId);
@ -1630,13 +1637,10 @@ public class DistributionStockupAppController extends BladeController {
entity.setConditions("0"); entity.setConditions("0");
entity.setType(2); entity.setType(2);
entity.setOutboundType(distributionStockupEntity.getTypeService()); entity.setOutboundType(distributionStockupEntity.getTypeService());
// entity.setStockupArea(stockupDTO.getStockupAllocationName());
// entity.setStockupAreaId(stockupDTO.getStockupAllocationId());
//修改订单备货状态 //修改订单备货状态
distributionAsyncService.updateStockArticleStock(one.getStockArticleId()); distributionAsyncService.updateStockArticleStock(one.getStockArticleId());
//修改备货时间 //修改备货时间
distributionAsyncService.updateStockupDate(stockupDTO); distributionAsyncService.updateStockupDate(stockupDTO);
// dataSourceTransactionManager.commit(transactionStatus);//提交
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID()); map.put("messageId", CommonUtil.getUUID());
@ -1669,6 +1673,7 @@ public class DistributionStockupAppController extends BladeController {
return message; return message;
}); });
//查询是否货位数据是否该下架 //查询是否货位数据是否该下架
BladeUser user = AuthUtil.getUser();
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())) { if (!Func.isEmpty(stockupDTO.getStockupAllocationId())) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
@ -1680,14 +1685,24 @@ public class DistributionStockupAppController extends BladeController {
//进行了备货库位的选择才进行备货库位的上架 //进行了备货库位的选择才进行备货库位的上架
warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject); warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject);
entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); entity.setStockupAreaId(stockupDTO.getStockupAllocationId());
String content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "备货上架,操作方式:备货上架同步操作,备货任务号:" + distributionStockupEntity.getStockupCode() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, user, entity.getCoding(), content, WorkNodeEnums.STOCKING_OPERATION.getCode());
aaa.add(js);
} }
distributionStockService.save(entity); distributionStockService.save(entity);
//增加备货扫描节点
String content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "备货作业,备货任务号:" + distributionStockupEntity.getStockupCode() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, user, entity.getCoding(), content, WorkNodeEnums.STOCKING_OPERATION.getCode());
aaa.add(js);
//修改包件备货状态 //修改包件备货状态
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
parcelListEntity.setId(entity.getParcelListId()); parcelListEntity.setId(entity.getParcelListId());
parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue()); parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
distributionParcelListService.updateById(parcelListEntity); distributionParcelListService.updateById(parcelListEntity);
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), audioValue); return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), audioValue);
case 2: case 2:
//重复扫描 //重复扫描
@ -1713,4 +1728,25 @@ public class DistributionStockupAppController extends BladeController {
} }
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/mapper/DistributionStockupMapper.xml

@ -1061,7 +1061,7 @@
from logpm_distribution_stockup_info ldsi from logpm_distribution_stockup_info ldsi
left join logpm_distribution_stockup lds on lds.id = ldsi.stockup_id and lds.is_deleted = 0 left join logpm_distribution_stockup lds on lds.id = ldsi.stockup_id and lds.is_deleted = 0
left join logpm_warehouse_goods_area lwga on lwga.id = lds.goods_area_id and lwga.is_deleted = 0 left join logpm_warehouse_goods_area lwga on lwga.id = lds.goods_area_id and lwga.is_deleted = 0
where ldsi.reservation_id = #{reservationId} where ldsi.reservation_id = #{reservationId} AND ldsi.stock_status != 4
and ldsi.is_deleted = 0 and ldsi.is_deleted = 0
</select> </select>
<select id="getInventoryCheSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO"> <select id="getInventoryCheSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO">

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

@ -762,7 +762,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.setHeader("x-delay", 3000); .setHeader("x-delay", 3000);
return message; return message;
}); });
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描装车配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode()); JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
aaa.add(trunklinePackageTrackLog); aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode()); orderPackageCodes.add(loadscanEntity.getOrderPackageCode());

Loading…
Cancel
Save