Browse Source

fix:修复盘点任务下 盘点库位不同步数据的问题

2.增加新系统签收数据回推老系统测试
dist.1.3.0
pref_mail@163.com 11 months ago
parent
commit
825b16ce4d
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  2. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java
  4. 46
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java
  5. 6
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  6. 16
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  7. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java
  8. 25
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  9. 80
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

2
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) {

1
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

4
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;

46
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<String> pushNotification(String params) {
JSONObject jsonObject = JSONObject.parseObject(params);
String warehouseIds ="";
String reservationCode ="";
if (!jsonObject.isEmpty()){
warehouseIds = jsonObject.getString("warehouseIds");
reservationCode = jsonObject.getString("reservationCode");
// 得到当前仓库所有的签收任务
List<JSONObject> 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;
}

6
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<JSONObject> findAllSignfor();
void updateClearSignforStatus(@Param("singnforId") Long singnforId, @Param("warehouseId") Long warehouseId, @Param("dealStatus") Integer dealStatus);
}

16
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -270,4 +270,20 @@
where id = #{id}
</update>
<select id="findAllSignfor" resultType="cn.hutool.json.JSONObject">
select singnfor_id singnforId,
warehouse_id warehouseId
from clear_singnfor_status_record
where deal_status = 0
</select>
<update id="updateClearSignforStatus" >
update clear_singnfor_status_record
set deal_status = #{dealStatus}
where singnfor_id = #{orderPackageCode}
and warehouse_id = #{warehouseId}
</update>
</mapper>

2
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<WarehouseUpdownGo
List<String> getAllocationsByWarehouseIdAndMarketIdAndSku(@Param("mallId") Long mallId, @Param("sku") String sku, @Param("warehouseId") Long warehouseId);
List<DistributionParcelListEntity> findParcelListByAllocationIdAndWarehouseId(@Param("allocationId") String allocationId, @Param("warehouseId") Long warehouseId);
// /**
// * 根据货位查询货物
// *

25
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}
</select>
<select id="findParcelListByAllocationIdAndWarehouseId"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select ldpl.id,
ldpl.order_code,
ldpl.order_package_code,
ldpl.waybill_number,
ldpl.firsts,
ldpl.second,
ldpl.third_product,
ldpl.material_name,
ldpl.material_code,
ldpl.warehouse_id,
ldpl.warehouse,
ldpl.num,
ldpl.create_time,
ldpl.update_time,
ldpl.create_by,
ldpl.update_by,
ldpl.del_flag,
ldpl.remark
from logpm_distribution_parcel_list ldpl
where ldpl.allocation_id = #{allocationId}
and ldpl.warehouse_id = #{warehouseId}
</select>
</mapper>

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

