完善tao电子面单打印;新增面单打印加入备货库;

This commit is contained in:
老齐 2024-06-18 16:01:50 +08:00
parent ede2f2e8fb
commit ea192bade3
23 changed files with 633 additions and 153 deletions

View File

@ -29,6 +29,7 @@
+ [ ] 视频号小店 + [ ] 视频号小店
+ [ ] 接入电子面单打印 + [ ] 接入电子面单打印
+ [x] 淘宝 + [x] 淘宝
+ [ ] 京东
+ [x] 视频号小店 + [x] 视频号小店
+ [ ] 拼多多 + [ ] 拼多多
+ [ ] 抖店 + [ ] 抖店

View File

@ -10,6 +10,11 @@ public class MqMessage {
private int mqType;// 消息类型1订单消息2退款消息 private int mqType;// 消息类型1订单消息2退款消息
private EnumShopType shopType; private EnumShopType shopType;
private String keyId; private String keyId;
private String[] orderIds;
private Long shopId;
private String logisticsCompanyCode;//快递公司编码
private String waybillCode;//运单号
public static MqMessage build(EnumShopType shopType,int mqType , String keyId){ public static MqMessage build(EnumShopType shopType,int mqType , String keyId){
MqMessage result = new MqMessage(); MqMessage result = new MqMessage();
@ -18,4 +23,20 @@ public class MqMessage {
result.setKeyId(keyId); result.setKeyId(keyId);
return result; return result;
} }
public static MqMessage build(Long shopId,String orderId){
MqMessage result = new MqMessage();
result.setShopId(shopId);
result.setKeyId(orderId);
return result;
}
public static MqMessage build(Long shopId,String orderId,String logisticsCompanyCode,String waybillCode){
MqMessage result = new MqMessage();
result.setShopId(shopId);
result.setKeyId(orderId);
result.setLogisticsCompanyCode(logisticsCompanyCode);
result.setWaybillCode(waybillCode);
return result;
}
} }

View File

@ -10,6 +10,20 @@ public class MqType {
*/ */
public static final int REFUND_MESSAGE = 2; public static final int REFUND_MESSAGE = 2;
/**
* 新订单消息
*/
public static final String ORDER_MQ = "ORDER_MQ"; public static final String ORDER_MQ = "ORDER_MQ";
/**
* 新退款消息
*/
public static final String REFUND_MQ = "REFUND_MQ"; public static final String REFUND_MQ = "REFUND_MQ";
/**
* 新备货消息
*/
public static final String SHIP_STOCK_UP_MQ = "SHIP_STOCK_UP_MQ";
/**
* 发货通知
*/
public static final String SHIP_SEND_MQ = "SHIP_SEND_MQ";
} }

View File

