Browse Source

货位二维码变更

training
kilo 1 year ago
parent
commit
6ee47da9c6
  1. 92
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

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

@ -102,7 +102,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
@Override @Override
public R saveCustom(TaskQuestDTO taskQuest) { public R saveCustom(TaskQuestDTO taskQuest) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (null == myCurrentWarehouse){ if (null == myCurrentWarehouse) {
return R.fail("请选择仓库后操作"); return R.fail("请选择仓库后操作");
} }
Long id = myCurrentWarehouse.getId(); Long id = myCurrentWarehouse.getId();
@ -112,7 +112,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
taskQuest.setQuestNum(questNum); taskQuest.setQuestNum(questNum);
boolean save = this.save(taskQuest); boolean save = this.save(taskQuest);
//存入子表 //存入子表
if (taskQuest.getList().size()>0){ if (taskQuest.getList().size() > 0) {
List<TaskQuestChildEntity> list = taskQuest.getList(); List<TaskQuestChildEntity> list = taskQuest.getList();
for (TaskQuestChildEntity taskQuestChildEntity : list) { for (TaskQuestChildEntity taskQuestChildEntity : list) {
taskQuestChildEntity.setWarehouseId(id); taskQuestChildEntity.setWarehouseId(id);
@ -120,14 +120,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
} }
taskQuestChildService.saveBatch(list); taskQuestChildService.saveBatch(list);
} }
return save?R.success("添加成功"):R.fail("添加失败"); return save ? R.success("添加成功") : R.fail("添加失败");
} }
@Override @Override
public TaskQuestVO getOneCustom(Long id) { public TaskQuestVO getOneCustom(Long id) {
TaskQuestVO taskQuestVO = new TaskQuestVO(); TaskQuestVO taskQuestVO = new TaskQuestVO();
TaskQuestEntity taskQuestEntity = baseMapper.selectById(id); TaskQuestEntity taskQuestEntity = baseMapper.selectById(id);
Func.copy(taskQuestEntity,taskQuestVO); Func.copy(taskQuestEntity, taskQuestVO);
//查询子表 //查询子表
List<TaskQuestChildVO> list = taskQuestChildService.selectlistByMasterId(id); List<TaskQuestChildVO> list = taskQuestChildService.selectlistByMasterId(id);
taskQuestVO.setList(list); taskQuestVO.setList(list);
@ -138,8 +138,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
public Boolean deleteLogicCustom(List<Long> toLongList) { public Boolean deleteLogicCustom(List<Long> toLongList) {
//删除子表 //删除子表
boolean remove = taskQuestChildService.remove(new QueryWrapper<TaskQuestChildEntity>().lambda() boolean remove = taskQuestChildService.remove(new QueryWrapper<TaskQuestChildEntity>().lambda()
.eq(TaskQuestChildEntity::getIsDeleted,0) .eq(TaskQuestChildEntity::getIsDeleted, 0)
.in(TaskQuestChildEntity::getQuestId,toLongList) .in(TaskQuestChildEntity::getQuestId, toLongList)
); );
return this.deleteLogic(toLongList); return this.deleteLogic(toLongList);
} }
@ -149,11 +149,11 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
Long id = taskQuest.getId(); Long id = taskQuest.getId();
//删除子表 //删除子表
boolean remove = taskQuestChildService.remove(new QueryWrapper<TaskQuestChildEntity>().lambda() boolean remove = taskQuestChildService.remove(new QueryWrapper<TaskQuestChildEntity>().lambda()
.eq(TaskQuestChildEntity::getIsDeleted,0) .eq(TaskQuestChildEntity::getIsDeleted, 0)
.eq(TaskQuestChildEntity::getQuestId,id) .eq(TaskQuestChildEntity::getQuestId, id)
); );
//存入子表 //存入子表
if (taskQuest.getList().size()>0){ if (taskQuest.getList().size() > 0) {
List<TaskQuestChildEntity> list = taskQuest.getList(); List<TaskQuestChildEntity> list = taskQuest.getList();
for (TaskQuestChildEntity taskQuestChildEntity : list) { for (TaskQuestChildEntity taskQuestChildEntity : list) {
taskQuestChildEntity.setWarehouseId(id); taskQuestChildEntity.setWarehouseId(id);
@ -168,12 +168,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
@Override @Override
public IPage<TaskQuestApiVO> selectTaskQuestApiPage(IPage<TaskQuestApiVO> page, TaskQuestApiVO taskQuest) { public IPage<TaskQuestApiVO> selectTaskQuestApiPage(IPage<TaskQuestApiVO> page, TaskQuestApiVO taskQuest) {
List<Long> collect =this.getmyWarehouseList(); List<Long> collect = this.getmyWarehouseList();
List<TaskQuestApiVO> taskQuestVOS = baseMapper.selectTaskQuestApiPage(page, taskQuest, collect); List<TaskQuestApiVO> taskQuestVOS = baseMapper.selectTaskQuestApiPage(page, taskQuest, collect);
for (TaskQuestApiVO taskQuestVO : taskQuestVOS) { for (TaskQuestApiVO taskQuestVO : taskQuestVOS) {
//查询子表 //查询子表
List<TaskQuestChildVO> list = taskQuestChildService.selectlistByMasterId(taskQuestVO.getId()); List<TaskQuestChildVO> list = taskQuestChildService.selectlistByMasterId(taskQuestVO.getId());
taskQuestVO.setList(list); taskQuestVO.setList(list);
} }
return page.setRecords(taskQuestVOS); return page.setRecords(taskQuestVOS);
} }
@ -188,13 +188,13 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
@Override @Override
public IPage<TaskallocationVO> selectallocationList(IPage<TaskallocationVO> page, TaskSearchDTO taskSearchDTO) { public IPage<TaskallocationVO> selectallocationList(IPage<TaskallocationVO> page, TaskSearchDTO taskSearchDTO) {
List<Long> collect =this.getmyWarehouseList(); List<Long> collect = this.getmyWarehouseList();
List<TaskallocationVO> list =baseMapper.selectallocationList(page,taskSearchDTO,collect); List<TaskallocationVO> list = baseMapper.selectallocationList(page, taskSearchDTO, collect);
if (!list.isEmpty()){ if (!list.isEmpty()) {
for (TaskallocationVO taskallocationVO : list) { for (TaskallocationVO taskallocationVO : list) {
Long allocationId = taskallocationVO.getAllocationId(); Long allocationId = taskallocationVO.getAllocationId();
Integer i = warehouseUpdownGoodsMapper.selectCountSumByallocation(allocationId); Integer i = warehouseUpdownGoodsMapper.selectCountSumByallocation(allocationId);
taskallocationVO.setTotal(i); taskallocationVO.setTotal(i);
} }
} }
return page.setRecords(list); return page.setRecords(list);
@ -202,43 +202,43 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
@Override @Override
public IPage<TaskContractVO> selectcontractList(IPage<TaskContractVO> page, TaskSearchDTO taskSearchDTO) { public IPage<TaskContractVO> selectcontractList(IPage<TaskContractVO> page, TaskSearchDTO taskSearchDTO) {
List<Long> collect =this.getmyWarehouseList(); List<Long> collect = this.getmyWarehouseList();
baseMapper.setSqlMode(); baseMapper.setSqlMode();
List<TaskContractVO> list = baseMapper.selectcontractList(page,taskSearchDTO,collect); List<TaskContractVO> list = baseMapper.selectcontractList(page, taskSearchDTO, collect);
if (!list.isEmpty()){ if (!list.isEmpty()) {
for (TaskContractVO taskContractVO : list) { for (TaskContractVO taskContractVO : list) {
Long orderId = taskContractVO.getOrderId(); Long orderId = taskContractVO.getOrderId();
String orderCode = taskContractVO.getOrderCode(); String orderCode = taskContractVO.getOrderCode();
//查询该订单,如果是零担直接用在库数量 //查询该订单,如果是零担直接用在库数量
DistributionStockArticleEntity entityByStockArticle = distributionStockArticleClient.findEntityByStockArticleId(orderId); DistributionStockArticleEntity entityByStockArticle = distributionStockArticleClient.findEntityByStockArticleId(orderId);
if (entityByStockArticle.getIsZero().equals("1")){ if (entityByStockArticle.getIsZero().equals("1")) {
if (entityByStockArticle.getGenre() == 1){ if (entityByStockArticle.getGenre() == 1) {
taskContractVO.setTotal(entityByStockArticle.getTotalNumber()); taskContractVO.setTotal(entityByStockArticle.getTotalNumber());
taskContractVO.setZktotal(entityByStockArticle.getTotalNumber()); taskContractVO.setZktotal(entityByStockArticle.getTotalNumber());
} }
}else if (entityByStockArticle.getIsZero().equals("0")){ } else if (entityByStockArticle.getIsZero().equals("0")) {
//包条 //包条
if (entityByStockArticle.getGenre()==1){ if (entityByStockArticle.getGenre() == 1) {
//查询该订单下包条的所有数量 //查询该订单下包条的所有数量
Integer integer = distributionParcelListClient.SumEntityByOrderId(orderId, null); Integer integer = distributionParcelListClient.SumEntityByOrderId(orderId, null);
Integer integer1 = distributionParcelListClient.SumEntityByOrderId(orderId, collect.get(0)); Integer integer1 = distributionParcelListClient.SumEntityByOrderId(orderId, collect.get(0));
taskContractVO.setTotal(integer); taskContractVO.setTotal(integer);
taskContractVO.setZktotal(integer1); taskContractVO.setZktotal(integer1);
}
} }
} }
}
} }
return page.setRecords(list); return page.setRecords(list);
} }
@Override @Override
public IPage<TaskTrayVO> selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO) { public IPage<TaskTrayVO> selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO) {
List<Long> collect =this.getmyWarehouseList(); List<Long> collect = this.getmyWarehouseList();
baseMapper.setSqlMode(); baseMapper.setSqlMode();
List<TaskTrayVO> list = baseMapper.selecttrayList(page,taskSearchDTO,collect); List<TaskTrayVO> list = baseMapper.selecttrayList(page, taskSearchDTO, collect);
if (!list.isEmpty()){ if (!list.isEmpty()) {
for (TaskTrayVO taskTrayVO : list) { for (TaskTrayVO taskTrayVO : list) {
//查询托盘 //查询托盘
Integer i = warehouseTrayGoodsMapper.SumByTrayId(taskTrayVO.getTrayId()); Integer i = warehouseTrayGoodsMapper.SumByTrayId(taskTrayVO.getTrayId());
@ -251,7 +251,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
@Override @Override
public IPage<TaskStripApiVO> selectallocationDetailByStrip(IPage<TaskStripApiVO> page, TaskSearchDTO taskSearchDTO) { public IPage<TaskStripApiVO> selectallocationDetailByStrip(IPage<TaskStripApiVO> page, TaskSearchDTO taskSearchDTO) {
//查询货位上的所有包条 //查询货位上的所有包条
List<TaskStripApiVO> list = warehouseUpdownGoodsMapper.selectListByTaskStrip(page,taskSearchDTO); List<TaskStripApiVO> list = warehouseUpdownGoodsMapper.selectListByTaskStrip(page, taskSearchDTO);
for (TaskStripApiVO taskStripApiVO : list) { for (TaskStripApiVO taskStripApiVO : list) {
} }
@ -260,7 +260,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
private String getQuestNum(String warehouseCode) { private String getQuestNum(String warehouseCode) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
return "PDRW-"+warehouseCode+"-"+simpleDateFormat.format(new Date())+new Random().nextInt(900) + 100; return "PDRW-" + warehouseCode + "-" + simpleDateFormat.format(new Date()) + new Random().nextInt(900) + 100;
} }
} }

Loading…
Cancel
Save