@ -620,7 +620,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
boolean save = this.save(taskQuest);
// 存入子表 todo 暂时不要商场
if (!taskQuest.getList().isEmpty()) {
List<TaskQuestChildEntity> list = taskQuest.getList();
for (TaskQuestChildEntity taskQuestChildEntity : list) {
@ -671,7 +670,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
.eq(TaskQuestChildEntity::getQuestId, id)
);
//存入子表
if (taskQuest.getList().size() > 0) {
if (!taskQuest.getList().isEmpty()) {
List<TaskQuestChildEntity> list = taskQuest.getList();
for (TaskQuestChildEntity taskQuestChildEntity : list) {
taskQuestChildEntity.setWarehouseId(id);
@ -1036,7 +1035,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailDTO.stream().collect(Collectors.groupingBy(QuestDetailDTO::getQuestNum)).forEach((k, v) -> {
List<QuestDetailEntity> 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<TaskQuestMapper, TaskQ
q.setCustomerName(entityByStockArticle.getCustomerName());
q.setMaterialName(entityByStockArticle.getDescriptionGoods());
v.stream().forEach(i -> {
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<TaskQuestMapper, TaskQ
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtils.isNotNull(questDetailDTO)) {
questDetailDTO.stream().forEach(i -> {
questDetailDTO.forEach(i -> {
if (i.getStockNum() > 0 || i.getWornNum() > 0 || i.getLossNum() > 0 || i.getNoRepairNum() > 0 || i.getDeliveNum() > 0 || i.getNoReceivedNum() > 0) {
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
@ -1535,6 +1532,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
* @return
*/
public R getAllocationInfo(TaskSearchDTO taskSearchDTO) {
BladeUser user = AuthUtil.getUser();
// List<TaskDataVO> lists = new ArrayList<>();
TaskDataVO taskDataVO = new TaskDataVO();
String questNum = taskSearchDTO.getQuestNum();
@ -1547,7 +1545,22 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setAllocationId(code);
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(questNum, questDetail);
if (ObjectUtils.isNull(questDetailEntities)) {
return R.success("没有数据!!");
// 查询业务系统 这个货位上数据
List<PackageListVO> packageDetailList = warehouseUpdownGoodsMapper.findPackageDetailList(taskSearchDTO.getAllocationId(), taskSearchDTO.getWarehouseId());
for (PackageListVO packageListVO : packageDetailList) {
List<DistributionParcelListEntity> 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<TaskPackagelistVO> list = new ArrayList<>();
for (QuestDetailEntity questDetailEntity : questDetailEntities) {
@ -1565,13 +1578,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if (questDetailEntity.getHasData().equals(0)) {
continue;
}
//查询包件信息
// DistributionParcelListEntity distributionParcelList = new DistributionParcelListEntity();
// distributionParcelList.setId(questDetailEntity.getOrderPackageId());
// List<DistributionParcelListEntity> parcelList = distributionParcelListClient.getParcelList(distributionParcelList);
// if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据
// continue;
// }
} else {
//没有
@ -1666,14 +1672,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(),list1);
// return taskPageList.setRecords(list);
questDetailEntityList = list1;
}
}
}
Map<Integer, List<QuestDetailEntity>> questDetailMap = questDetailEntityList.stream().collect(Collectors.groupingBy(QuestDetailEntity::getQuestTarget));
//订制品
@ -1902,7 +1902,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
taskDataVO.setDataId(Long.valueOf(k)); //托盘ID
AtomicReference<Integer> num = new AtomicReference<>(0); //总数
AtomicReference<Integer> unTotal = new AtomicReference<>(0); //盘点数
// List<QuestDetailVO> detailVOS = new ArrayList<>();
for (QuestDetailEntity p : v) {
taskDataVO.setDataCode(p.getTrayCode()); //托盘ID
@ -1918,11 +1917,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if (p.getHasData().equals(0)) {//去除零担数据
continue;
}
//查询包件信息
// DistributionParcelListEntity byPacketBarCode = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(p.getOrderPackageCode(),warehouseId);
// if(ObjectUtils.isNull(byPacketBarCode)){ //去除没有用包件的数据
// continue;
// }
packagelistVO.setQuestDetailId(p.getId());
packagelistVO.setState(String.valueOf(p.getQuestTarget()));
packagelistVO.setOrderPackageCode(p.getOrderPackageCode());
@ -1944,26 +1938,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
packagelistVO.setQuestChildVOList(questDetailChildEntities);
}
taskPackagelistVOS.add(packagelistVO);
// TaskQuestEntity taskQuestEntity = baseMapper.selectById(p.getQuestId());
// num.set(num.get() + p.getStockNum());
// if(p.getQuestStatus().equals(1) && p.getIsNew().equals(0)){
// QuestDetailChildEntity questDetailChildEntity = new QuestDetailChildEntity();
// questDetailChildEntity.setQuestDetailId(p.getId());
// questDetailChildEntity.setWarehouseId(warehouseId);
// List<QuestDetailChildEntity> 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;
}

Loading…
Cancel
Save