Browse Source

Merge branch 'dev' into pre-production

visual
pref_mail@163.com 6 months ago
parent
commit
5a05bf8815
  1. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java
  2. 16
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java
  3. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  4. 15
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java
  5. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java
  6. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/service/impl/ZbFactoryDataServiceImpl.java

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java

@ -440,7 +440,9 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
basicdataGoodsAllocationEntity.setLayerNum(z); basicdataGoodsAllocationEntity.setLayerNum(z);
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
String allocationCode = basicdataGoodsShelfDTO.getGoodsShelfName() + "排-" + basicdataGoodsAllocationEntity.getLayerNum() + "层-" + basicdataGoodsAllocationEntity.getColumnNum() + "列"; String allocationCode = basicdataGoodsShelfDTO.getGoodsAreaName()+basicdataGoodsShelfDTO.getGoodsShelfName() + basicdataGoodsAllocationEntity.getLayerNum() + "层" + basicdataGoodsAllocationEntity.getColumnNum() + "列";
// String allocationCode = basicdataGoodsShelfDTO.getGoodsShelfName() + "排-" + basicdataGoodsAllocationEntity.getLayerNum() + "层-" + basicdataGoodsAllocationEntity.getColumnNum() + "列";
basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k); basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k);
basicdataGoodsAllocationEntity.setQrCode(allocationCode); basicdataGoodsAllocationEntity.setQrCode(allocationCode);
basicdataGoodsAllocationEntity.setWarehouseId(ck); basicdataGoodsAllocationEntity.setWarehouseId(ck);
@ -460,7 +462,9 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k); basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k);
basicdataGoodsAllocationEntity.setWarehouseId(ck); basicdataGoodsAllocationEntity.setWarehouseId(ck);
// String code = basicTenantCodeClient.shelfCode(AuthUtil.getTenantId(), "5"); // String code = basicTenantCodeClient.shelfCode(AuthUtil.getTenantId(), "5");
String allocationCode = basicdataGoodsShelfDTO.getGoodsShelfName() + "排-" + basicdataGoodsAllocationEntity.getLayerNum() + "层-" + basicdataGoodsAllocationEntity.getColumnNum() + "列"; String allocationCode = basicdataGoodsShelfDTO.getGoodsAreaName()+basicdataGoodsShelfDTO.getGoodsShelfName() + basicdataGoodsAllocationEntity.getLayerNum() + "层" + basicdataGoodsAllocationEntity.getColumnNum() + "列";
// String allocationCode = basicdataGoodsShelfDTO.getGoodsShelfName() + "排-" + basicdataGoodsAllocationEntity.getLayerNum() + "层-" + basicdataGoodsAllocationEntity.getColumnNum() + "列";
basicdataGoodsAllocationEntity.setQrCode(allocationCode); basicdataGoodsAllocationEntity.setQrCode(allocationCode);
arrayList.add(basicdataGoodsAllocationEntity); arrayList.add(basicdataGoodsAllocationEntity);
} }
@ -506,7 +510,9 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
basicdataGoodsAllocationEntity.setGoodsAllocationName(i + "-" + k); basicdataGoodsAllocationEntity.setGoodsAllocationName(i + "-" + k);
basicdataGoodsAllocationEntity.setWarehouseId(ck); basicdataGoodsAllocationEntity.setWarehouseId(ck);
// String code = basicTenantCodeClient.shelfCode(AuthUtil.getTenantId(), "5"); // String code = basicTenantCodeClient.shelfCode(AuthUtil.getTenantId(), "5");
String allocationCode = basicdataGoodsShelfDTO.getGoodsShelfName() + "排-" + basicdataGoodsAllocationEntity.getLayerNum() + "层-" + basicdataGoodsAllocationEntity.getColumnNum() + "列"; String allocationCode = basicdataGoodsShelfDTO.getGoodsAreaName()+basicdataGoodsShelfDTO.getGoodsShelfName() + basicdataGoodsAllocationEntity.getLayerNum() + "层" + basicdataGoodsAllocationEntity.getColumnNum() + "列";
// String allocationCode = basicdataGoodsShelfDTO.getGoodsShelfName() + "排-" + basicdataGoodsAllocationEntity.getLayerNum() + "层-" + basicdataGoodsAllocationEntity.getColumnNum() + "列";
// basicdataGoodsAllocationEntity.setGoodsAllocationName(allocationCode); // basicdataGoodsAllocationEntity.setGoodsAllocationName(allocationCode);
basicdataGoodsAllocationEntity.setQrCode(allocationCode); basicdataGoodsAllocationEntity.setQrCode(allocationCode);
arrayList.add(basicdataGoodsAllocationEntity); arrayList.add(basicdataGoodsAllocationEntity);

