23 changed files with 676 additions and 9 deletions
@ -0,0 +1,155 @@
|
||||
package com.logpm.oldproject.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.util.Date; |
||||
|
||||
@Data |
||||
@TableName("ht_order") |
||||
@ApiModel(value = "Order对象", description = "订单信息") |
||||
public class OrderEntity { |
||||
|
||||
@TableId( |
||||
value = "id", |
||||
type = IdType.AUTO |
||||
) |
||||
private Integer id; |
||||
|
||||
private Integer test; |
||||
|
||||
@ApiModelProperty(value = "订单号") |
||||
@TableField("number") |
||||
private String number; |
||||
|
||||
@ApiModelProperty(value = "服务号") |
||||
@TableField("servicenum") |
||||
private String servicenum; |
||||
|
||||
@ApiModelProperty(value = "仓库id") |
||||
@TableField("warehouse_id") |
||||
private Integer warehouseId; |
||||
|
||||
@ApiModelProperty(value = "货区id") |
||||
@TableField("cargo_id") |
||||
private Integer cargoId; |
||||
|
||||
@ApiModelProperty(value = "货架id") |
||||
@TableField("shelf_id") |
||||
private Integer shelfId; |
||||
|
||||
@ApiModelProperty(value = "货位id") |
||||
@TableField("location_id") |
||||
private String locationId; |
||||
|
||||
@ApiModelProperty(value = "订单来源") |
||||
@TableField("source") |
||||
private String source; |
||||
|
||||
@ApiModelProperty(value = "紧急程度:0=正常,1=加急") |
||||
@TableField("emergency") |
||||
private Integer emergency; |
||||
|
||||
@ApiModelProperty(value = "订单自编号") |
||||
@TableField("selfnumber") |
||||
private String selfnumber; |
||||
|
||||
@ApiModelProperty(value = "客户姓名") |
||||
@TableField("contact") |
||||
private String contact; |
||||
|
||||
@ApiModelProperty(value = "联系方式") |
||||
@TableField("phone") |
||||
private String phone; |
||||
|
||||
@ApiModelProperty(value = "收货地址") |
||||
@TableField("address") |
||||
private String address; |
||||
|
||||
@ApiModelProperty(value = "上门提货:0=否,1=是") |
||||
@TableField("door") |
||||
private Integer door; |
||||
|
||||
@ApiModelProperty(value = "总订单数量【未使用】") |
||||
@TableField("total") |
||||
private Integer total; |
||||
|
||||
@ApiModelProperty(value = "付款方式") |
||||
@TableField("payment") |
||||
private String payment; |
||||
|
||||
@ApiModelProperty(value = "入库状态") |
||||
@TableField("status") |
||||
private Integer status; |
||||
|
||||
@ApiModelProperty(value = "入库数量【未使用】") |
||||
@TableField("in_num") |
||||
private Integer inNum; |
||||
|
||||
@ApiModelProperty(value = "装车数量【未使用】") |
||||
@TableField("trans_num") |
||||
private Integer transNum; |
||||
|
||||
@ApiModelProperty(value = "分拣数量【未使用】") |
||||
@TableField("sorting") |
||||
private Integer sorting; |
||||
|
||||
@ApiModelProperty(value = "出库数量【未使用】") |
||||
@TableField("out_num") |
||||
private Integer outNum; |
||||
|
||||
@ApiModelProperty(value = "配送数量【未使用】") |
||||
@TableField("delive_num") |
||||
private Integer deliveNum; |
||||
|
||||
@ApiModelProperty(value = "签收数量【未使用】") |
||||
@TableField("sign_num") |
||||
private Integer signNum; |
||||
|
||||
@ApiModelProperty(value = "创建时间") |
||||
@TableField("create_time") |
||||
private Date createTime; |
||||
|
||||
@ApiModelProperty(value = "修改时间") |
||||
@TableField("update_time") |
||||
private Date updateTime; |
||||
|
||||
@ApiModelProperty(value = "删除时间") |
||||
@TableField("delete_time") |
||||
private Integer deleteTime; |
||||
|
||||
@ApiModelProperty(value = "创建人") |
||||
@TableField("administrators_id") |
||||
private Integer administratorsId; |
||||
|
||||
@ApiModelProperty(value = "是否异常") |
||||
@TableField("abnormal") |
||||
private Integer abnormal; |
||||
|
||||
@ApiModelProperty(value = "寄件人") |
||||
@TableField("sender") |
||||
private String sender; |
||||
|
||||
@ApiModelProperty(value = "寄件人电话") |
||||
@TableField("sender_tel") |
||||
private String senderTel; |
||||
|
||||
@ApiModelProperty(value = "寄件人地址") |
||||
@TableField("sender_address") |
||||
private String senderAddress; |
||||
|
||||
@ApiModelProperty(value = "上架状态:0未上架,1已上架,2部分上架,3已下架") |
||||
@TableField("on_shelf_type") |
||||
private Integer onShelfType; |
||||
|
||||
@ApiModelProperty(value = "旧id") |
||||
@TableField("old_id") |
||||
private Integer oldId; |
||||
|
||||
|
||||
} |
@ -0,0 +1,43 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.oldproject.feign; |
||||
|
||||
import com.logpm.oldproject.entity.OrderEntity; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 订单 Feign接口类 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-06-24 |
||||
*/ |
||||
@FeignClient( |
||||
value = "logpm-old-project" |
||||
) |
||||
public interface IOrderClient { |
||||
|
||||
String API_PREFIX = "/client"; |
||||
|
||||
@GetMapping(API_PREFIX + "/getOrderByOrderSelfNum") |
||||
List<OrderEntity> getOrderByOrderSelfNum(@RequestParam String orderSelfNum); |
||||
|
||||
|
||||
} |
@ -0,0 +1,67 @@
|
||||
package com.logpm.oldproject.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class DistributionParcelListEntityVO { |
||||
|
||||
@ApiModelProperty(value = "仓库") |
||||
private String warehouse; |
||||
/** |
||||
* 状态 |
||||
*/ |
||||
@ApiModelProperty(value = "状态") |
||||
private Integer conditions; |
||||
/** |
||||
* 包条码 |
||||
*/ |
||||
@ApiModelProperty(value = "包条码") |
||||
private String packetBarCode; |
||||
/** |
||||
* 货位信息 |
||||
*/ |
||||
@ApiModelProperty(value = "货位信息") |
||||
private String goodsAllocation; |
||||
/** |
||||
* 所在托盘 |
||||
*/ |
||||
@ApiModelProperty(value = "所在托盘") |
||||
private String pallet; |
||||
/** |
||||
* 一级品 |
||||
*/ |
||||
@ApiModelProperty(value = "一级品") |
||||
private String firsts; |
||||
/** |
||||
* 二级品 |
||||
*/ |
||||
@ApiModelProperty(value = "二级品") |
||||
private String second; |
||||
/** |
||||
* 三级品 |
||||
*/ |
||||
@ApiModelProperty(value = "三级品") |
||||
private String thirdProduct; |
||||
/** |
||||
* 物料 |
||||
*/ |
||||
@ApiModelProperty(value = "物料") |
||||
private String material; |
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ApiModelProperty(value = "数量") |
||||
private Integer quantity; |
||||
/** |
||||
* 车次号 |
||||
*/ |
||||
@ApiModelProperty(value = "车次号") |
||||
private String trainNumber; |
||||
/** |
||||
* 在库订单ID |
||||
*/ |
||||
@ApiModelProperty(value = "在库订单ID") |
||||
private String stockArticleId; |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.logpm.factory.receiver; |
||||
|
||||
import com.logpm.factory.snm.dto.OrderStatusDTO; |
||||
import com.logpm.factory.snm.service.IPanFactoryDataService; |
||||
import com.logpm.oldproject.feign.IAdvanceDetailClient; |
||||
import com.rabbitmq.client.Channel; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.common.constant.RabbitConstant; |
||||
import org.springblade.common.exception.CustomerException; |
||||
import org.springblade.core.tool.utils.StringUtil; |
||||
import org.springframework.amqp.core.Message; |
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler; |
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.io.IOException; |
||||
import java.util.Map; |
||||
|
||||
|
||||
/** |
||||
* 获取订单数据 处理器 |
||||
* |
||||
* @author yangkai.shen |
||||
*/ |
||||
@Slf4j |
||||
@RabbitListener(queues = RabbitConstant.DEAL_WITH_QUEUE) |
||||
@Component |
||||
public class DealWithDataHandler { |
||||
|
||||
@Autowired |
||||
private IAdvanceDetailClient advanceDetailClient; |
||||
@Autowired |
||||
private IPanFactoryDataService panFactoryDataService; |
||||
|
||||
private Integer retryCount = 1; |
||||
|
||||
@RabbitHandler |
||||
public void dealWithDataHandler(Map map, Message message, Channel channel) throws IOException { |
||||
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
|
||||
final long deliveryTag = message.getMessageProperties().getDeliveryTag(); |
||||
log.info("##################我进入这里了 retryCount={}",retryCount++); |
||||
OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData"); |
||||
String status = orderStatusDTO.getStatus(); |
||||
String unitNo = orderStatusDTO.getUnitNo(); |
||||
if("4".equals(status)){ |
||||
//继续判断是否到达目的仓
|
||||
String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id
|
||||
//查询destinationWarehouse logiBillNo plantId数据
|
||||
Map<String,String> supplyData = advanceDetailClient.getSupplyData(unitNo); |
||||
String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id
|
||||
if(StringUtil.isBlank(currentWarehouseId)||StringUtil.isBlank(destinationWarehouseId)){ |
||||
log.warn("##############dealWithDataHandler: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}",currentWarehouseId,destinationWarehouseId); |
||||
throw new CustomerException(405,"仓库数据有误"); |
||||
}else{ |
||||
if(!currentWarehouseId.equals(destinationWarehouseId)){ |
||||
log.info("##############dealWithDataHandler: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}",currentWarehouseId,destinationWarehouseId); |
||||
channel.basicAck(deliveryTag,false); |
||||
}else{ |
||||
//真正的处理需要的数据
|
||||
panFactoryDataService.handleDataToPlatform(unitNo); |
||||
} |
||||
} |
||||
|
||||
}else{ |
||||
log.info("##############dealWithDataHandler: 不用处理的状态 status={}",status); |
||||
channel.basicAck(deliveryTag,false); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,44 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.oldproject.feign; |
||||
|
||||
import com.logpm.oldproject.entity.OrderEntity; |
||||
import com.logpm.oldproject.service.IOrderService; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* order Feign实现类 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-06-24 |
||||
*/ |
||||
@ApiIgnore() |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class OrderClient implements IOrderClient { |
||||
|
||||
private IOrderService orderService; |
||||
|
||||
@Override |
||||
public List<OrderEntity> getOrderByOrderSelfNum(String orderSelfNum) { |
||||
return orderService.getOrderByOrderSelfNum(orderSelfNum); |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.oldproject.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.logpm.oldproject.entity.OrderEntity; |
||||
|
||||
/** |
||||
* 订单 Mapper 接口 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-06-24 |
||||
*/ |
||||
public interface OrderMapper extends BaseMapper<OrderEntity> { |
||||
|
||||
|
||||
} |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.logpm.oldproject.mapper.OrderMapper"> |
||||
|
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,11 @@
|
||||
package com.logpm.oldproject.service; |
||||
|
||||
import com.logpm.oldproject.entity.OrderEntity; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface IOrderService { |
||||
|
||||
List<OrderEntity> getOrderByOrderSelfNum(String orderSelfNum); |
||||
|
||||
} |
@ -0,0 +1,25 @@
|
||||
package com.logpm.oldproject.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.logpm.oldproject.entity.OrderEntity; |
||||
import com.logpm.oldproject.mapper.OrderMapper; |
||||
import com.logpm.oldproject.service.IOrderService; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service |
||||
@AllArgsConstructor |
||||
public class OrderServiceImpl implements IOrderService { |
||||
|
||||
private OrderMapper orderMapper; |
||||
|
||||
@Override |
||||
public List<OrderEntity> getOrderByOrderSelfNum(String orderSelfNum) { |
||||
QueryWrapper<OrderEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("selfnumber",orderSelfNum) |
||||
.orderByAsc("create_time"); |
||||
return orderMapper.selectList(queryWrapper); |
||||
} |
||||
} |
Loading…
Reference in new issue