@ -11,7 +11,7 @@
Target Server Version : 80032 Target Server Version : 80032
File Encoding : 65001 File Encoding : 65001
Date: 17/06/2024 10:57:02 Date: 18/06/2024 16:00:44
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@ -383,7 +383,7 @@ CREATE TABLE `erp_sale_order` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `order_sn_index`(`order_num`) USING BTREE, UNIQUE INDEX `order_sn_index`(`order_num`) USING BTREE,
INDEX `shopid_index`(`shop_id`) USING BTREE INDEX `shopid_index`(`shop_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1801809140794216449 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1801809140794216449 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for erp_sale_order_item -- Table structure for erp_sale_order_item
@ -425,7 +425,7 @@ CREATE TABLE `erp_sale_order_item` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `goodId_index`(`goods_id`) USING BTREE, INDEX `goodId_index`(`goods_id`) USING BTREE,
INDEX `order_id`(`order_id`) USING BTREE INDEX `order_id`(`order_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1801809144007053315 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '订单明细表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1801809144007053314 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '订单明细表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for erp_ship_logistics -- Table structure for erp_ship_logistics
@ -545,6 +545,32 @@ CREATE TABLE `erp_ship_order_fee` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1786238985318604802 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单发货物流费用' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1786238985318604802 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单发货物流费用' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for erp_ship_stock_up
-- ----------------------------
DROP TABLE IF EXISTS `erp_ship_stock_up`;
CREATE TABLE `erp_ship_stock_up` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`sale_order_id` bigint(0) DEFAULT NULL COMMENT 'erp订单id',
`sale_order_item_id` bigint(0) DEFAULT NULL COMMENT 'erp订单itemid',
`order_num` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单编号',
`original_sku_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '原始订单skuid',
`goods_id` bigint(0) DEFAULT 0 COMMENT 'erp系统商品id',
`spec_id` bigint(0) DEFAULT 0 COMMENT 'erp系统商品规格id',
`goods_title` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品标题',
`goods_img` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品图片',
`goods_spec` varchar(2550) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品规格',
`goods_num` varchar(35) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品编码',
`spec_num` varchar(35) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品规格编码',
`quantity` int(0) NOT NULL COMMENT '商品数量',
`status` int(0) NOT NULL COMMENT '状态0待备货1备货中2已出库3已发货',
`create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
`create_by` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
`update_time` datetime(0) DEFAULT NULL COMMENT '更新时间',
`update_by` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '备货表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for erp_ship_waybill -- Table structure for erp_ship_waybill
-- ---------------------------- -- ----------------------------
@ -563,7 +589,7 @@ CREATE TABLE `erp_ship_waybill` (
`update_time` datetime(0) DEFAULT NULL COMMENT '更新时间', `update_time` datetime(0) DEFAULT NULL COMMENT '更新时间',
`update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人', `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '发货电子面单记录表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1802644906957025282 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '发货电子面单记录表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for oms_dou_goods -- Table structure for oms_dou_goods
@ -1270,7 +1296,7 @@ CREATE TABLE `oms_pdd_waybill_account` (
`phone` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货固定电话', `phone` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货固定电话',
`is_show` int(0) DEFAULT NULL COMMENT '是否前台显示1显示0不显示', `is_show` int(0) DEFAULT NULL COMMENT '是否前台显示1显示0不显示',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '拼多多电子面单账户信息表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '拼多多电子面单账户信息表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for oms_tao_goods -- Table structure for oms_tao_goods
@ -1389,9 +1415,6 @@ CREATE TABLE `oms_tao_order` (
`receiving_time` datetime(0) DEFAULT NULL COMMENT '收货时间,这里返回的是完全收货时间', `receiving_time` datetime(0) DEFAULT NULL COMMENT '收货时间,这里返回的是完全收货时间',
`status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '' COMMENT '交易状态。可选值: * TRADE_NO_CREATE_PAY(没有创建支付宝交易) * WAIT_BUYER_PAY(等待买家付款) * SELLER_CONSIGNED_PART(卖家部分发货) * WAIT_SELLER_SEND_GOODS(等待卖家发货,即:买家已付款) * WAIT_BUYER_CONFIRM_GOODS(等待买家确认收货,即:卖家已发货) * TRADE_BUYER_SIGNED(买家已签收,货到付款专用) * TRADE_FINISHED(交易成功) * TRADE_CLOSED(付款以后用户退款成功,交易自动关闭) * TRADE_CLOSED_BY_TAOBAO(付款以前,卖家或买家主动关闭交易) * PAY_PENDING(国际信用卡支付付款确认中) * WAIT_PRE_AUTH_CONFIRM(0元购合约中) * PAID_FORBID_CONSIGN(拼团中订单或者发货强管控的订单,已付款但禁止发货)', `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '' COMMENT '交易状态。可选值: * TRADE_NO_CREATE_PAY(没有创建支付宝交易) * WAIT_BUYER_PAY(等待买家付款) * SELLER_CONSIGNED_PART(卖家部分发货) * WAIT_SELLER_SEND_GOODS(等待卖家发货,即:买家已付款) * WAIT_BUYER_CONFIRM_GOODS(等待买家确认收货,即:卖家已发货) * TRADE_BUYER_SIGNED(买家已签收,货到付款专用) * TRADE_FINISHED(交易成功) * TRADE_CLOSED(付款以后用户退款成功,交易自动关闭) * TRADE_CLOSED_BY_TAOBAO(付款以前,卖家或买家主动关闭交易) * PAY_PENDING(国际信用卡支付付款确认中) * WAIT_PRE_AUTH_CONFIRM(0元购合约中) * PAID_FORBID_CONSIGN(拼团中订单或者发货强管控的订单,已付款但禁止发货)',
`trade_memo` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '交易备注。', `trade_memo` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '交易备注。',
`erp_send_company` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'erp发货快递公司',
`erp_send_code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'erp发货快递单号',
`erp_send_status` int(0) DEFAULT 0 COMMENT 'erp发货状态',
`create_time` datetime(0) DEFAULT NULL COMMENT '数据库创建时间', `create_time` datetime(0) DEFAULT NULL COMMENT '数据库创建时间',
`update_time` datetime(0) DEFAULT NULL COMMENT '数据库更新时间', `update_time` datetime(0) DEFAULT NULL COMMENT '数据库更新时间',
`update_by` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '数据库更新人', `update_by` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '数据库更新人',
@ -1427,6 +1450,9 @@ CREATE TABLE `oms_tao_order` (
`tmall_coupon_fee` bigint(0) DEFAULT NULL COMMENT '天猫商家使用,订单使用的红包信息', `tmall_coupon_fee` bigint(0) DEFAULT NULL COMMENT '天猫商家使用,订单使用的红包信息',
`audit_status` int(0) DEFAULT NULL COMMENT '订单审核状态0待审核1已审核', `audit_status` int(0) DEFAULT NULL COMMENT '订单审核状态0待审核1已审核',
`audit_time` datetime(0) DEFAULT NULL COMMENT '订单审核时间', `audit_time` datetime(0) DEFAULT NULL COMMENT '订单审核时间',
`erp_send_company` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'erp发货快递公司',
`erp_send_code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'erp发货快递单号',
`erp_send_status` int(0) DEFAULT 0 COMMENT 'erp发货状态1已取号2已打印3已发货10手动发货',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1801155298566070275 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '淘宝订单表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1801155298566070275 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '淘宝订单表' ROW_FORMAT = Dynamic;
@ -1574,7 +1600,7 @@ CREATE TABLE `oms_tao_waybill_account` (
`phone` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货固定电话', `phone` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货固定电话',
`is_show` int(0) DEFAULT NULL COMMENT '是否前台显示1显示0不显示', `is_show` int(0) DEFAULT NULL COMMENT '是否前台显示1显示0不显示',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '淘宝电子面单账户信息表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '淘宝电子面单账户信息表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for oms_wei_goods -- Table structure for oms_wei_goods
@ -2373,7 +2399,7 @@ CREATE TABLE `sys_logininfor` (
PRIMARY KEY (`info_id`) USING BTREE, PRIMARY KEY (`info_id`) USING BTREE,
INDEX `idx_sys_logininfor_s`(`status`) USING BTREE, INDEX `idx_sys_logininfor_s`(`status`) USING BTREE,
INDEX `idx_sys_logininfor_lt`(`login_time`) USING BTREE INDEX `idx_sys_logininfor_lt`(`login_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 304 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统访问记录' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 303 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统访问记录' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for sys_menu -- Table structure for sys_menu

View File

@ -0,0 +1,108 @@
package com.qihang.oms.domain;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
/**
* 备货表
* @TableName erp_ship_stock_up
*/
@Data
public class ErpShipStockUp implements Serializable {
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* erp订单id
*/
private Long saleOrderId;
/**
* erp订单itemid
*/
private Long saleOrderItemId;
/**
* 订单编号
*/
private String orderNum;
/**
* 原始订单skuid
*/
private String originalSkuId;
/**
* erp系统商品id
*/
private Long goodsId;
/**
* erp系统商品规格id
*/
private Long specId;
/**
* 商品标题
*/
private String goodsTitle;
/**
* 商品图片
*/
private String goodsImg;
/**
* 商品规格
*/
private String goodsSpec;
/**
* 商品编码
*/
private String goodsNum;
/**
* 商品规格编码
*/
private String specNum;
/**
* 商品数量
*/
private Integer quantity;
/**
* 状态0待备货1备货中2已出库3已发货
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private String createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新人
*/
private String updateBy;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,18 @@
package com.qihang.oms.mapper;
import com.qihang.oms.domain.ErpShipStockUp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表erp_ship_stock_up(备货表)的数据库操作Mapper
* @createDate 2024-06-18 15:25:18
* @Entity com.qihang.oms.domain.ErpShipStockUp
*/
public interface ErpShipStockUpMapper extends BaseMapper<ErpShipStockUp> {
}

View File

@ -57,4 +57,26 @@ public class KafkaMQConsumer {
public void onRefundMessage(ConsumerRecord<String,Object> message) { public void onRefundMessage(ConsumerRecord<String,Object> message) {
logger.info("收到kafka消息REFUND============"+message.topic()+"====="+message.partition()+"======"+message.value()); logger.info("收到kafka消息REFUND============"+message.topic()+"====="+message.partition()+"======"+message.value());
} }
/**
* 监听备货消息
* @param message
*/
@KafkaListener(topics = {MqType.SHIP_STOCK_UP_MQ})
public void onSHIP_STOCK_UP_MQ(ConsumerRecord<String,Object> message) {
logger.info("收到kafka消息 SHIP_STOCK_UP_MQ ============"+message.topic()+"====="+message.partition()+"======"+message.value());
MqMessage vo = JSON.parseObject(message.value().toString(), MqMessage.class);
orderService.orderShipStockUp(vo.getShopId(),vo.getKeyId());
}
/**
* 监听发货完成消息
* @param message
*/
@KafkaListener(topics = {MqType.SHIP_SEND_MQ})
public void onSHIP_SEND_MQ(ConsumerRecord<String,Object> message) {
logger.info("收到kafka消息 SHIP_SEND_MQ ============"+message.topic()+"====="+message.partition()+"======"+message.value());
MqMessage vo = JSON.parseObject(message.value().toString(), MqMessage.class);
orderService.orderSendConfirm(vo.getShopId(),vo.getKeyId(),vo.getLogisticsCompanyCode(),vo.getWaybillCode());
}
} }

View File

@ -24,4 +24,16 @@ public interface ErpSaleOrderService extends IService<ErpSaleOrder> {
PageResult<ErpSaleOrder> queryPageList(ErpSaleOrder bo, PageQuery pageQuery); PageResult<ErpSaleOrder> queryPageList(ErpSaleOrder bo, PageQuery pageQuery);
ErpSaleOrder queryDetailById(Long id); ErpSaleOrder queryDetailById(Long id);
ResultVo<Integer> orderSendConfirm(Long shopId,String orderId,String logisticsCompanyCode,String waybillCode);
/**
* 订单备货
* @param shopId
* @param orderId
* @param
* @param
* @return
*/
ResultVo<Integer> orderShipStockUp(Long shopId,String orderId);
} }

View File

@ -0,0 +1,13 @@
package com.qihang.oms.service;
import com.qihang.oms.domain.ErpShipStockUp;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表erp_ship_stock_up(备货表)的数据库操作Service
* @createDate 2024-06-18 15:25:18
*/
public interface ErpShipStockUpService extends IService<ErpShipStockUp> {
}

View File

@ -54,6 +54,8 @@ public class ErpSaleOrderServiceImpl extends ServiceImpl<ErpSaleOrderMapper, Erp
private final OmsWeiOrderItemMapper weiOrderItemMapper; private final OmsWeiOrderItemMapper weiOrderItemMapper;
private final OmsWeiGoodsSkuMapper weiGoodsSkuMapper; private final OmsWeiGoodsSkuMapper weiGoodsSkuMapper;
// 备货
private final ErpShipStockUpMapper shipStockUpMapper;
@Transactional @Transactional
@Override @Override
@ -856,6 +858,81 @@ public class ErpSaleOrderServiceImpl extends ServiceImpl<ErpSaleOrderMapper, Erp
} }
return erpSaleOrder; return erpSaleOrder;
} }
@Transactional
@Override
public ResultVo<Integer> orderSendConfirm(Long shopId, String orderId,String logisticsCompanyCode,String waybillCode) {
List<ErpSaleOrder> erpSaleOrders = orderMapper.selectList(new LambdaQueryWrapper<ErpSaleOrder>().eq(ErpSaleOrder::getShopId, shopId).eq(ErpSaleOrder::getOrderNum, orderId));
if(erpSaleOrders!=null && erpSaleOrders.size()>0){
// 更新erp sale order 订单表发货状态
if(erpSaleOrders.get(0).getShipStatus()!=3){
//2是已发货
ErpSaleOrder update = new ErpSaleOrder();
update.setId(erpSaleOrders.get(0).getId());
update.setOrderStatus(2);
update.setShippingCompany(logisticsCompanyCode);
update.setShippingNumber(waybillCode);
update.setShippingCost(BigDecimal.ZERO);
update.setShippingMan("消息通知发货完成");
update.setShippingTime(new Date());
update.setShipStatus(3);
update.setUpdateTime(new Date());
update.setUpdateBy("消息通知发货完成");
orderMapper.updateById(update);
}
// 更新备货表相关订单状态erp_ship_stock_up
ErpShipStockUp shipStockUp = new ErpShipStockUp();
shipStockUp.setUpdateBy("消息通知发货完成");
shipStockUp.setUpdateTime(new Date());
shipStockUp.setStatus(3);//状态0待备货1备货中2已出库3已发货
shipStockUpMapper.update(shipStockUp,new LambdaQueryWrapper<ErpShipStockUp>().eq(ErpShipStockUp::getSaleOrderId,erpSaleOrders.get(0).getId()));
}
return ResultVo.success();
}
/**
* 订单备货
*
* @param shopId
* @param orderId
* @return
*/
@Override
public ResultVo<Integer> orderShipStockUp(Long shopId, String orderId) {
List<ErpSaleOrder> erpSaleOrders = orderMapper.selectList(new LambdaQueryWrapper<ErpSaleOrder>().eq(ErpSaleOrder::getShopId, shopId).eq(ErpSaleOrder::getOrderNum, orderId));
if(erpSaleOrders!=null && erpSaleOrders.size()>0){
// 查处item
List<ErpSaleOrderItem> items = orderItemMapper.selectList(new LambdaQueryWrapper<ErpSaleOrderItem>().eq(ErpSaleOrderItem::getOrderId, erpSaleOrders.get(0).getId()));
if(items!=null&& items.size()>0){
for (var item:items) {
List<ErpShipStockUp> erpShipStockUps = shipStockUpMapper.selectList(new LambdaQueryWrapper<ErpShipStockUp>().eq(ErpShipStockUp::getSaleOrderItemId, item.getId()));
if(erpShipStockUps==null || erpShipStockUps.size()==0) {
ErpShipStockUp shipStockUp = new ErpShipStockUp();
shipStockUp.setSaleOrderId(item.getOrderId());
shipStockUp.setSaleOrderItemId(item.getId());
shipStockUp.setOrderNum(erpSaleOrders.get(0).getOrderNum());
shipStockUp.setOriginalSkuId(item.getOriginalSkuId());
shipStockUp.setGoodsId(item.getGoodsId());
shipStockUp.setSpecId(item.getSpecId());
shipStockUp.setGoodsTitle(item.getGoodsTitle());
shipStockUp.setGoodsImg(item.getGoodsImg());
shipStockUp.setGoodsSpec(item.getGoodsSpec());
shipStockUp.setGoodsNum(item.getGoodsNum());
shipStockUp.setSpecNum(item.getSpecNum());
shipStockUp.setQuantity(item.getQuantity());
shipStockUp.setStatus(0);//状态0待备货1备货中2已出库3已发货
shipStockUp.setCreateBy("消息通知备货");
shipStockUp.setCreateTime(new Date());
shipStockUpMapper.insert(shipStockUp);
}
}
}
}
return ResultVo.success();
}
} }

View File

@ -0,0 +1,22 @@
package com.qihang.oms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.oms.domain.ErpShipStockUp;
import com.qihang.oms.service.ErpShipStockUpService;
import com.qihang.oms.mapper.ErpShipStockUpMapper;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表erp_ship_stock_up(备货表)的数据库操作Service实现
* @createDate 2024-06-18 15:25:18
*/
@Service
public class ErpShipStockUpServiceImpl extends ServiceImpl<ErpShipStockUpMapper, ErpShipStockUp>
implements ErpShipStockUpService{
}

View File

@ -0,0 +1,36 @@
<?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.qihang.oms.mapper.ErpShipStockUpMapper">
<resultMap id="BaseResultMap" type="com.qihang.oms.domain.ErpShipStockUp">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="saleOrderId" column="sale_order_id" jdbcType="BIGINT"/>
<result property="saleOrderItemId" column="sale_order_item_id" jdbcType="BIGINT"/>
<result property="orderNum" column="order_num" jdbcType="VARCHAR"/>
<result property="originalSkuId" column="original_sku_id" jdbcType="VARCHAR"/>
<result property="goodsId" column="goods_id" jdbcType="BIGINT"/>
<result property="specId" column="spec_id" jdbcType="BIGINT"/>
<result property="goodsTitle" column="goods_title" jdbcType="VARCHAR"/>
<result property="goodsImg" column="goods_img" jdbcType="VARCHAR"/>
<result property="goodsSpec" column="goods_spec" jdbcType="VARCHAR"/>
<result property="goodsNum" column="goods_num" jdbcType="VARCHAR"/>
<result property="specNum" column="spec_num" jdbcType="VARCHAR"/>
<result property="quantity" column="quantity" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,sale_order_id,sale_order_item_id,
order_num,original_sku_id,goods_id,
spec_id,goods_title,goods_img,
goods_spec,goods_num,spec_num,
quantity,status,create_time,
create_by,update_time,update_by
</sql>
</mapper>

Binary file not shown.

View File

@ -1,45 +1,45 @@
package com.qihang.jd.task; //package com.qihang.jd.task;
//
import com.qihang.common.task.SchedulingConfiguration; //import com.qihang.common.task.SchedulingConfiguration;
import lombok.extern.java.Log; //import lombok.extern.java.Log;
import org.springframework.boot.ApplicationArguments; //import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; //import org.springframework.boot.ApplicationRunner;
import org.springframework.scheduling.annotation.Scheduled; //import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
import java.util.concurrent.atomic.AtomicBoolean; //import java.util.concurrent.atomic.AtomicBoolean;
@Log //@Log
@Component //@Component
public class CronTaskLoader implements ApplicationRunner { //public class CronTaskLoader implements ApplicationRunner {
// private static final Logger log = LoggerFactory.getLogger(CronTaskLoader.class); //// private static final Logger log = LoggerFactory.getLogger(CronTaskLoader.class);
private final SchedulingConfiguration schedulingConfiguration; // private final SchedulingConfiguration schedulingConfiguration;
private final AtomicBoolean appStarted = new AtomicBoolean(false); // private final AtomicBoolean appStarted = new AtomicBoolean(false);
private final AtomicBoolean initializing = new AtomicBoolean(false); // private final AtomicBoolean initializing = new AtomicBoolean(false);
//
public CronTaskLoader(SchedulingConfiguration schedulingConfiguration) { // public CronTaskLoader(SchedulingConfiguration schedulingConfiguration) {
this.schedulingConfiguration = schedulingConfiguration; // this.schedulingConfiguration = schedulingConfiguration;
} // }
//
/** // /**
* 定时任务配置刷新(10分钟刷新一次) // * 定时任务配置刷新(10分钟刷新一次)
*/ // */
@Scheduled(fixedDelay = 600000) // @Scheduled(fixedDelay = 600000)
public void cronTaskConfigRefresh() { // public void cronTaskConfigRefresh() {
if (appStarted.get() && initializing.compareAndSet(false, true)) { // if (appStarted.get() && initializing.compareAndSet(false, true)) {
log.info("定时调度任务动态加载开始>>>JD>>>"); // log.info("定时调度任务动态加载开始>>>JD>>>");
try { // try {
schedulingConfiguration.refresh(); // schedulingConfiguration.refresh();
} finally { // } finally {
initializing.set(false); // initializing.set(false);
} // }
// log.info("定时调度任务动态加载结束<<<<<<"); //// log.info("定时调度任务动态加载结束<<<<<<");
} // }
} // }
//
@Override // @Override
public void run(ApplicationArguments args) { // public void run(ApplicationArguments args) {
if (appStarted.compareAndSet(false, true)) { // if (appStarted.compareAndSet(false, true)) {
cronTaskConfigRefresh(); // cronTaskConfigRefresh();
} // }
} // }
} //}

View File

@ -1,30 +1,30 @@
package com.qihang.jd.task; //package com.qihang.jd.task;
//
import com.qihang.common.task.IPollableService; //import com.qihang.common.task.IPollableService;
import com.qihang.jd.domain.SysTask; //import com.qihang.jd.domain.SysTask;
import com.qihang.jd.service.SysTaskService; //import com.qihang.jd.service.SysTaskService;
//
import lombok.AllArgsConstructor; //import lombok.AllArgsConstructor;
import lombok.extern.java.Log; //import lombok.extern.java.Log;
import org.springframework.stereotype.Service; //import org.springframework.stereotype.Service;
//
import java.time.LocalDateTime; //import java.time.LocalDateTime;
@Log //@Log
@AllArgsConstructor //@AllArgsConstructor
@Service //@Service
public class OrderTask implements IPollableService { //public class OrderTask implements IPollableService {
//
private final SysTaskService taskService; // private final SysTaskService taskService;
@Override // @Override
public void poll() { // public void poll() {
log.info("=======自动任务==JD===拉取订单========="+ LocalDateTime.now()); // log.info("=======自动任务==JD===拉取订单========="+ LocalDateTime.now());
// System.out.printf("更新JD订单%s","echo"); //// System.out.printf("更新JD订单%s","echo");
} // }
//
@Override // @Override
public String getCronExpression() { // public String getCronExpression() {
SysTask task = taskService.getById(2); // SysTask task = taskService.getById(2);
// return "0/1 * * * * ?"; //// return "0/1 * * * * ?";
return task.getCron(); // return task.getCron();
} // }
} //}

View File

@ -29,6 +29,7 @@ import com.qihang.tao.service.OmsTaoOrderService;
import com.qihang.tao.service.OmsTaoWaybillAccountService; import com.qihang.tao.service.OmsTaoWaybillAccountService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.java.Log; import lombok.extern.java.Log;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -45,6 +46,7 @@ public class EwaybillController extends BaseController {
private final OmsTaoWaybillAccountService waybillAccountService; private final OmsTaoWaybillAccountService waybillAccountService;
private final OmsTaoOrderService orderService; private final OmsTaoOrderService orderService;
private final ErpShipWaybillService erpShipWaybillService; private final ErpShipWaybillService erpShipWaybillService;
private final KafkaTemplate<String,Object> kafkaTemplate;
@RequestMapping(value = "/get_waybill_account_list", method = RequestMethod.POST) @RequestMapping(value = "/get_waybill_account_list", method = RequestMethod.POST)
public AjaxResult getWaybillAccountList(@RequestBody TaoRequest params) throws Exception { public AjaxResult getWaybillAccountList(@RequestBody TaoRequest params) throws Exception {
@ -208,6 +210,7 @@ public class EwaybillController extends BaseController {
waybill.setWaybillCode(result.getWaybillCode()); waybill.setWaybillCode(result.getWaybillCode());
waybill.setLogisticsCode(result.getCpCode()); waybill.setLogisticsCode(result.getCpCode());
waybill.setPrintData(result.getPrintData()); waybill.setPrintData(result.getPrintData());
waybill.setStatus(1);//1已取号
erpShipWaybillService.waybillUpdate(waybill); erpShipWaybillService.waybillUpdate(waybill);
log.info("====保存電子面單信息========"+result.getObjectId()); log.info("====保存電子面單信息========"+result.getObjectId());
} }
@ -241,6 +244,26 @@ public class EwaybillController extends BaseController {
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有选择订单"); return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有选择订单");
} }
erpShipWaybillService.printSuccess(req.getShopId(), req.getIds()); erpShipWaybillService.printSuccess(req.getShopId(), req.getIds());
return AjaxResult.success();
}
/**
* 发货
* @param req
* @return
*/
@PostMapping("/push_ship_send")
@ResponseBody
public AjaxResult pushShipSend(@RequestBody TaoWaybillGetBo req) {
if (req.getShopId() == null || req.getShopId() <= 0) {
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误没有店铺Id");
}
if (req.getIds() == null || req.getIds().length <= 0) {
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有选择订单");
}
erpShipWaybillService.pushShipSend(req.getShopId(), req.getIds());
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@ -16,4 +16,5 @@ public interface ErpShipWaybillService extends IService<ErpShipWaybill> {
List<ErpShipWaybill> getListByOrderIds(Long shopId,String[] orderIds); List<ErpShipWaybill> getListByOrderIds(Long shopId,String[] orderIds);
ResultVo<Integer> printSuccess(Long shopId,String[] orderIds); ResultVo<Integer> printSuccess(Long shopId,String[] orderIds);
ResultVo<Integer> pushShipSend(Long shopId,String[] orderIds);
} }

View File

@ -1,15 +1,19 @@
package com.qihang.tao.service.impl; package com.qihang.tao.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.common.common.ResultVo; import com.qihang.common.common.ResultVo;
import com.qihang.common.enums.EnumShopType; import com.qihang.common.enums.EnumShopType;
import com.qihang.common.mq.MqMessage;
import com.qihang.common.mq.MqType;
import com.qihang.tao.domain.ErpShipWaybill; import com.qihang.tao.domain.ErpShipWaybill;
import com.qihang.tao.domain.OmsTaoOrder; import com.qihang.tao.domain.OmsTaoOrder;
import com.qihang.tao.mapper.OmsTaoOrderMapper; import com.qihang.tao.mapper.OmsTaoOrderMapper;
import com.qihang.tao.service.ErpShipWaybillService; import com.qihang.tao.service.ErpShipWaybillService;
import com.qihang.tao.mapper.ErpShipWaybillMapper; import com.qihang.tao.mapper.ErpShipWaybillMapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -28,6 +32,7 @@ public class ErpShipWaybillServiceImpl extends ServiceImpl<ErpShipWaybillMapper,
implements ErpShipWaybillService{ implements ErpShipWaybillService{
private final ErpShipWaybillMapper mapper; private final ErpShipWaybillMapper mapper;
private final OmsTaoOrderMapper orderMapper; private final OmsTaoOrderMapper orderMapper;
private final KafkaTemplate<String,Object> kafkaTemplate;
/** /**
* 更新电子面单信息 * 更新电子面单信息
@ -94,6 +99,7 @@ public class ErpShipWaybillServiceImpl extends ServiceImpl<ErpShipWaybillMapper,
.in(ErpShipWaybill::getOrderId, Arrays.stream(orderIds).toList())); .in(ErpShipWaybill::getOrderId, Arrays.stream(orderIds).toList()));
if(erpShipWaybills!=null){ if(erpShipWaybills!=null){
for (var w : erpShipWaybills){ for (var w : erpShipWaybills){
if(w.getStatus()==1) {
ErpShipWaybill update = new ErpShipWaybill(); ErpShipWaybill update = new ErpShipWaybill();
update.setId(erpShipWaybills.get(0).getId()); update.setId(erpShipWaybills.get(0).getId());
update.setStatus(2); update.setStatus(2);
@ -105,13 +111,45 @@ public class ErpShipWaybillServiceImpl extends ServiceImpl<ErpShipWaybillMapper,
OmsTaoOrder orderUpdate = new OmsTaoOrder(); OmsTaoOrder orderUpdate = new OmsTaoOrder();
orderUpdate.setErpSendStatus(update.getStatus()); orderUpdate.setErpSendStatus(update.getStatus());
orderMapper.update(orderUpdate,new LambdaQueryWrapper<OmsTaoOrder>().eq(OmsTaoOrder::getTid,w.getOrderId())); orderMapper.update(orderUpdate, new LambdaQueryWrapper<OmsTaoOrder>().eq(OmsTaoOrder::getTid, w.getOrderId()));
//TODO: 打印成功之后 加入备货清单 //TODO: 打印成功之后 加入备货清单 采用kafka推送消息处理
// 打印完成通知备货
kafkaTemplate.send(MqType.SHIP_STOCK_UP_MQ, JSONObject.toJSONString(MqMessage.build(w.getShopId(), w.getOrderId())));
}
}
}
return ResultVo.success();
}
@Transactional
@Override
public ResultVo<Integer> pushShipSend(Long shopId, String[] orderIds) {
List<ErpShipWaybill> erpShipWaybills = mapper.selectList(
new LambdaQueryWrapper<ErpShipWaybill>()
.eq(ErpShipWaybill::getShopId,shopId)
.in(ErpShipWaybill::getOrderId, Arrays.stream(orderIds).toList()));
if(erpShipWaybills!=null){
for (var w : erpShipWaybills){
if(w.getStatus() > 0 && w.getStatus()<3) {
ErpShipWaybill update = new ErpShipWaybill();
update.setId(erpShipWaybills.get(0).getId());
update.setStatus(3);// 已发货
update.setUpdateTime(new Date());
update.setUpdateBy("电子面单发货");
mapper.updateById(update);
// 更新关联订单erp_send_status状态
OmsTaoOrder orderUpdate = new OmsTaoOrder();
orderUpdate.setErpSendStatus(update.getStatus());
orderMapper.update(orderUpdate, new LambdaQueryWrapper<OmsTaoOrder>().eq(OmsTaoOrder::getTid, w.getOrderId()));
// 更新erp_sale_order发货状态(controller层采用kafka推送消息处理)
// 发货完成通知发货出库
kafkaTemplate.send(MqType.SHIP_SEND_MQ, JSONObject.toJSONString(MqMessage.build(w.getShopId(),w.getOrderId(),w.getLogisticsCode(),w.getWaybillCode())));
}
} }
} }
return ResultVo.success(); return ResultVo.success();

View File

@ -44,3 +44,12 @@ export function pushWaybillPrintSuccess(data) {
data: data data: data
}) })
} }
export function pushShipSend(data) {
return request({
url: '/api/tao-api/ewaybill/push_ship_send',
method: 'post',
data: data
})
}

View File

@ -5,7 +5,7 @@
<print-tao></print-tao> <print-tao></print-tao>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="京东POP" name="printJd" lazy> <el-tab-pane label="京东POP" name="printJd" lazy>
<el-col style="color:red">京东POP电子面单打印暂不支持</el-col> <print-jd></print-jd>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="拼多多" name="printPdd" lazy> <el-tab-pane label="拼多多" name="printPdd" lazy>
<print-pdd></print-pdd> <print-pdd></print-pdd>
@ -27,11 +27,12 @@ import printWei from "@/views/shop/wei/ewaybill/index.vue";
import printTao from "@/views/shop/tao/ewaybill/index.vue"; import printTao from "@/views/shop/tao/ewaybill/index.vue";
import printPdd from "@/views/shop/pdd/ewaybill/index.vue"; import printPdd from "@/views/shop/pdd/ewaybill/index.vue";
import printDou from "@/views/shop/dou/ewaybill/index.vue"; import printDou from "@/views/shop/dou/ewaybill/index.vue";
import PrintJd from "@/views/shop/jd/ewaybill/index.vue";
export default { export default {
name: "print", name: "print",
components:{printWei,printTao,printPdd,printDou}, components:{PrintJd, printWei,printTao,printPdd,printDou},
data() { data() {
return { return {
activeName: 'printTao' activeName: 'printTao'

View File

@ -2,9 +2,9 @@
<div class="app-container"> <div class="app-container">
<el-row> <el-row>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="订单号" prop="orderId"> <el-form-item label="订单号" prop="tid">
<el-input <el-input
v-model="queryParams.orderSn" v-model="queryParams.tid"
placeholder="请输入订单号" placeholder="请输入订单号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -41,7 +41,6 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
@ -50,7 +49,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleGetEwaybillCode" @click="handleGetEwaybillCode"
>取号</el-button> >电子面单取号</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -62,7 +61,7 @@
icon="el-icon-printer" icon="el-icon-printer"
size="mini" size="mini"
@click="handlePrintEwaybill" @click="handlePrintEwaybill"
>打印电子面单</el-button> >电子面单打印</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -72,7 +71,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleShipSend" @click="handleShipSend"
>发货</el-button> >电子面单发货</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -80,20 +79,20 @@
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="ID" align="center" prop="id" />--> <!-- <el-table-column label="ID" align="center" prop="id" />-->
<el-table-column label="订单号" align="center" prop="orderId" > <el-table-column label="订单号" align="left" prop="tid" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.orderSn}}</p> <p>{{scope.row.tid}}</p>
<el-tag effect="plain">{{shopList.find(x=>x.id === scope.row.shopId).name}}</el-tag> <el-tag effect="plain">{{shopList.find(x=>x.id === scope.row.shopId).name}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品" width="450"> <el-table-column label="商品" width="550">
<template slot-scope="scope"> <template slot-scope="scope">
<el-table :data="scope.row.itemList" :show-header="false"> <el-table :data="scope.row.items" :show-header="false">
<el-table-column label="商品" align="center" prop="outerId" /> <el-table-column label="商品" align="center" prop="title" />
<el-table-column label="规格" align="center" prop="goodsSpec" /> <el-table-column label="规格" align="center" prop="skuPropertiesName" />
<el-table-column label="数量" align="center" prop="goodsCount" width="60"> <el-table-column label="数量" align="center" prop="num" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="small">x {{scope.row.goodsCount}}</el-tag> <el-tag size="small">x {{scope.row.num}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -114,11 +113,17 @@
</el-table-column> </el-table-column>
<el-table-column label="下单时间" align="center" prop="orderCreateTime" width="180"> <el-table-column label="下单时间" align="center" prop="orderCreateTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime) }}</span> <span>{{ parseTime(scope.row.created) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="买家留言" align="center" prop="buyerMemo" /> <el-table-column label="备注" align="center" prop="buyerMessage" >
<el-table-column label="备注" align="center" prop="remark" /> <template slot-scope="scope">
<span v-if="scope.row.buyerMessage">买家留言:{{ scope.row.buyerMessage }}</span>
<span v-if="scope.row.sellerMemo">卖家备注:{{ scope.row.sellerMemo }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="买家留言" align="center" prop="buyerMessage" />-->
<!-- <el-table-column label="卖家备注" align="center" prop="sellerMemo" />-->
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >--> <!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
@ -128,18 +133,27 @@
<el-table-column label="收件信息" align="left" prop="receiverState" > <el-table-column label="收件信息" align="left" prop="receiverState" >
<template slot-scope="scope"> <template slot-scope="scope">
<p> <div>
{{scope.row.receiverNameMask}}&nbsp;{{scope.row.receiverPhoneMask}} {{scope.row.receiverName}}&nbsp;{{scope.row.receiverMobile}}
</p> </div>
<p> <div>
{{scope.row.province}} &nbsp;{{scope.row.city}}&nbsp;{{scope.row.town}}&nbsp; {{scope.row.receiverState}} &nbsp;{{scope.row.receiverCity}}&nbsp;{{scope.row.receiverDistrict}}&nbsp;{{scope.row.receiverTown}}
</p> </div>
<p> <div>
{{scope.row.receiverAddressMask}} {{scope.row.receiverAddress}}
</p> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="面单号" align="center" prop="erpSendCode" /> <el-table-column label="面单号" align="center" prop="erpSendCode" />
<el-table-column label="状态" align="center" prop="erpSendStatus" >
<template slot-scope="scope">
<el-tag size="small" v-if="scope.row.erpSendStatus==0">未取号</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==1">已取号</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==2">已打印</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==3">已发货</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==10">手动发货</el-tag>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -179,17 +193,17 @@
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {listShop} from "@/api/shop/shop"; import {listShop} from "@/api/shop/shop";
import {listOrder} from "@/api/pdd/order"; import {listOrder} from "@/api/tao/order";
import { import {
getWaybillAccountList, getWaybillAccountList,
pullWaybillAccount, pullWaybillAccount,
getWaybillCode, getWaybillCode,
getWaybillPrintData, getWaybillPrintData,
pushWaybillPrintSuccess pushWaybillPrintSuccess, pushShipSend
} from "@/api/pdd/ewaybill"; } from "@/api/tao/ewaybill";
export default { export default {
name: "printDou", name: "printJd",
data() { data() {
return { return {
// //
@ -213,9 +227,8 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderStatus: 1, status: 'WAIT_SELLER_SEND_GOODS',
refundStatus: 1, erpSendStatus:null,
erpSendStatus:0,
shopId: null shopId: null
}, },
// //
@ -236,7 +249,7 @@ export default {
}, },
created() { created() {
this.openWs() this.openWs()
listShop({platform: 5}).then(response => { listShop({platform: 4}).then(response => {
this.shopList = response.rows; this.shopList = response.rows;
if (this.shopList && this.shopList.length > 0) { if (this.shopList && this.shopList.length > 0) {
this.queryParams.shopId = this.shopList[0].id this.queryParams.shopId = this.shopList[0].id
@ -279,17 +292,17 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.orderSn) this.ids = selection.map(item => item.tid)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
openWs() { openWs() {
const ws = new WebSocket('ws://127.0.0.1:9113'); const ws = new WebSocket('ws://127.0.0.1:13528');
ws.onopen = () => { ws.onopen = () => {
console.log('与打印组件建立连接成功: '); console.log('与打印组件建立连接成功: ');
// //
ws.send(JSON.stringify({ ws.send(JSON.stringify({
requestID: '1234554', requestID: '12345',
cmd: 'getPrinters', cmd: 'getPrinters',
"version": "1.0" "version": "1.0"
})) }))
@ -305,7 +318,7 @@ export default {
}; };
// //
ws.onerror = function (error) { ws.onerror = function (error) {
obj.msgError("打印组件连接失败!请安装并启动字节打印组件!"); obj.msgError("打印组件连接失败!请安装并启动菜鸟云打印组件!");
console.error('WebSocket error:', error); console.error('WebSocket error:', error);
// alert('WebSocket error occurred. Check the console for more details.'); // alert('WebSocket error occurred. Check the console for more details.');
}; };
@ -362,13 +375,14 @@ export default {
// } // }
if (!this.printParams.printer) { if (!this.printParams.printer) {
this.$modal.msgError('请选择打印机!'); this.$modal.msgError('请选择打印机!');
return pushWaybillPrintSuccess({shopId: this.queryParams.shopId, ids: this.ids})
return return
} }
const ids = this.ids; const ids = this.ids;
getWaybillPrintData({shopId: this.queryParams.shopId, ids: ids}).then(response => { getWaybillPrintData({shopId: this.queryParams.shopId, ids: ids}).then(response => {
console.log("======打印======", response.data) console.log("======打印======", response.data)
if (response.data) { if (response.data) {
const ws = new WebSocket('ws://127.0.0.1:9113'); const ws = new WebSocket('ws://127.0.0.1:13528');
ws.onopen = () => { ws.onopen = () => {
let printData = [] let printData = []
response.data.forEach(x => printData.push(JSON.parse(x.printData))) response.data.forEach(x => printData.push(JSON.parse(x.printData)))
@ -416,7 +430,11 @@ export default {
}, },
handleShipSend(){ handleShipSend(){
this.$modal.msgError("开源版本未实现平台发货!请自行对接发货"); // this.$modal.msgError("");
pushShipSend({shopId: this.queryParams.shopId, ids: ids}).then(response => {
this.$modal.msgSuccess("发货成功!");
this.getList()
})
}, },
getUUID(len, radix) { getUUID(len, radix) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');

View File

@ -49,7 +49,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleGetEwaybillCode" @click="handleGetEwaybillCode"
>取号</el-button> >电子面单取号</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -61,7 +61,7 @@
icon="el-icon-printer" icon="el-icon-printer"
size="mini" size="mini"
@click="handlePrintEwaybill" @click="handlePrintEwaybill"
>打印电子面单</el-button> >电子面单打印</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -71,7 +71,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleShipSend" @click="handleShipSend"
>发货</el-button> >电子面单发货</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -79,7 +79,7 @@
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="ID" align="center" prop="id" />--> <!-- <el-table-column label="ID" align="center" prop="id" />-->
<el-table-column label="订单号" align="center" prop="tid" > <el-table-column label="订单号" align="left" prop="tid" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.tid}}</p> <p>{{scope.row.tid}}</p>
<el-tag effect="plain">{{shopList.find(x=>x.id === scope.row.shopId).name}}</el-tag> <el-tag effect="plain">{{shopList.find(x=>x.id === scope.row.shopId).name}}</el-tag>
@ -116,8 +116,14 @@
<span>{{ parseTime(scope.row.created) }}</span> <span>{{ parseTime(scope.row.created) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="买家留言" align="center" prop="buyerMessage" /> <el-table-column label="备注" align="center" prop="buyerMessage" >
<el-table-column label="卖家备注" align="center" prop="sellerMemo" /> <template slot-scope="scope">
<span v-if="scope.row.buyerMessage">买家留言:{{ scope.row.buyerMessage }}</span>
<span v-if="scope.row.sellerMemo">卖家备注:{{ scope.row.sellerMemo }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="买家留言" align="center" prop="buyerMessage" />-->
<!-- <el-table-column label="卖家备注" align="center" prop="sellerMemo" />-->
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >--> <!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
@ -127,18 +133,27 @@
<el-table-column label="收件信息" align="left" prop="receiverState" > <el-table-column label="收件信息" align="left" prop="receiverState" >
<template slot-scope="scope"> <template slot-scope="scope">
<p> <div>
{{scope.row.receiverName}}&nbsp;{{scope.row.receiverMobile}} {{scope.row.receiverName}}&nbsp;{{scope.row.receiverMobile}}
</p> </div>
<p> <div>
{{scope.row.receiverState}} &nbsp;{{scope.row.receiverCity}}&nbsp;{{scope.row.receiverDistrict}}&nbsp;{{scope.row.receiverTown}} {{scope.row.receiverState}} &nbsp;{{scope.row.receiverCity}}&nbsp;{{scope.row.receiverDistrict}}&nbsp;{{scope.row.receiverTown}}
</p> </div>
<p> <div>
{{scope.row.receiverAddress}} {{scope.row.receiverAddress}}
</p> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="面单号" align="center" prop="erpSendCode" /> <el-table-column label="面单号" align="center" prop="erpSendCode" />
<el-table-column label="状态" align="center" prop="erpSendStatus" >
<template slot-scope="scope">
<el-tag size="small" v-if="scope.row.erpSendStatus==0">未取号</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==1">已取号</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==2">已打印</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==3">已发货</el-tag>
<el-tag size="small" v-if="scope.row.erpSendStatus==10">手动发货</el-tag>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -184,7 +199,7 @@ import {
pullWaybillAccount, pullWaybillAccount,
getWaybillCode, getWaybillCode,
getWaybillPrintData, getWaybillPrintData,
pushWaybillPrintSuccess pushWaybillPrintSuccess, pushShipSend
} from "@/api/tao/ewaybill"; } from "@/api/tao/ewaybill";
export default { export default {
@ -213,7 +228,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
status: 'WAIT_SELLER_SEND_GOODS', status: 'WAIT_SELLER_SEND_GOODS',
erpSendStatus:0, erpSendStatus:null,
shopId: null shopId: null
}, },
// //
@ -360,6 +375,7 @@ export default {
// } // }
if (!this.printParams.printer) { if (!this.printParams.printer) {
this.$modal.msgError('请选择打印机!'); this.$modal.msgError('请选择打印机!');
return pushWaybillPrintSuccess({shopId: this.queryParams.shopId, ids: this.ids})
return return
} }
const ids = this.ids; const ids = this.ids;
@ -414,7 +430,11 @@ export default {
}, },
handleShipSend(){ handleShipSend(){
this.$modal.msgError("开源版本未实现平台发货!请自行对接发货"); // this.$modal.msgError("");
pushShipSend({shopId: this.queryParams.shopId, ids: ids}).then(response => {
this.$modal.msgSuccess("发货成功!");
this.getList()
})
}, },
getUUID(len, radix) { getUUID(len, radix) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');