16
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java

@ -56,6 +56,16 @@ public class OrderStatusDTO implements Serializable {
@NotEmpty(message = "目的仓库不能为空") @NotEmpty(message = "目的仓库不能为空")
private String destinationWarehouse;//目的仓库 private String destinationWarehouse;//目的仓库
@NotEmpty(message = "当前仓库不能为空")
//当前仓库名称
private String currentWarehouseName;
@NotEmpty(message = "目的仓库不能为空")
//目的仓库名称
private String destinationWarehouseName;
@NotEmpty(message = "状态不能为空") @NotEmpty(message = "状态不能为空")
private String status;//状态 private String status;//状态
@ -71,6 +81,12 @@ public class OrderStatusDTO implements Serializable {
@NotEmpty(message = "操作人名称") @NotEmpty(message = "操作人名称")
private String username; private String username;
@NotEmpty(message = "品牌")
private String brandName;
@NotEmpty(message = "来源 汇通 桃源 世平")
private String sourceName;
/** /**
* 验证参数是否都存在 * 验证参数是否都存在

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -254,15 +254,15 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
} }
String plantId = one.getPlantId(); String plantId = one.getPlantId();
//查询destinationWarehouse logiBillNo plantId数据 //查询destinationWarehouse logiBillNo plantId数据
Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo); // Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo);
//根据仓库ID查询仓库名字 //根据仓库ID查询仓库名字
currentWarehouse = warehouseClient.selectNameById(Integer.parseInt(currentWarehouse)); currentWarehouse = warehouseClient.selectNameById(Integer.parseInt(currentWarehouse));
orderStatusDTO.setPlantId(plantId); orderStatusDTO.setPlantId(plantId);
orderStatusDTO.setCurrentWarehouse(currentWarehouse); orderStatusDTO.setCurrentWarehouse(currentWarehouse);
orderStatusDTO.setDestinationWarehouse(supplyData.get("destinationWarehouse")); orderStatusDTO.setDestinationWarehouse(orderStatusDTO.getDestinationWarehouseName());
orderStatusDTO.setLogiBillNo(supplyData.get("logiBillNo")); orderStatusDTO.setLogiBillNo(orderStatusDTO.getLogiBillNo());
//修改状态映射 //修改状态映射
orderStatusDTO.setStatus(statusName(orderStatusDTO.getStatus())); orderStatusDTO.setStatus(statusName(orderStatusDTO.getStatus()));

15
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java

@ -8,6 +8,7 @@ import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
@ -41,7 +42,7 @@ public class DealWithDataHandler {
@RabbitHandler @RabbitHandler
public void dealWithDataHandler(Map map, Message message, Channel channel) throws IOException { public void dealWithDataHandler(Map map, Message message, Channel channel) throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉 // 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
log.info("##################dealWithDataHandler: 处理在库订单数据到新系统");
OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData"); OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData");
String status = orderStatusDTO.getStatus(); String status = orderStatusDTO.getStatus();
String unitNo = orderStatusDTO.getUnitNo(); String unitNo = orderStatusDTO.getUnitNo();
@ -49,7 +50,17 @@ public class DealWithDataHandler {
Integer trayId = orderStatusDTO.getTrayId(); Integer trayId = orderStatusDTO.getTrayId();
String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id
factoryCommonService.extracted(status, unitNo, currentWarehouseId, operationTime, trayId); String sourceName=orderStatusDTO.getSourceName();
if(StringUtil.isEmpty(sourceName)){
sourceName = "汇通";
}
log.info("##################dealWithDataHandler: 处理在库订单数据到新系统 来源:{} 品牌:{}",sourceName,orderStatusDTO.getBrandName());
if("汇通".equals(orderStatusDTO.getSourceName())){
factoryCommonService.extracted(status, unitNo, currentWarehouseId, operationTime, trayId);
}else{
log.warn(">>>> 不是汇通的数据 不进入汇通入库数据");
}
// extracted(unitNo,currentWarehouseId); // extracted(unitNo,currentWarehouseId);
//extracted(unitNo,currentWarehouseId); //extracted(unitNo,currentWarehouseId);

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

@ -86,19 +86,25 @@ public class OrderStatusHandler {
public void orderStatusHandler(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException { public void orderStatusHandler(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉 // 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
final long deliveryTag = message.getMessageProperties().getDeliveryTag(); final long deliveryTag = message.getMessageProperties().getDeliveryTag();
String msg = new String(message.getBody()); // String msg = new String(message.getBody());
log.info("##################orderStatusHandler: 处理扫码作业数据"); log.info("##################orderStatusHandler: 处理扫码作业数据");
OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData"); OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData");
String orderSelfNum = orderStatusDTO.getOrderNo();//订单自编号 String orderSelfNum = orderStatusDTO.getOrderNo();//订单自编号
String unitNo = orderStatusDTO.getUnitNo(); String unitNo = orderStatusDTO.getUnitNo();
//通过订单自编号去查询该条订单是属于哪个工厂 //通过订单自编号去查询该条订单是属于哪个工厂
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderSelfNum); //
if (Objects.isNull(advanceEntity)) { String type = orderStatusDTO.getBrandName();//品牌
log.info("##################orderStatusHandler: 未找到对应订单 orderNo={}", orderSelfNum);
if (type == null) {
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderSelfNum);
if (Objects.isNull(advanceEntity)) {
log.info("##################orderStatusHandler: 未找到对应订单 orderNo={}", orderSelfNum);
// channel.basicAck(deliveryTag,true); // channel.basicAck(deliveryTag,true);
return; return;
}
type = advanceEntity.getType();
} }
String type = advanceEntity.getType();//品牌
R r = null; R r = null;
switch (type) { switch (type) {
@ -112,7 +118,7 @@ public class OrderStatusHandler {
} }
break; break;
case FactoryConstant.MENGT: case FactoryConstant.MENGT:
if(mtFactoryProperties.getSendEnable()){ if (mtFactoryProperties.getSendEnable()) {
r = mtFactoryDataService.handleStatusData(orderStatusDTO); r = mtFactoryDataService.handleStatusData(orderStatusDTO);
if (r.getCode() == 400 || r.getCode() == 200) { if (r.getCode() == 400 || r.getCode() == 200) {
log.info("TAG {} ##################orderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum); log.info("TAG {} ##################orderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum);

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/service/impl/ZbFactoryDataServiceImpl.java

@ -119,21 +119,21 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService {
} }
//继续判断是否到达目的仓 //继续判断是否到达目的仓
String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id String currentWarehouse = orderStatusDTO.getCurrentWarehouseName();//当前仓
//查询destinationWarehouse logiBillNo plantId数据 //查询destinationWarehouse logiBillNo plantId数据
log.info("handleStatusData >>> unitNo={}",unitNo); log.info("handleStatusData >>> unitNo={}",unitNo);
Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo); // Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo);
if(ObjectUtils.isEmpty(supplyData)){ // if(ObjectUtils.isEmpty(supplyData)){
return Resp.fail(400, "未查询到该单据信息"); // return Resp.fail(400, "未查询到该单据信息");
} // }
String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id String destinationWarehouse = orderStatusDTO.getDestinationWarehouseName();//目的仓
if (StringUtil.isBlank(currentWarehouseId) || StringUtil.isBlank(destinationWarehouseId)) { if (StringUtil.isBlank(currentWarehouse) || StringUtil.isBlank(destinationWarehouse)) {
log.warn("##############handleStatusData: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId); log.warn("##############handleStatusData: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouse, destinationWarehouse);
return Resp.fail(400, "仓库数据有误"); return Resp.fail(400, "仓库数据有误");
} }
if (!currentWarehouseId.equals(destinationWarehouseId)) { if (!currentWarehouse.equals(destinationWarehouse)) {
log.info("##############handleStatusData: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId); log.info("##############handleStatusData: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouse, destinationWarehouse);
return Resp.fail(400, "不是目的仓"); return Resp.fail(400, "不是目的仓");
} }

Loading…
Cancel
Save