Browse Source

1.盘点任务新增数据逻辑修改

training
zhenghaoyu 1 year ago
parent
commit
46acd14b52
  1. 50
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

50
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -30,7 +30,6 @@ import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.distribution.vo.DistributionPackadeliVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.QuestDetailDTO;
@ -991,24 +990,31 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
//判断库位是否有托盘
BasicdataTrayEntity trayEntity = taryAllocationService.getTrayByAllocationId(allocationId);
trayCode = trayEntity.getPalletCode();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if (Objects.isNull(basicdataTrayEntity)) {
log.warn("###########saveNewQuestDetail: 托盘信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘信息不存在");
}
trayId = basicdataTrayEntity.getId();
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if (Objects.isNull(basicdataTrayEntity)) {
log.warn("###########saveNewQuestDetail: 托盘信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘信息不存在");
}
trayId = basicdataTrayEntity.getId();
TrayTypeDataVO trayTypeDataVO = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
if (Objects.isNull(trayTypeDataVO)) {
log.warn("###########saveNewQuestDetail: 托盘打托信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托信息不存在");
}
String type = trayTypeDataVO.getType();
if (questTarget != Integer.parseInt(type)) {
log.warn("###########saveNewQuestDetail: 托盘打托数据类型错误 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托数据类型错误");
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>();
trayTypeEntityQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = trayTypeService.getOne(trayTypeEntityQueryWrapper);
if (Objects.isNull(trayTypeEntity)) {
log.warn("###########saveNewQuestDetail: 托盘打托信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托信息不存在");
}
String type = trayTypeEntity.getType();
if (questTarget != Integer.parseInt(type)) {
log.warn("###########saveNewQuestDetail: 托盘打托数据类型错误 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托数据类型错误");
}
}
positionCode = goodsAreaEntity.getHeadline() + "-" + basicdataGoodsShelfEntity.getGoodsShelfName() + "-" + goodsAllocationEntity.getGoodsAllocationName();
} else if (questType == 4) {
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
@ -1017,12 +1023,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
throw new CustomerException(403, "托盘信息不存在");
}
trayId = basicdataTrayEntity.getId();
TrayTypeDataVO trayTypeDataVO = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
if (Objects.isNull(trayTypeDataVO)) {
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>();
trayTypeEntityQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = trayTypeService.getOne(trayTypeEntityQueryWrapper);
if (Objects.isNull(trayTypeEntity)) {
log.warn("###########saveNewQuestDetail: 托盘打托信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托信息不存在");
}
String type = trayTypeDataVO.getType();
String type = trayTypeEntity.getType();
if (questTarget != Integer.parseInt(type)) {
log.warn("###########saveNewQuestDetail: 托盘打托数据类型错误 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托数据类型错误");

Loading…
Cancel
Save