Browse Source

1.盘点任务功能更新

training
zhenghaoyu 1 year ago
parent
commit
b5c674ecc2
  1. 76
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java
  2. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java
  3. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/QuestDetailMapper.java
  4. 30
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/QuestDetailMapper.xml
  5. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IQuestDetailService.java
  6. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  7. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/QuestDetailServiceImpl.java
  8. 97
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

76
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java

@ -159,6 +159,47 @@ public class WarehouseTaskApiController {
}
}
@GetMapping("/questScanAllcation")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "库位盘点扫描库位", notes = "code,type")
public R questScanAllcation(TaskSearchDTO taskSearchDTO) {
String method = "###########questScanAllcation: ";
log.info(method+"库位明细(定制品) 参数:{}",taskSearchDTO);
Long questId = taskSearchDTO.getQuestId();//任务id
Long allocationId = taskSearchDTO.getAllocationId();//库位id
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
taskSearchDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(questId)){
log.warn(method+"任务id为空 questId={}",questId);
return R.fail(403,"任务id为空");
}
if(Objects.isNull(allocationId)){
log.warn(method+"库位id为空 allocationId={}",allocationId);
return R.fail(403,"库位id为空");
}
return taskQuestService.questScanAllcation(taskSearchDTO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
/**
* 库位明细(定制品)
*/
@ -441,6 +482,40 @@ public class WarehouseTaskApiController {
}
}
@PostMapping("/selectPackageInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询包件信息", notes = "code,type")
public R selectPackageInfo(@RequestBody TaskSearchDTO taskSearchDTO) {
String method = "###########selectPackageInfo: ";
log.info(method+"查询包件信息 参数:{}",taskSearchDTO);
String orderPackageCode = taskSearchDTO.getOrderPackageCode();//包件码
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
taskSearchDTO.setWarehouseId(myCurrentWarehouse.getId());
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码为空 orderPackageCode={}",orderPackageCode);
return R.fail(403,"包件码为空");
}
return taskQuestService.selectPackageInfo(taskSearchDTO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@PostMapping("/saveNewQuestDetail")
@ApiOperationSupport(order = 1)
@ -455,7 +530,6 @@ public class WarehouseTaskApiController {
Long allocationId = taskSearchDTO.getAllocationId();//库位
QuestDetailDTO questDetail = taskSearchDTO.getQuestDetail();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java

@ -129,5 +129,7 @@ public class TaskSearchDTO {
private String materialCode;
private String orderPackageCode;
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/QuestDetailMapper.java

@ -16,6 +16,7 @@
*/
package com.logpm.warehouse.mapper;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.vo.QuestDetailVO;
import com.logpm.warehouse.excel.QuestDetailExcel;
@ -51,4 +52,5 @@ public interface QuestDetailMapper extends BaseMapper<QuestDetailEntity> {
*/
List<QuestDetailExcel> exportQuestDetail(@Param("ew") Wrapper<QuestDetailEntity> queryWrapper);
QuestDetailEntity queryPackageInfo(@Param("param") TaskSearchDTO taskSearchDTO);
}

30
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/QuestDetailMapper.xml

@ -42,4 +42,34 @@
SELECT * FROM logpm_quest_detail ${ew.customSqlSegment}
</select>
<select id="queryPackageInfo" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select ldpl.order_code orderCode,
ldpl.stock_article_id orderId,
2 questType,
1 questTarget,
ldpl.order_package_code ordePackageCode,
ldpl.id orderPackageId,
0 questStatus,
ldpl.quantity stockNum,
ldpl.warehouse_id warehouseId,
lwug.position_code positionCode,
lwtg.tray_id trayId,
lwtg.tray_code trayCode,
lwug.allocation_id allocationId,
1 isNew
from logpm_distribution_parcel_list ldpl
left join logpm_warehouse_tray_goods lwtg on ldpl.order_package_code = lwtg.association_value and lwtg.association_type = 3
left join logpm_warehouse_updown_goods lwug on ldpl.order_package_code = lwug.association_value and lwug.association_type = 3
where lwug.association_type = 3
and lwug.warehouse_id = #{param.warehouseId}
and ldpl.warehouse_id = #{param.warehouseId}
and ldpl.order_package_code = #{param.orderPackageCode}
<if test="param.marketNames != null">
and ldpl.dealer_name in
<foreach collection="param.marketNames" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IQuestDetailService.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.vo.QuestDetailVO;
import com.logpm.warehouse.excel.QuestDetailExcel;
@ -50,4 +51,7 @@ public interface IQuestDetailService extends BaseService<QuestDetailEntity> {
List<QuestDetailExcel> exportQuestDetail(Wrapper<QuestDetailEntity> queryWrapper);
void saveList(List<QuestDetailEntity> list, Long questId);
QuestDetailEntity queryPackageInfo(TaskSearchDTO taskSearchDTO);
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -128,4 +128,8 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
IPage <QuestDetailVO> SelectInventory(IPage<TaskQuestVO> page,Long id);
IPage <QuestDetailVO> SelectZero(IPage<TaskQuestVO> page,Long id);
R questScanAllcation(TaskSearchDTO taskSearchDTO);
R selectPackageInfo(TaskSearchDTO taskSearchDTO);
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/QuestDetailServiceImpl.java

@ -16,6 +16,7 @@
*/
package com.logpm.warehouse.service.impl;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.vo.QuestDetailVO;
import com.logpm.warehouse.excel.QuestDetailExcel;
@ -60,4 +61,9 @@ public class QuestDetailServiceImpl extends BaseServiceImpl<QuestDetailMapper, Q
saveBatch(list);
}
@Override
public QuestDetailEntity queryPackageInfo(TaskSearchDTO taskSearchDTO) {
return baseMapper.queryPackageInfo(taskSearchDTO);
}
}

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

@ -691,17 +691,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
//先判定盘点任务是否已结束
verifyTask(questId, warehouseId);
//先判断库位是否有数据
List<QuestDetailEntity> lsPackage = warehouseUpdownGoodsMapper.allocationDetailByPackage(taskSearchDTO);
List<QuestDetailEntity> lsZero = warehouseUpdownGoodsMapper.allocationDetailByZero(taskSearchDTO);
List<QuestDetailEntity> lsStock = warehouseUpdownGoodsMapper.allocationDetailByStock(taskSearchDTO);
Integer size = lsPackage.size() + lsZero.size() + lsStock.size();
if(size == 0){
log.warn("###########allocationDetailByPackage: 未有数据在盘点计划中 questId={}",questId);
throw new CustomerException(403,"未有数据在盘点计划中");
}
//先查询任务的过滤商场
QueryWrapper<TaskQuestChildEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("quest_id", questId)
@ -1090,6 +1079,21 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailEntity.setGroundingPositionCode(positionCode);
questDetailEntity.setIsNew(1);
questDetailService.save(questDetailEntity);
Long questDetailId = questDetailEntity.getId();
Integer stockNum = questDetailEntity.getStockNum();
Integer lossNum = 0;
Integer deliveNum = 0;
Integer wornNum = 0;
Integer noReceivedNum = 0;
Integer noRepairNum = 0;
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(stockNum,"10",questDetailId,warehouseId));
childList.add(addQuestDetailChild(wornNum,"20",questDetailId,warehouseId));
childList.add(addQuestDetailChild(lossNum,"30",questDetailId,warehouseId));
childList.add(addQuestDetailChild(noRepairNum,"40",questDetailId,warehouseId));
childList.add(addQuestDetailChild(deliveNum,"50",questDetailId,warehouseId));
childList.add(addQuestDetailChild(noReceivedNum,"60",questDetailId,warehouseId));
questDetailChildService.saveOrUpdateBatch(childList);
}
@Override
@ -1214,6 +1218,77 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return questDetailVOList;
}
@Override
public R questScanAllcation(TaskSearchDTO taskSearchDTO) {
log.warn("###########questScanAllcation: 盘点扫码库位 ");
Long warehouseId = taskSearchDTO.getWarehouseId();
Long allocationId = taskSearchDTO.getAllocationId();
Long questId = taskSearchDTO.getQuestId();
verifyTask(questId,warehouseId);
//返回库位信息
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if (Objects.isNull(goodsAllocationEntity)) {
log.warn("###########saveNewQuestDetail: 库位信息不存在 allocationId={}", allocationId);
throw new CustomerException(403, "库位信息不存在");
}
Long wid = goodsAllocationEntity.getWarehouseId();
if (!wid.equals(warehouseId)) {
log.warn("###########saveNewQuestDetail: 库位不在当前仓 allocationId={}", allocationId);
throw new CustomerException(403, "库位不在当前仓");
}
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
BasicdataGoodsShelfEntity basicdataGoodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId);
if (Objects.isNull(basicdataGoodsShelfEntity)) {
log.warn("###########saveNewQuestDetail: 货架信息不存在 goodsShelfId={}", goodsShelfId);
throw new CustomerException(403, "货架信息不存在");
}
Long goodsAreaId = basicdataGoodsShelfEntity.getGoodsAreaId();
BasicdataGoodsAreaEntity goodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if (Objects.isNull(goodsAreaEntity)) {
log.warn("###########saveNewQuestDetail: 货区信息不存在 goodsAreaId={}", goodsAreaId);
throw new CustomerException(403, "货区信息不存在");
}
String positionCode = goodsAreaEntity.getHeadline() + "-" + basicdataGoodsShelfEntity.getGoodsShelfName() + "-" + goodsAllocationEntity.getGoodsAllocationName();
Map<String,Object> map = new HashMap<>();
map.put("positionCode",positionCode);
map.put("allocationId",allocationId);
return R.data(map);
}
@Override
public R selectPackageInfo(TaskSearchDTO taskSearchDTO) {
log.warn("###########selectPackageInfo: 盘点扫码库位 ");
Long warehouseId = taskSearchDTO.getWarehouseId();
String orderPackageCode = taskSearchDTO.getOrderPackageCode();
Long questId = taskSearchDTO.getQuestId();
verifyTask(questId,warehouseId);
//先查询任务的过滤商场
QueryWrapper<TaskQuestChildEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("quest_id", questId)
.eq("is_deleted", 0);
List<TaskQuestChildEntity> questChildEntitys = taskQuestChildService.list(queryWrapper);
List<String> marketNames = null;
for (TaskQuestChildEntity childEntity : questChildEntitys) {
if (Objects.isNull(marketNames)) {
marketNames = new ArrayList<>();
}
marketNames.add(childEntity.getRefName());
}
taskSearchDTO.setMarketNames(marketNames);
QuestDetailEntity questDetailEntity = questDetailService.queryPackageInfo(taskSearchDTO);
if(Objects.isNull(questDetailEntity)){
questDetailEntity = new QuestDetailEntity();
questDetailEntity.setOrdePackageCode(orderPackageCode);
}
return R.data(questDetailEntity);
}
private QuestDetailChildEntity addQuestDetailChild(Integer num,String cargoName,Long questDetaiId,Long warehouseId){

Loading…
Cancel
Save