diff --git a/docs/qihang-erp.sql b/docs/qihang-erp.sql index f1150716..f67a31ff 100644 --- a/docs/qihang-erp.sql +++ b/docs/qihang-erp.sql @@ -11,7 +11,7 @@ Target Server Version : 80032 File Encoding : 65001 - Date: 19/06/2024 16:16:35 + Date: 19/06/2024 17:33:05 */ SET NAMES utf8mb4; @@ -1755,6 +1755,9 @@ CREATE TABLE `oms_wei_order` ( `settle_info` varchar(2550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '结算信息json', `audit_status` int(0) DEFAULT NULL COMMENT '订单审核状态(0待审核1已审核)', `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发货状态', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; @@ -1828,6 +1831,36 @@ CREATE TABLE `oms_wei_refund` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '视频号小店退款' ROW_FORMAT = Dynamic; +-- ---------------------------- +-- Table structure for oms_wei_waybill_account +-- ---------------------------- +DROP TABLE IF EXISTS `oms_wei_waybill_account`; +CREATE TABLE `oms_wei_waybill_account` ( + `id` bigint(0) NOT NULL AUTO_INCREMENT, + `shop_id` bigint(0) NOT NULL COMMENT '店铺id', + `seller_shop_id` bigint(0) DEFAULT NULL COMMENT '平台店铺id,全局唯一,一个店铺分配一个shop_id', + `delivery_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '快递公司编码', + `company_type` int(0) DEFAULT NULL COMMENT '快递公司类型1:加盟型 2:直营型', + `acct_id` bigint(0) DEFAULT NULL COMMENT '电子面单账号id,每绑定一个网点分配一个acct_id', + `acct_type` int(0) DEFAULT NULL COMMENT '面单账号类型0:普通账号 1:共享账号', + `status` int(0) DEFAULT NULL COMMENT '面单账号状态', + `available` int(0) DEFAULT NULL COMMENT '面单余额', + `allocated` int(0) DEFAULT NULL COMMENT '累积已取单', + `cancel` int(0) DEFAULT NULL COMMENT '累计已取消', + `recycled` int(0) DEFAULT NULL COMMENT '累积已回收', + `monthly_card` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '月结账号,company_type 为直营型时有效', + `site_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '网点信息JSON', + `sender_province` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '省名称(一级地址)', + `sender_city` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '市名称(二级地址)', + `sender_county` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `sender_address` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '详细地址', + `name` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货人', + `mobile` 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不显示', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '视频号小店电子面单账户信息表' ROW_FORMAT = Dynamic; + -- ---------------------------- -- Table structure for s_kwai_order -- ---------------------------- diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/bo/WeiWaybillGetBo.java b/open-api/wei-api/src/main/java/com/qihang/wei/bo/WeiWaybillGetBo.java new file mode 100644 index 00000000..637a000a --- /dev/null +++ b/open-api/wei-api/src/main/java/com/qihang/wei/bo/WeiWaybillGetBo.java @@ -0,0 +1,10 @@ +package com.qihang.wei.bo; + +import lombok.Data; + +@Data +public class WeiWaybillGetBo { + private Long accountId;//电子面单账户id + private String[] ids; + private Long shopId;//店铺Id +} diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/controller/WayBillController.java b/open-api/wei-api/src/main/java/com/qihang/wei/controller/WayBillController.java new file mode 100644 index 00000000..e43a4623 --- /dev/null +++ b/open-api/wei-api/src/main/java/com/qihang/wei/controller/WayBillController.java @@ -0,0 +1,206 @@ +package com.qihang.wei.controller; + +import cn.qihangerp.open.wei.EwaybillApiHelper; +import cn.qihangerp.open.wei.common.ApiResultVo; +import cn.qihangerp.open.wei.vo.ewaybill.AccountVo; +import cn.qihangerp.open.wei.vo.ewaybill.DeliveryVo; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.qihang.common.common.AjaxResult; +import com.qihang.common.common.ResultVoEnum; +import com.qihang.common.enums.HttpStatus; +import com.qihang.wei.bo.PullRequest; + +import com.qihang.wei.bo.WeiWaybillGetBo; +import com.qihang.wei.domain.OmsWeiWaybillAccount; +import com.qihang.wei.service.OmsWeiWaybillAccountService; +import lombok.AllArgsConstructor; +import lombok.extern.java.Log; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Log +@RequestMapping("/ewaybill") +@RestController +@AllArgsConstructor +public class WayBillController { + private final WeiApiCommon apiCommon; + private final OmsWeiWaybillAccountService waybillAccountService; + @RequestMapping(value = "/get_waybill_account_list", method = RequestMethod.POST) + public AjaxResult getWaybillAccountList(@RequestBody PullRequest params) throws Exception { + if (params.getShopId() == null || params.getShopId() <= 0) { + return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id"); + } + List list = waybillAccountService.list(new LambdaQueryWrapper().eq(OmsWeiWaybillAccount::getShopId, params.getShopId()).eq(OmsWeiWaybillAccount::getIsShow, 1)); + return AjaxResult.success(list); + } + + @RequestMapping(value = "/pull_waybill_account", method = RequestMethod.POST) + public AjaxResult pull_waybill_account(@RequestBody PullRequest params) throws Exception { + if (params.getShopId() == null || params.getShopId() <= 0) { +// return ApiResul new ApiResult(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id"); + return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id"); + } + Date currDateTime = new Date(); + long startTime = System.currentTimeMillis(); + var checkResult = apiCommon.checkBefore(params.getShopId()); + if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) { + return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData()); + } + String accessToken = checkResult.getData().getAccessToken(); + String serverUrl = checkResult.getData().getServerUrl(); + String appKey = checkResult.getData().getAppKey(); + String appSecret = checkResult.getData().getAppSecret(); + +// ApiResultVo apiResultVo = EwaybillApiHelper.getDeliveryList(appKey, appSecret, accessToken); + ApiResultVo apiResultVo = EwaybillApiHelper.getAccountList(appKey, appSecret, accessToken); + + List list = new ArrayList<>(); + if(apiResultVo.getCode()==0){ + for (var item : apiResultVo.getList()) { + + OmsWeiWaybillAccount vo = new OmsWeiWaybillAccount(); + vo.setShopId(params.getShopId()); + vo.setSellerShopId(item.getShopId()); + vo.setIsShow(1); + vo.setDeliveryId(item.getDeliveryId()); + vo.setCompanyType(item.getCompanyType()); + vo.setAcctId(item.getAcctId()); + vo.setAcctType(item.getAcctType()); + vo.setStatus(item.getStatus()); + vo.setAvailable(item.getAvailable()); + vo.setAllocated(item.getAllocated()); + vo.setCancel(item.getCancel()); + vo.setRecycled(item.getRecycled()); + vo.setMonthlyCard(item.getMonthlyCard()); + vo.setSiteInfo(JSONObject.toJSONString(item.getSiteInfo())); + + if (item.getSenderAddress()!=null) { + vo.setSenderAddress(item.getSenderAddress().getAddress()); + vo.setSenderProvince(item.getSenderAddress().getProvince()); + vo.setSenderCity(item.getSenderAddress().getCity()); + vo.setSenderCounty(item.getSenderAddress().getCounty()); + } + list.add(vo); + waybillAccountService.save(vo); + log.info("========添加wei电子面单账户信息=========="); + + } + } + + + return AjaxResult.success(list); +// return AjaxResult.success(apiResultVo.getList()); + } + + @PostMapping("/get_waybill_code") + @ResponseBody + public AjaxResult getWaybillCode(@RequestBody WeiWaybillGetBo req) { + if (req.getAccountId() == null || req.getAccountId() <= 0) { + return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,请选择电子面单账户"); + } + 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, "参数错误,没有选择订单"); + } + var checkResult = apiCommon.checkBefore(req.getShopId()); + if (checkResult.getCode() != HttpStatus.SUCCESS) { + return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData()); + } + String accessToken = checkResult.getData().getAccessToken(); + String appKey = checkResult.getData().getAppKey(); + String appSecret = checkResult.getData().getAppSecret(); +// Long sellerShopId = checkResult.getData().getSellerShopId(); + + // 获取电子面单账户信息(包含了发货地址信息) + OmsWeiWaybillAccount account = waybillAccountService.getById(req.getAccountId()); + +// WaybillCloudPrintApplyNewRequest request = new WaybillCloudPrintApplyNewRequest(); +// request.setCp_code(account.getCpCode()); +// +// WaybillCloudPrintApplyNewRequestSender sender = new WaybillCloudPrintApplyNewRequestSender(); +// sender.setName(account.getName()); +// sender.setMobile(account.getMobile()); +// WaybillCloudPrintApplyNewRequestSender.AddressDTO addressDTO = new WaybillCloudPrintApplyNewRequestSender.AddressDTO(); +// addressDTO.setCity(account.getCity()); +// addressDTO.setProvince(account.getProvince()); +// addressDTO.setDistrict(account.getArea()); +// addressDTO.setTown(""); +// addressDTO.setDetail(account.getAddressDetail()); +// sender.setAddress(addressDTO); +// request.setSender(sender); +// +// // 组合取号的订单信息trade_order_info_dtos +// List orderList = new ArrayList<>(); +// +// for(String orderId:req.getIds()){ +// if(StringUtils.hasText(orderId)){ +// OmsTaoOrder omsTaoOrder = orderService.queryDetailByTid(orderId); +// if(omsTaoOrder!=null) { +// WaybillCloudPrintApplyNewRequestTradeOrderInfoDto dto = new WaybillCloudPrintApplyNewRequestTradeOrderInfoDto(); +// dto.setObjectId(omsTaoOrder.getTid()); +// dto.setTemplateUrl("http://cloudprint.cainiao.com/template/standard/101"); +// dto.setUserId(sellerShopId.intValue()); +// +// WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.OrderInfoDTO orderInfoDTO = new WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.OrderInfoDTO(); +// orderInfoDTO.setOrderChannelsType("TB"); +// orderInfoDTO.setTradeOrderList(omsTaoOrder.getTid()); +// dto.setOrderInfo(orderInfoDTO); +// +// WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.PackageInfoDTO packageInfoDTO = new WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.PackageInfoDTO(); +// List items = new ArrayList<>(); +// for (var orderItem : omsTaoOrder.getItems()) { +// WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.PackageInfoDTO.ItemsDTO itemsDTO = new WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.PackageInfoDTO.ItemsDTO(); +// itemsDTO.setCount(orderItem.getNum()); +// itemsDTO.setName(orderItem.getTitle()); +// items.add(itemsDTO); +// } +// packageInfoDTO.setItems(items); +// dto.setPackageInfo(packageInfoDTO); +// +// WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.RecipientDTO recipientDTO = new WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.RecipientDTO(); +// WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.RecipientDTO.AddressDTO addressDTO1 = new WaybillCloudPrintApplyNewRequestTradeOrderInfoDto.RecipientDTO.AddressDTO(); +// addressDTO1.setCity(omsTaoOrder.getReceiverCity()); +// addressDTO1.setTown(omsTaoOrder.getReceiverTown()); +// addressDTO1.setProvince(omsTaoOrder.getReceiverState()); +// addressDTO1.setDistrict(omsTaoOrder.getReceiverDistrict()); +// addressDTO1.setDetail(omsTaoOrder.getReceiverAddress()); +// recipientDTO.setAddress(addressDTO1); +// recipientDTO.setName(omsTaoOrder.getReceiverName()); +// recipientDTO.setOaid(omsTaoOrder.getOaid()); +// recipientDTO.setTid(omsTaoOrder.getTid()); +// dto.setRecipient(recipientDTO); +// orderList.add(dto); +// } +// } +// } +// +// request.setTrade_order_info_dtos(orderList); +// +// ApiResultVo apiResultVo = WaybillApiHelper.waybillCloudPrintApplyNew(appKey, appSecret, accessToken, request); +// if(apiResultVo.getCode()==0){ +// // 保持数据 +// for(var result: apiResultVo.getList()){ +// ErpShipWaybill waybill = new ErpShipWaybill(); +// waybill.setShopId(req.getShopId()); +// waybill.setOrderId(result.getObjectId()); +// waybill.setWaybillCode(result.getWaybillCode()); +// waybill.setLogisticsCode(result.getCpCode()); +// waybill.setPrintData(result.getPrintData()); +// waybill.setStatus(1);//1已取号 +// erpShipWaybillService.waybillUpdate(waybill); +// log.info("====保存電子面單信息========"+result.getObjectId()); +// } +// }else{ +// return AjaxResult.error(apiResultVo.getMsg()); +// } + + return AjaxResult.success(); + } +} diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/controller/eWayBillController.java b/open-api/wei-api/src/main/java/com/qihang/wei/controller/eWayBillController.java deleted file mode 100644 index 2ed7f21a..00000000 --- a/open-api/wei-api/src/main/java/com/qihang/wei/controller/eWayBillController.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.qihang.wei.controller; - -import cn.qihangerp.open.wei.EwaybillApiHelper; -import cn.qihangerp.open.wei.common.ApiResultVo; -import cn.qihangerp.open.wei.vo.ewaybill.DeliveryVo; -import com.alibaba.fastjson2.JSONObject; -import com.qihang.common.common.AjaxResult; -import com.qihang.common.common.ResultVoEnum; -import com.qihang.common.enums.HttpStatus; -import com.qihang.wei.bo.PullRequest; -import com.qihang.wei.domain.WeiGoods; -import com.qihang.wei.domain.WeiGoodsSku; - -import lombok.AllArgsConstructor; -import org.springframework.beans.BeanUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@RequestMapping("/ewaybill") -@RestController -@AllArgsConstructor -public class eWayBillController { - private final WeiApiCommon apiCommon; - @RequestMapping(value = "/get_deliver_list", method = RequestMethod.POST) - public AjaxResult getDeliverList(@RequestBody PullRequest params) throws Exception { - if (params.getShopId() == null || params.getShopId() <= 0) { -// return ApiResul new ApiResult(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id"); - return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id"); - } - Date currDateTime = new Date(); - long startTime = System.currentTimeMillis(); - var checkResult = apiCommon.checkBefore(params.getShopId()); - if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) { - return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData()); - } - String accessToken = checkResult.getData().getAccessToken(); - String serverUrl = checkResult.getData().getServerUrl(); - String appKey = checkResult.getData().getAppKey(); - String appSecret = checkResult.getData().getAppSecret(); - - ApiResultVo apiResultVo = EwaybillApiHelper.getDeliveryList(appKey, appSecret, accessToken); - - - return AjaxResult.success(apiResultVo.getList()); - } -} diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiOrder.java b/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiOrder.java index 6089518c..fc032bc8 100644 --- a/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiOrder.java +++ b/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiOrder.java @@ -174,6 +174,22 @@ public class OmsWeiOrder implements Serializable { * 订单审核时间 */ private Date auditTime; + /** + * erp发货快递公司 + */ + private String erpSendCompany; + + /** + * erp发货快递单号 + */ + private String erpSendCode; + + /** + * erp发货状态 + */ + private Integer erpSendStatus; + + @TableField(exist = false) private List items; diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiWaybillAccount.java b/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiWaybillAccount.java new file mode 100644 index 00000000..0d8e752e --- /dev/null +++ b/open-api/wei-api/src/main/java/com/qihang/wei/domain/OmsWeiWaybillAccount.java @@ -0,0 +1,127 @@ +package com.qihang.wei.domain; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +/** + * 视频号小店电子面单账户信息表 + * @TableName oms_wei_waybill_account + */ +@Data +public class OmsWeiWaybillAccount implements Serializable { + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 平台店铺id,全局唯一,一个店铺分配一个shop_id + */ + private String sellerShopId; + + /** + * 快递公司编码 + */ + private String deliveryId; + + /** + * 快递公司类型1:加盟型 2:直营型 + */ + private Integer companyType; + + /** + * 电子面单账号id,每绑定一个网点分配一个acct_id + */ + private String acctId; + + /** + * 面单账号类型0:普通账号 1:共享账号 + */ + private Integer acctType; + + /** + * 面单账号状态 + */ + private Integer status; + + /** + * 面单余额 + */ + private Integer available; + + /** + * 累积已取单 + */ + private Integer allocated; + + /** + * 累计已取消 + */ + private Integer cancel; + + /** + * 累积已回收 + */ + private Integer recycled; + + /** + * 月结账号,company_type 为直营型时有效 + */ + private String monthlyCard; + + /** + * 网点信息JSON + */ + private String siteInfo; + + /** + * 省名称(一级地址) + */ + private String senderProvince; + + /** + * 市名称(二级地址) + */ + private String senderCity; + + /** + * + */ + private String senderCounty; + + /** + * 详细地址 + */ + private String senderAddress; + + /** + * 发货人 + */ + private String name; + + /** + * 发货手机号 + */ + private String mobile; + + /** + * 发货固定电话 + */ + private String phone; + + /** + * 是否前台显示1显示0不显示 + */ + private Integer isShow; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/domain/WeiOrder.java b/open-api/wei-api/src/main/java/com/qihang/wei/domain/WeiOrder.java index aa16a24d..36b470a8 100644 --- a/open-api/wei-api/src/main/java/com/qihang/wei/domain/WeiOrder.java +++ b/open-api/wei-api/src/main/java/com/qihang/wei/domain/WeiOrder.java @@ -160,6 +160,7 @@ public class WeiOrder implements Serializable { */ private String settleInfo; + @TableField(exist = false) private List items; diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/mapper/OmsWeiWaybillAccountMapper.java b/open-api/wei-api/src/main/java/com/qihang/wei/mapper/OmsWeiWaybillAccountMapper.java new file mode 100644 index 00000000..93de0b5b --- /dev/null +++ b/open-api/wei-api/src/main/java/com/qihang/wei/mapper/OmsWeiWaybillAccountMapper.java @@ -0,0 +1,18 @@ +package com.qihang.wei.mapper; + +import com.qihang.wei.domain.OmsWeiWaybillAccount; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author TW +* @description 针对表【oms_wei_waybill_account(视频号小店电子面单账户信息表)】的数据库操作Mapper +* @createDate 2024-06-19 17:08:54 +* @Entity com.qihang.wei.domain.OmsWeiWaybillAccount +*/ +public interface OmsWeiWaybillAccountMapper extends BaseMapper { + +} + + + + diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/service/OmsWeiWaybillAccountService.java b/open-api/wei-api/src/main/java/com/qihang/wei/service/OmsWeiWaybillAccountService.java new file mode 100644 index 00000000..bdb9e45c --- /dev/null +++ b/open-api/wei-api/src/main/java/com/qihang/wei/service/OmsWeiWaybillAccountService.java @@ -0,0 +1,13 @@ +package com.qihang.wei.service; + +import com.qihang.wei.domain.OmsWeiWaybillAccount; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author TW +* @description 针对表【oms_wei_waybill_account(视频号小店电子面单账户信息表)】的数据库操作Service +* @createDate 2024-06-19 17:08:54 +*/ +public interface OmsWeiWaybillAccountService extends IService { + +} diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiOrderServiceImpl.java b/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiOrderServiceImpl.java index 20dc2eb3..b90981fd 100644 --- a/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiOrderServiceImpl.java +++ b/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiOrderServiceImpl.java @@ -44,7 +44,15 @@ public class OmsWeiOrderServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper() .eq(bo.getShopId()!=null,OmsWeiOrder::getShopId,bo.getShopId()) .eq(StringUtils.hasText(bo.getOrderId()),OmsWeiOrder::getOrderId,bo.getOrderId()) + .eq(bo.getStatus()!=null,OmsWeiOrder::getStatus,bo.getStatus()) ; + if(bo.getErpSendStatus()!=null){ + if(bo.getErpSendStatus()==-1) { + queryWrapper.lt(OmsWeiOrder::getErpSendStatus,3); + }else { + queryWrapper.eq(OmsWeiOrder::getErpSendStatus, bo.getErpSendStatus()); + } + } Page page = mapper.selectPage(pageQuery.build(), queryWrapper); if(page.getRecords()!=null){ diff --git a/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiWaybillAccountServiceImpl.java b/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiWaybillAccountServiceImpl.java new file mode 100644 index 00000000..c088e55c --- /dev/null +++ b/open-api/wei-api/src/main/java/com/qihang/wei/service/impl/OmsWeiWaybillAccountServiceImpl.java @@ -0,0 +1,22 @@ +package com.qihang.wei.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.qihang.wei.domain.OmsWeiWaybillAccount; +import com.qihang.wei.service.OmsWeiWaybillAccountService; +import com.qihang.wei.mapper.OmsWeiWaybillAccountMapper; +import org.springframework.stereotype.Service; + +/** +* @author TW +* @description 针对表【oms_wei_waybill_account(视频号小店电子面单账户信息表)】的数据库操作Service实现 +* @createDate 2024-06-19 17:08:54 +*/ +@Service +public class OmsWeiWaybillAccountServiceImpl extends ServiceImpl + implements OmsWeiWaybillAccountService{ + +} + + + + diff --git a/open-api/wei-api/src/main/resources/mapper/OmsWeiOrderMapper.xml b/open-api/wei-api/src/main/resources/mapper/OmsWeiOrderMapper.xml index c37c42c3..c9dc8eee 100644 --- a/open-api/wei-api/src/main/resources/mapper/OmsWeiOrderMapper.xml +++ b/open-api/wei-api/src/main/resources/mapper/OmsWeiOrderMapper.xml @@ -37,6 +37,9 @@ + + + @@ -50,6 +53,6 @@ house_number,virtual_order_tel_number,tel_number_ext_info, use_tel_number,hash_code,delivery_product_info, ship_done_time,ewaybill_order_code,settle_info, - audit_status,audit_time + audit_status,audit_time,erp_send_company,erp_send_code,erp_send_status diff --git a/open-api/wei-api/src/main/resources/mapper/OmsWeiWaybillAccountMapper.xml b/open-api/wei-api/src/main/resources/mapper/OmsWeiWaybillAccountMapper.xml new file mode 100644 index 00000000..e8f00bdd --- /dev/null +++ b/open-api/wei-api/src/main/resources/mapper/OmsWeiWaybillAccountMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,shop_id,seller_shop_id, + delivery_id,company_type,acct_id, + acct_type,status,available, + allocated,cancel,recycled, + monthly_card,site_info,sender_province, + sender_city,sender_county,sender_address, + name,mobile,phone, + is_show + + diff --git a/vue/src/api/wei/ewaybill.js b/vue/src/api/wei/ewaybill.js index c1b3fe54..02b3d073 100644 --- a/vue/src/api/wei/ewaybill.js +++ b/vue/src/api/wei/ewaybill.js @@ -1,9 +1,54 @@ import request from '@/utils/request' // 列表 -export function getDeliverList(data) { +export function getWaybillAccountList(data) { return request({ - url: '/api/wei-api/ewaybill/get_deliver_list', + url: '/api/wei-api/ewaybill/get_waybill_account_list', + method: 'post', + data: data + }) +} + +// 更新电子面单账户 +export function pullWaybillAccount(data) { + return request({ + url: '/api/wei-api/ewaybill/pull_waybill_account', + method: 'post', + data: data + }) +} + +// 取号 +export function getWaybillCode(data) { + return request({ + url: '/api/wei-api/ewaybill/get_waybill_code', + method: 'post', + data: data + }) +} + +// 获取打印的数据 +export function getWaybillPrintData(data) { + return request({ + url: '/api/wei-api/ewaybill/get_print_data', + method: 'post', + data: data + }) +} + +// 打印成功 +export function pushWaybillPrintSuccess(data) { + return request({ + url: '/api/tao-api/ewaybill/push_print_success', + method: 'post', + data: data + }) +} + + +export function pushShipSend(data) { + return request({ + url: '/api/tao-api/ewaybill/push_ship_send', method: 'post', data: data }) diff --git a/vue/src/views/shipping/ewaybillPrint/index.vue b/vue/src/views/shipping/ewaybillPrint/index.vue index 33e5d0bd..45980937 100644 --- a/vue/src/views/shipping/ewaybillPrint/index.vue +++ b/vue/src/views/shipping/ewaybillPrint/index.vue @@ -1,7 +1,7 @@ +