diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java index 65788196f..a6d23f58a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java @@ -117,7 +117,7 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList } /** - * @param params + * @param */ @Override public void pushNotification(String warehouseIds,String reservationCode) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml index 2cf138e8e..007aa5098 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml @@ -121,7 +121,6 @@ ldsa.total_number, ldsa.description_goods descriptionGoods, ldsa.stockup_status stockupStatus, - (SELECT GROUP_CONCAT(material_name) FROM logpm_distribution_parcel_list WHERE is_deleted = 0 AND stock_article_id = ldsa.id GROUP BY stock_article_id) AS materialName, CASE ldsa.is_zero WHEN 0 THEN (select COUNT(id) from logpm_distrilbution_bill_package diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java index d9c862446..dc7d88542 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java @@ -82,8 +82,8 @@ public class ClerkCheckPushDataQueueHandler { try { log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列"); //得到审核的任务ID - DistributionSignforDTO distributionStockEntity = (DistributionSignforDTO) map.get("messageData"); - Long signfor_id = distributionStockEntity.getId(); + DistributionSignforEntity t = (DistributionSignforEntity) map.get("messageData"); + Long signfor_id = t.getId(); if (ObjectUtil.isEmpty(signfor_id)) { log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); return; diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java index da63c3267..55bd4e3a5 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java @@ -1,10 +1,12 @@ package com.logpm.patch.jobhandle; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.json.JSONObject; import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.DistributionSignforEntity; import com.logpm.distribution.feign.IDistributionDeliveryListClient; import com.logpm.distribution.feign.IDistributionReservationClient; +import com.logpm.patch.mapper.WarehouseMappingDataMapper; import com.logpm.patch.service.ISyncDistributionParcelListService; import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import com.xxl.job.core.biz.model.ReturnT; @@ -12,7 +14,11 @@ import com.xxl.job.core.handler.annotation.XxlJob; import io.jsonwebtoken.lang.Objects; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.RabbitConstant; +import org.springblade.common.utils.CommonUtil; import org.springblade.core.tool.utils.Func; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.HashMap; @@ -36,7 +42,9 @@ public class DistributionDatarepair { private final IDistributionDeliveryListClient deliveryListClient; private final IDistributionReservationClient distributionReservationClient; + private final RabbitTemplate rabbitTemplate; + private final WarehouseMappingDataMapper warehouseMappingDataMapper; /** * 预约状态修复 @@ -169,19 +177,33 @@ public class DistributionDatarepair { */ @XxlJob("pushNotification") public ReturnT pushNotification(String params) { - JSONObject jsonObject = JSONObject.parseObject(params); - String warehouseIds =""; - String reservationCode =""; - if (!jsonObject.isEmpty()){ - warehouseIds = jsonObject.getString("warehouseIds"); - reservationCode = jsonObject.getString("reservationCode"); + // 得到当前仓库所有的签收任务 + + + List allSignfor = warehouseMappingDataMapper.findAllSignfor(); + + for (JSONObject entries : allSignfor) { + Long id = entries.getLong("singnforId"); + DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity(); + distributionSignforEntity.setId(id); + Map mapState = new HashMap(); + mapState.put("messageId", CommonUtil.getUUID()); + mapState.put("messageData", distributionSignforEntity); + mapState.put("createTime", System.currentTimeMillis()); + + + try { + log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ", mapState); +// rabbitTemplate.convertAndSend(RabbitConstant.CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.CLERK_CHECK_PUSH_DATA_ROUTING, mapState); + + } catch (Exception customerException) { + log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! {}", customerException.getMessage()); + } - //维护配送的状态 - String method = "######################DistributionDatarepair.pushNotification"; - log.info(method+"推送老系统:{}",params); - deliveryListClient.pushNotification(warehouseIds,reservationCode); - log.info(method+"推送老系统"); + } + + return ReturnT.SUCCESS; } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java index 7ac43cee3..a7e01afa9 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java @@ -90,4 +90,10 @@ public interface WarehouseMappingDataMapper { void updatePackageUpdownStatus(@Param("id") Integer id, @Param("syncStatus") Integer syncStatus); + + List findAllSignfor(); + + void updateClearSignforStatus(@Param("singnforId") Long singnforId, @Param("warehouseId") Long warehouseId, @Param("dealStatus") Integer dealStatus); + } + diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml index a75c435a5..153b29a10 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml @@ -270,4 +270,20 @@ where id = #{id} + + + + + + update clear_singnfor_status_record + set deal_status = #{dealStatus} + where singnfor_id = #{orderPackageCode} + and warehouse_id = #{warehouseId} + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java index f0bf19421..e9298c9ba 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java @@ -19,6 +19,7 @@ package com.logpm.warehouse.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.warehouse.dto.TaskSearchDTO; import com.logpm.warehouse.entity.QuestDetailEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; @@ -131,6 +132,7 @@ public interface WarehouseUpdownGoodsMapper extends BaseMapper getAllocationsByWarehouseIdAndMarketIdAndSku(@Param("mallId") Long mallId, @Param("sku") String sku, @Param("warehouseId") Long warehouseId); + List findParcelListByAllocationIdAndWarehouseId(@Param("allocationId") String allocationId, @Param("warehouseId") Long warehouseId); // /** // * 根据货位查询货物 // * diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml index 800b5f835..0c1a7b6c4 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml @@ -511,5 +511,30 @@ and lwug.association_value = #{sku} and lwug.market_id = #{mallId} + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index 8c40c3db9..1724885ec 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -620,7 +620,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl list = taskQuest.getList(); for (TaskQuestChildEntity taskQuestChildEntity : list) { @@ -671,7 +670,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl 0) { + if (!taskQuest.getList().isEmpty()) { List list = taskQuest.getList(); for (TaskQuestChildEntity taskQuestChildEntity : list) { taskQuestChildEntity.setWarehouseId(id); @@ -1036,7 +1035,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl { List list = new ArrayList<>(); - v.stream().forEach(i -> { + v.forEach(i -> { if (ObjectUtils.isNotNull(i.getQuestId())) { QuestDetailEntity questDetail = new QuestDetailEntity(); BeanUtil.copyProperties(i, questDetail); @@ -1158,16 +1157,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl { - switch (i.getQuestStatus()) { - case 1: - yi.updateAndGet(v1 -> v1 + 1); - q.setQuestStatusName("部分盘点"); - User user = UserCache.getUser(i.getUpdateUser()); - q.setUpdateUser(user.getAccount()); - q.setUpdateTime(i.getUpdateTime()); - break; - } + v.forEach(i -> { + if (i.getQuestStatus() == 1) { + yi.updateAndGet(v1 -> v1 + 1); + q.setQuestStatusName("部分盘点"); + User user = UserCache.getUser(i.getUpdateUser()); + q.setUpdateUser(user.getAccount()); + q.setUpdateTime(i.getUpdateTime()); + } q.setOrderCode(i.getOrderCode()); if (ObjectUtils.isNull(i.getGroundingPositionCode())) { q.setGroundingPositionCode("无更新"); @@ -1335,7 +1332,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl { + questDetailDTO.forEach(i -> { if (i.getStockNum() > 0 || i.getWornNum() > 0 || i.getLossNum() > 0 || i.getNoRepairNum() > 0 || i.getDeliveNum() > 0 || i.getNoReceivedNum() > 0) { //添加 List childList = new ArrayList<>(); @@ -1535,6 +1532,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl lists = new ArrayList<>(); TaskDataVO taskDataVO = new TaskDataVO(); String questNum = taskSearchDTO.getQuestNum(); @@ -1547,7 +1545,22 @@ public class TaskQuestServiceImpl extends BaseServiceImpl questDetailEntities = baseMapper.selectTaskInfo(questNum, questDetail); if (ObjectUtils.isNull(questDetailEntities)) { - return R.success("没有数据!!"); + + // 查询业务系统 这个货位上数据 + List packageDetailList = warehouseUpdownGoodsMapper.findPackageDetailList(taskSearchDTO.getAllocationId(), taskSearchDTO.getWarehouseId()); + + for (PackageListVO packageListVO : packageDetailList) { + + List byPacketBarCode = distributionParcelListClient.findByPacketBarCode(packageListVO.getOrderPackageCode()); + + for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) { + if(distributionParcelListEntity.getWarehouseId().equals(taskSearchDTO.getWarehouseId())){ + QuestDetailEntity questDetailEntity= buildQuestDetailEntity(taskSearchDTO.getQuestId(),distributionParcelListEntity,user,null); + questDetailEntities.add(questDetailEntity); + baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(),questDetailEntities); + } + } + } } List list = new ArrayList<>(); for (QuestDetailEntity questDetailEntity : questDetailEntities) { @@ -1565,13 +1578,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl parcelList = distributionParcelListClient.getParcelList(distributionParcelList); -// if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据 -// continue; -// } } else { //没有 @@ -1666,14 +1672,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl> questDetailMap = questDetailEntityList.stream().collect(Collectors.groupingBy(QuestDetailEntity::getQuestTarget)); //订制品 @@ -1902,7 +1902,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl num = new AtomicReference<>(0); //总数 AtomicReference unTotal = new AtomicReference<>(0); //盘点数 -// List detailVOS = new ArrayList<>(); for (QuestDetailEntity p : v) { taskDataVO.setDataCode(p.getTrayCode()); //托盘ID @@ -1918,11 +1917,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl list = getQuestDetailInfo(taskQuestEntity.getQuestNum()+"_child",questDetailChildEntity); -// if(!list.isEmpty()){ -// int sum = list.stream().filter(i ->i.getCargoName().equals("10")).mapToInt(QuestDetailChildEntity::getQuestNum).sum(); -// -// }else{ -// throw new ServiceException("未找到对应的处理数据!!"); -// } -// } - } - ; taskDataVO.setList(taskPackagelistVOS); -// taskDataVO.setTotal(num.get()); -// taskDataVO.setUnTotal(unTotal.get()); }); return taskDataVO; }