From 1e5c695840ff78f9efc2fdb2b6f04acc3d1b7f9b Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sun, 25 Jun 2023 12:49:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E6=A2=A6=E5=A4=A9=E5=B7=A5?= =?UTF-8?q?=E5=8E=82=E5=AF=B9=E6=8E=A5=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/snm/entity/MtFactoryOrder.java | 81 ++++++++++++ .../snm/entity/MtFactoryOrderMain.java | 57 ++++++++ .../factory/snm/entity/MtPackageInfo.java | 54 ++++++++ ...rderStatusLog.java => OrderStatusLog.java} | 8 +- .../controller/MtFactoryDataController.java | 124 ++++++++++++++++++ .../factory/mt/dto/MtFactoryDataDTO.java | 18 +++ .../factory/mt/dto/MtFactoryOrderDTO.java | 18 +++ .../factory/mt/dto/MtPackageInfoDTO.java | 10 ++ .../controller/PanFactoryDataController.java | 6 +- .../snm/mapper/MtFactoryOrderMainMapper.java | 7 + .../snm/mapper/MtFactoryOrderMainMapper.xml | 20 +++ ...gMapper.java => OrderStatusLogMapper.java} | 4 +- ...LogMapper.xml => OrderStatusLogMapper.xml} | 2 +- .../snm/service/IMtFactoryDataService.java | 12 ++ .../service/IMtFactoryOrderMainService.java | 8 ++ .../snm/service/IOrderStatusLogService.java | 8 ++ .../service/IPanOrderStatusLogService.java | 8 -- .../impl/MtFactoryDataServiceImpl.java | 39 ++++++ .../impl/MtFactoryOrderMainServiceImpl.java | 15 +++ .../impl/OrderStatusLogServiceImpl.java | 19 +++ .../impl/PanFactoryDataServiceImpl.java | 10 +- .../impl/PanOrderStatusLogServiceImpl.java | 19 --- 22 files changed, 506 insertions(+), 41 deletions(-) create mode 100644 blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java create mode 100644 blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java create mode 100644 blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java rename blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/{PanOrderStatusLog.java => OrderStatusLog.java} (62%) create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.xml rename blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/{PanOrderStatusLogMapper.java => OrderStatusLogMapper.java} (88%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/{PanOrderStatusLogMapper.xml => OrderStatusLogMapper.xml} (93%) create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryDataService.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryOrderMainService.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IOrderStatusLogService.java delete mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanOrderStatusLogService.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryDataServiceImpl.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryOrderMainServiceImpl.java create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderStatusLogServiceImpl.java delete mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanOrderStatusLogServiceImpl.java diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java new file mode 100644 index 000000000..9ae20bf49 --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java @@ -0,0 +1,81 @@ +package com.logpm.factory.snm.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +@Data +@TableName("mt_factory_order") +@ApiModel(value = "MtFactoryOrder对象", description = "梦天工厂订单") +@EqualsAndHashCode(callSuper = true) +public class MtFactoryOrder extends BaseEntity { + + @JsonProperty("总单编号") + @ApiModelProperty(value = "总单编号") + private String mainOrderCode; + + @JsonProperty("订单编号") + @ApiModelProperty(value = "订单编号") + private String orderCode; + + @JsonProperty("客户姓名") + @ApiModelProperty(value = "客户姓名") + private String customName; + + @JsonProperty("客户电话") + @ApiModelProperty(value = "客户电话") + private String customPhone; + + @JsonProperty("客户地址") + @ApiModelProperty(value = "客户地址") + private String customAddress; + + @JsonProperty("经销商编号") + @ApiModelProperty(value = "经销商编码") + private String dealerCode; + + @JsonProperty("经销商名称") + @ApiModelProperty(value = "经销商名称") + private String dealerName; + + @JsonProperty("专卖店编号") + @ApiModelProperty(value = "专卖店编号") + private String exclusiveCode; + + @JsonProperty("专卖店名称") + @ApiModelProperty(value = "专卖店名称") + private String exclusiveName; + + @JsonProperty("收货人") + @ApiModelProperty(value = "收货人") + private String consignee; + + @JsonProperty("收货人电话") + @ApiModelProperty(value = "收货人电话") + private String consigneePhone; + + @JsonProperty("收货地址") + @ApiModelProperty(value = "收货人地址") + private String consigneeAddress; + + @JsonProperty("出库方式") + @ApiModelProperty(value = "出库方式") + private String outboundType; + + @JsonProperty("品牌") + @ApiModelProperty(value = "品牌") + private String brand; + + @JsonProperty("生产单号") + @ApiModelProperty(value = "生产单号") + private String produceOrderCode; + + @JsonProperty("包件数") + @ApiModelProperty(value = "包件数") + private String quantity; + +} diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java new file mode 100644 index 000000000..7f778932e --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java @@ -0,0 +1,57 @@ +package com.logpm.factory.snm.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +@Data +@TableName("mt_factory_order_main") +@ApiModel(value = "MtFactoryOrderMain对象", description = "梦天工厂订单主对象") +@EqualsAndHashCode(callSuper = true) +public class MtFactoryOrderMain extends BaseEntity { + + @JsonProperty("发货单编号") + @ApiModelProperty(value = "发货单编号") + private String invoiceOrderCode; + + @JsonProperty("中心仓编号") + @ApiModelProperty(value = "中心仓编号") + private String centerWarehouseCode; + + @JsonProperty("中心仓") + @ApiModelProperty(value = "中心仓") + private String centerWarehouseName; + + @JsonProperty("仓库类型") + @ApiModelProperty(value = "仓库类型") + private String warehouseType; + + @JsonProperty("送货车号") + @ApiModelProperty(value = "送货车号") + private String sendCarNumber; + + @JsonProperty("送货司机") + @ApiModelProperty(value = "送货车司机") + private String sendCarDriver; + + @JsonProperty("送货司机电话") + @ApiModelProperty(value = "送货车司机电话") + private String sendCarDriverPhone; + + @JsonProperty("确认发车人") + @ApiModelProperty(value = "确认发车人") + private String reallyMan; + + @JsonProperty("确认发车时间") + @ApiModelProperty(value = "确认发车时间") + private String reallyDate; + + @JsonProperty("备注") + @ApiModelProperty(value = "备注") + private String remark; + +} diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java new file mode 100644 index 000000000..1d7c812ad --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java @@ -0,0 +1,54 @@ +package com.logpm.factory.snm.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +@Data +@TableName("mt_package_info") +@ApiModel(value = "MtPackageInfo对象", description = "梦天工厂包件信息") +@EqualsAndHashCode(callSuper = true) +public class MtPackageInfo extends BaseEntity { + + + @JsonProperty("出库人") + @ApiModelProperty(value = "出库人") + private String outboundMan; + + @JsonProperty("出库时间") + @ApiModelProperty(value = "出库时间") + private String outboundDate; + + @JsonProperty("包装编号") + @ApiModelProperty(value = "包装编号") + private String packageCode; + + @JsonProperty("包装类型") + @ApiModelProperty(value = "包装类型") + private String packageType; + + @JsonProperty("大类") + @ApiModelProperty(value = "大类") + private String bigType; + + @JsonProperty("小类") + @ApiModelProperty(value = "小类") + private String smallType; + + @JsonProperty("油漆颜色") + @ApiModelProperty(value = "油漆颜色") + private String color; + + @JsonProperty("型号") + @ApiModelProperty(value = "型号") + private String model; + + @JsonProperty("门扇尺寸") + @ApiModelProperty(value = "尺寸") + private String size; + +} diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanOrderStatusLog.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/OrderStatusLog.java similarity index 62% rename from blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanOrderStatusLog.java rename to blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/OrderStatusLog.java index 9367fde74..e6474eac4 100644 --- a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanOrderStatusLog.java +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/OrderStatusLog.java @@ -7,13 +7,15 @@ import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; @Data -@TableName("pan_order_status_log") -@ApiModel(value = "PanOrderStatusLog对象", description = "皮艾诺订单状态日志") +@TableName("order_status_log") +@ApiModel(value = "OrderStatusLog对象", description = "工厂订单状态日志") @EqualsAndHashCode(callSuper = true) -public class PanOrderStatusLog extends BaseEntity { +public class OrderStatusLog extends BaseEntity { private String args; private Integer type; + private String brand;//品牌 + } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java new file mode 100644 index 000000000..b153d4b44 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java @@ -0,0 +1,124 @@ +/* + * 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.factory.mt.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.factory.mt.dto.MtFactoryDataDTO; +import com.logpm.factory.snm.bean.Resp; +import com.logpm.factory.snm.entity.OrderStatusLog; +import com.logpm.factory.snm.service.IMtFactoryDataService; +import com.logpm.factory.snm.service.IOrderStatusLogService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; + +/** + * 梦天数据 控制器 + * + * @author zhy + * @since 2023-06-06 + */ +@Log4j2 +@RestController +@AllArgsConstructor +@RequestMapping("/factory/mt") +@Api(value = "工厂数据", tags = "工厂数据接口") +public class MtFactoryDataController extends BladeController { + + private final IOrderStatusLogService orderStatusLogService; + private final IMtFactoryDataService mtFactoryDataService; + + /** + * 工厂数据推送接口 + */ + @ResponseBody + @PostMapping("/data") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "通常数据推送", notes = "传入factoryOrderDTO") + public R data(@Validated @RequestBody MtFactoryDataDTO mtFactoryDataDTO, HttpServletRequest request) { + log.info("############data: "); + String corpId = request.getHeader("corpId"); + + //先保存原始请求数据 + OrderStatusLog orderStatusLog = new OrderStatusLog(); + orderStatusLog.setArgs(JSONObject.toJSONString(mtFactoryDataDTO)); + orderStatusLog.setStatus(1); + orderStatusLog.setType(3); + orderStatusLog.setBrand("梦天"); + orderStatusLogService.save(orderStatusLog); + + //数据存入数据库 + boolean flag = mtFactoryDataService.dealWithData(mtFactoryDataDTO); + + +// //判断数据是否已存入 +// String orderNo = factoryOrderDTO.getOrderNo(); +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.eq("order_no",orderNo); +// PanFactoryOrder one = factoryOrderService.getOne(queryWrapper); +// if(!Objects.isNull(one)){ +// log.warn("############data: 订单数据已存在 orderNo={}",orderNo); +// return Resp.fail(400,"订单数据已存在"); +// } +// +// PanFactoryOrder factoryOrder = new PanFactoryOrder(); +// BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); +// factoryOrder.setCorpid(corpId); +// //保存订单数据 +// factoryOrderService.save(factoryOrder); +// +// List packageInfos = factoryOrderDTO.getORDER_ATTRIBUTES(); +// +// for (PanPackageInfoDTO dto:packageInfos){ +// PanPackageInfo packageInfo = new PanPackageInfo(); +// BeanUtil.copyProperties(dto,packageInfo); +// packageInfo.setOrderId(factoryOrder.getId()); +// //保存包件信息数据 +// //因为需要先保存包件明细需要包件的id +// packageInfoService.save(packageInfo); +// +// //再存入包件明细 +// List PanPackagelist = new ArrayList<>(); +// List order_attributes_line = dto.getORDER_ATTRIBUTES_LINE(); +// for (PanPackageListDTO panPackageListDTO:order_attributes_line){ +// PanPackageList panPackageList = new PanPackageList(); +// BeanUtil.copyProperties(panPackageListDTO,panPackageList); +// panPackageList.setPackageId(packageInfo.getId()); +// PanPackagelist.add(panPackageList); +// } +// packageListService.saveBatch(PanPackagelist); +// } +// +// //修改保存数据的状态 +// panOrderStatusLog.setStatus(0); +// panOrderStatusLogService.saveOrUpdate(panOrderStatusLog); +// +// //开启异步线程处理数据 +// syncDataService.handlerPanDataToHt(); + + return Resp.fail(400,"fail"); + } + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java new file mode 100644 index 000000000..a737cd87d --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java @@ -0,0 +1,18 @@ +package com.logpm.factory.mt.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.logpm.factory.snm.entity.MtFactoryOrderMain; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class MtFactoryDataDTO extends MtFactoryOrderMain { + + @JsonProperty("发货单明细") + private List orderList = new ArrayList<>(); + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java new file mode 100644 index 000000000..cc59e95a2 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java @@ -0,0 +1,18 @@ +package com.logpm.factory.mt.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.logpm.factory.snm.entity.MtFactoryOrder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class MtFactoryOrderDTO extends MtFactoryOrder { + + @JsonProperty("包装明细") + private List packageInfos = new ArrayList<>(); + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java new file mode 100644 index 000000000..35eef1c9a --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java @@ -0,0 +1,10 @@ +package com.logpm.factory.mt.dto; + +import com.logpm.factory.snm.entity.MtPackageInfo; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class MtPackageInfoDTO extends MtPackageInfo { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java index 3c134eaaf..b425f7564 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java @@ -23,7 +23,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.factory.snm.bean.Resp; import com.logpm.factory.snm.dto.*; import com.logpm.factory.snm.entity.PanFactoryOrder; -import com.logpm.factory.snm.entity.PanOrderStatusLog; +import com.logpm.factory.snm.entity.OrderStatusLog; import com.logpm.factory.snm.entity.PanPackageInfo; import com.logpm.factory.snm.entity.PanPackageList; import com.logpm.factory.snm.service.*; @@ -60,7 +60,7 @@ public class PanFactoryDataController extends BladeController { private final IPanPackageListService packageListService; private final IPanFactoryDataService factoryDataService; private final IAsyncDataService syncDataService; - private final IPanOrderStatusLogService panOrderStatusLogService; + private final IOrderStatusLogService panOrderStatusLogService; // @ResponseBody // @PostMapping("/token") @@ -102,7 +102,7 @@ public class PanFactoryDataController extends BladeController { String corpId = request.getHeader("corpId"); //先保存原始请求数据 - PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog(); + OrderStatusLog panOrderStatusLog = new OrderStatusLog(); panOrderStatusLog.setArgs(JSONObject.toJSONString(factoryOrderDTO)); panOrderStatusLog.setStatus(1); panOrderStatusLog.setType(3); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.java new file mode 100644 index 000000000..5be6cb8c7 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.java @@ -0,0 +1,7 @@ +package com.logpm.factory.snm.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.factory.snm.entity.MtFactoryOrderMain; + +public interface MtFactoryOrderMainMapper extends BaseMapper { +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.xml new file mode 100644 index 000000000..5093c771a --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.java similarity index 88% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.java index 231109f40..04b6b31b1 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.java @@ -17,7 +17,7 @@ package com.logpm.factory.snm.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.logpm.factory.snm.entity.PanOrderStatusLog; +import com.logpm.factory.snm.entity.OrderStatusLog; /** * 工厂推送数据接口日志 Mapper 接口 @@ -25,7 +25,7 @@ import com.logpm.factory.snm.entity.PanOrderStatusLog; * @author zhy * @since 2023-03-28 */ -public interface PanOrderStatusLogMapper extends BaseMapper { +public interface OrderStatusLogMapper extends BaseMapper { } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.xml similarity index 93% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.xml index ce887dc99..3e4056f86 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryDataService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryDataService.java new file mode 100644 index 000000000..f0d37d1ce --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryDataService.java @@ -0,0 +1,12 @@ +package com.logpm.factory.snm.service; + +import com.logpm.factory.mt.dto.MtFactoryDataDTO; + +/** + * 工厂推送数据接口 + */ +public interface IMtFactoryDataService { + + boolean dealWithData(MtFactoryDataDTO mtFactoryDataDTO); + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryOrderMainService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryOrderMainService.java new file mode 100644 index 000000000..e44d9a8b2 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryOrderMainService.java @@ -0,0 +1,8 @@ +package com.logpm.factory.snm.service; + +import com.logpm.factory.snm.entity.MtFactoryOrderMain; +import org.springblade.core.mp.base.BaseService; + +public interface IMtFactoryOrderMainService extends BaseService { + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IOrderStatusLogService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IOrderStatusLogService.java new file mode 100644 index 000000000..2c0de1db6 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IOrderStatusLogService.java @@ -0,0 +1,8 @@ +package com.logpm.factory.snm.service; + +import com.logpm.factory.snm.entity.OrderStatusLog; +import org.springblade.core.mp.base.BaseService; + +public interface IOrderStatusLogService extends BaseService { + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanOrderStatusLogService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanOrderStatusLogService.java deleted file mode 100644 index d4c4bf09b..000000000 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanOrderStatusLogService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.logpm.factory.snm.service; - -import com.logpm.factory.snm.entity.PanOrderStatusLog; -import org.springblade.core.mp.base.BaseService; - -public interface IPanOrderStatusLogService extends BaseService { - -} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryDataServiceImpl.java new file mode 100644 index 000000000..ca983967d --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryDataServiceImpl.java @@ -0,0 +1,39 @@ +package com.logpm.factory.snm.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.factory.mt.dto.MtFactoryDataDTO; +import com.logpm.factory.snm.entity.MtFactoryOrderMain; +import com.logpm.factory.snm.service.IMtFactoryDataService; +import com.logpm.factory.snm.service.IMtFactoryOrderMainService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Objects; + +@Slf4j +@Service +@AllArgsConstructor +public class MtFactoryDataServiceImpl implements IMtFactoryDataService { + + private final IMtFactoryOrderMainService mtFactoryOrderMainService; + + @Transactional + @Override + public boolean dealWithData(MtFactoryDataDTO mtFactoryDataDTO) { + log.info("#############dealWithData: 处理梦天工厂数据 开始"); + String invoiceOrderCode = mtFactoryDataDTO.getInvoiceOrderCode();//发货单编码 + //先判断该发货单编码是否已经存在 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("invoice_order_code",invoiceOrderCode); + MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getOne(queryWrapper); + if(Objects.isNull(mtFactoryOrderMain)){ + + } + + + + return false; + } +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryOrderMainServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryOrderMainServiceImpl.java new file mode 100644 index 000000000..cc557b5bb --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryOrderMainServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.factory.snm.service.impl; + +import com.logpm.factory.snm.entity.MtFactoryOrderMain; +import com.logpm.factory.snm.mapper.MtFactoryOrderMainMapper; +import com.logpm.factory.snm.service.IMtFactoryOrderMainService; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@AllArgsConstructor +@Service +public class MtFactoryOrderMainServiceImpl extends BaseServiceImpl implements IMtFactoryOrderMainService { + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderStatusLogServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderStatusLogServiceImpl.java new file mode 100644 index 000000000..305b4ec25 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderStatusLogServiceImpl.java @@ -0,0 +1,19 @@ +package com.logpm.factory.snm.service.impl; + +import com.logpm.factory.snm.entity.OrderStatusLog; +import com.logpm.factory.snm.mapper.OrderStatusLogMapper; +import com.logpm.factory.snm.service.IOrderStatusLogService; +import lombok.AllArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@AllArgsConstructor +@Service +public class OrderStatusLogServiceImpl extends BaseServiceImpl implements IOrderStatusLogService { + + private static final Logger logger = LoggerFactory.getLogger(OrderStatusLogServiceImpl.class); + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java index 79b7d6542..a1b97bd6b 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java @@ -10,11 +10,11 @@ import com.logpm.factory.snm.bean.Resp; import com.logpm.factory.snm.dto.OrderInfoDTO; import com.logpm.factory.snm.dto.OrderStatusDTO; import com.logpm.factory.snm.entity.PanFactoryOrder; -import com.logpm.factory.snm.entity.PanOrderStatusLog; +import com.logpm.factory.snm.entity.OrderStatusLog; import com.logpm.factory.snm.entity.PanPackageInfo; import com.logpm.factory.snm.service.IPanFactoryDataService; import com.logpm.factory.snm.service.IPanFactoryOrderService; -import com.logpm.factory.snm.service.IPanOrderStatusLogService; +import com.logpm.factory.snm.service.IOrderStatusLogService; import com.logpm.factory.snm.service.IPanPackageInfoService; import com.logpm.oldproject.feign.IAdvanceDetailClient; import com.logpm.oldproject.feign.IWarehouseClient; @@ -42,7 +42,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { private final IPanFactoryOrderService factoryOrderService; private final PanFactoryProperties panFactoryProperties; - private final IPanOrderStatusLogService panOrderStatusLogService; + private final IOrderStatusLogService panOrderStatusLogService; private final IPanPackageInfoService panPackageInfoService; private final IPanFactoryOrderService panFactoryOrderService; private final IAdvanceDetailClient advanceDetailClient; @@ -96,7 +96,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { public R handleData(OrderInfoDTO orderInfoDTO) throws CustomerException { //先保存原始请求数据 - PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog(); + OrderStatusLog panOrderStatusLog = new OrderStatusLog(); panOrderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO)); panOrderStatusLog.setStatus(1); panOrderStatusLog.setType(1); @@ -167,7 +167,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { public R handleStatusData(OrderStatusDTO orderStatusDTO) throws CustomerException { //先保存原始请求数据 - PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog(); + OrderStatusLog panOrderStatusLog = new OrderStatusLog(); panOrderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO)); panOrderStatusLog.setStatus(1); panOrderStatusLog.setType(2); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanOrderStatusLogServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanOrderStatusLogServiceImpl.java deleted file mode 100644 index c69058c1a..000000000 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanOrderStatusLogServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.logpm.factory.snm.service.impl; - -import com.logpm.factory.snm.entity.PanOrderStatusLog; -import com.logpm.factory.snm.mapper.PanOrderStatusLogMapper; -import com.logpm.factory.snm.service.IPanOrderStatusLogService; -import lombok.AllArgsConstructor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springframework.stereotype.Service; - -@AllArgsConstructor -@Service -public class PanOrderStatusLogServiceImpl extends BaseServiceImpl implements IPanOrderStatusLogService { - - private static final Logger logger = LoggerFactory.getLogger(PanOrderStatusLogServiceImpl.class); - - -}