From 58e8d7abc372407174b314ff6e04576da4997324 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sun, 25 Jun 2023 14:14:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=90=88=E5=B9=B6mq=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=90=84=E4=B8=AA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FactoryAuthController.java | 7 +- .../controller/FactoryCommonController.java | 111 ++++++++ .../dto/FactoryAccountDTO.java | 2 +- .../{snm => comfac}/dto/OrderInfoDTO.java | 2 +- .../{snm => comfac}/dto/OrderStatusDTO.java | 2 +- .../mapper/FactoryAccountMapper.java | 2 +- .../mapper/FactoryAccountMapper.xml | 2 +- .../mapper/FactoryTokenMapper.java | 2 +- .../mapper/FactoryTokenMapper.xml | 2 +- .../mapper/OrderStatusLogMapper.java | 2 +- .../mapper/OrderStatusLogMapper.xml | 2 +- .../service/IAsyncDataService.java | 2 +- .../service/IFactoryAccountService.java | 2 +- .../service/IFactoryAuthService.java | 2 +- .../service/IFactoryTokenService.java | 2 +- .../service/IOrderStatusLogService.java | 2 +- .../service/impl/AsyncDataServiceImpl.java | 10 +- .../impl/FactoryAccountServiceImpl.java | 6 +- .../service/impl/FactoryAuthServiceImpl.java | 8 +- .../service/impl/FactoryTokenServiceImpl.java | 6 +- .../impl/OrderStatusLogServiceImpl.java | 6 +- .../config/InterceptorAdapterConfig.java | 2 +- .../FactoryAccountsInterceptor.java | 2 +- .../controller/MtFactoryDataController.java | 4 +- .../mapper/MtFactoryOrderMainMapper.java | 2 +- .../mt/mapper/MtFactoryOrderMainMapper.xml | 20 ++ .../service/IMtFactoryDataService.java | 2 +- .../service/IMtFactoryOrderMainService.java | 2 +- .../impl/MtFactoryDataServiceImpl.java | 6 +- .../impl/MtFactoryOrderMainServiceImpl.java | 6 +- .../controller/PanFactoryDataController.java | 143 +++++++++++ .../{snm => pan}/dto/PanFactoryOrderDTO.java | 2 +- .../{snm => pan}/dto/PanPackageInfoDTO.java | 2 +- .../{snm => pan}/dto/PanPackageListDTO.java | 2 +- .../mapper/PanFactoryOrderMapper.java | 2 +- .../mapper/PanFactoryOrderMapper.xml | 2 +- .../mapper/PanPackageInfoMapper.java | 2 +- .../mapper/PanPackageInfoMapper.xml | 2 +- .../mapper/PanPackageListMapper.java | 2 +- .../mapper/PanPackageListMapper.xml | 2 +- .../service/IPanFactoryDataService.java | 10 +- .../service/IPanFactoryOrderService.java | 2 +- .../service/IPanPackageInfoService.java | 2 +- .../service/IPanPackageListService.java | 2 +- .../impl/PanFactoryDataServiceImpl.java | 52 +++- .../impl/PanFactoryOrderServiceImpl.java | 6 +- .../impl/PanPackageInfoServiceImpl.java | 6 +- .../impl/PanPackageListServiceImpl.java | 6 +- .../factory/receiver/DealWithDataHandler.java | 4 +- .../factory/receiver/ErrorQueueHandler.java | 2 +- .../factory/receiver/OpenOrderHandler.java | 4 +- .../controller/PanFactoryDataController.java | 240 ------------------ .../snm/mapper/MtFactoryOrderMainMapper.xml | 20 -- 53 files changed, 398 insertions(+), 347 deletions(-) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/controller/FactoryAuthController.java (92%) create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/dto/FactoryAccountDTO.java (78%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/dto/OrderInfoDTO.java (97%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/dto/OrderStatusDTO.java (98%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/mapper/FactoryAccountMapper.java (96%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/mapper/FactoryAccountMapper.xml (93%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/mapper/FactoryTokenMapper.java (96%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/mapper/FactoryTokenMapper.xml (93%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/mapper/OrderStatusLogMapper.java (96%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/mapper/OrderStatusLogMapper.xml (93%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/IAsyncDataService.java (63%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/IFactoryAccountService.java (84%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/IFactoryAuthService.java (85%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/IFactoryTokenService.java (89%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/IOrderStatusLogService.java (81%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/impl/AsyncDataServiceImpl.java (97%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/impl/FactoryAccountServiceImpl.java (74%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/impl/FactoryAuthServiceImpl.java (92%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/impl/FactoryTokenServiceImpl.java (90%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => comfac}/service/impl/OrderStatusLogServiceImpl.java (74%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => mt}/mapper/MtFactoryOrderMainMapper.java (83%) create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => mt}/service/IMtFactoryDataService.java (83%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => mt}/service/IMtFactoryOrderMainService.java (83%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => mt}/service/impl/MtFactoryDataServiceImpl.java (87%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => mt}/service/impl/MtFactoryOrderMainServiceImpl.java (68%) create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/dto/PanFactoryOrderDTO.java (92%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/dto/PanPackageInfoDTO.java (93%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/dto/PanPackageListDTO.java (76%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/mapper/PanFactoryOrderMapper.java (96%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/mapper/PanFactoryOrderMapper.xml (94%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/mapper/PanPackageInfoMapper.java (96%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/mapper/PanPackageInfoMapper.xml (94%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/mapper/PanPackageListMapper.java (96%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/mapper/PanPackageListMapper.xml (94%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/IPanFactoryDataService.java (51%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/IPanFactoryOrderService.java (85%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/IPanPackageInfoService.java (85%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/IPanPackageListService.java (82%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/impl/PanFactoryDataServiceImpl.java (89%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/impl/PanFactoryOrderServiceImpl.java (75%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/impl/PanPackageInfoServiceImpl.java (75%) rename blade-service/logpm-factory/src/main/java/com/logpm/factory/{snm => pan}/service/impl/PanPackageListServiceImpl.java (75%) delete mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java delete mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.xml diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/FactoryAuthController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryAuthController.java similarity index 92% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/FactoryAuthController.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryAuthController.java index 01fc484c5..08343dd18 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/FactoryAuthController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryAuthController.java @@ -14,12 +14,11 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.controller; +package com.logpm.factory.comfac.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.logpm.factory.snm.dto.FactoryAccountDTO; -import com.logpm.factory.snm.service.IFactoryAuthService; -import com.logpm.factory.snm.service.IPanFactoryDataService; +import com.logpm.factory.comfac.dto.FactoryAccountDTO; +import com.logpm.factory.comfac.service.IFactoryAuthService; import com.logpm.factory.snm.vo.FactoryTokenVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java new file mode 100644 index 000000000..141788972 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java @@ -0,0 +1,111 @@ +package com.logpm.factory.comfac.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.factory.comfac.service.IOrderStatusLogService; +import com.logpm.factory.comfac.dto.OrderInfoDTO; +import com.logpm.factory.comfac.dto.OrderStatusDTO; +import com.logpm.factory.snm.entity.OrderStatusLog; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springblade.common.constant.RabbitConstant; +import org.springblade.common.exception.CustomerException; +import org.springblade.common.utils.CommonUtil; +import org.springblade.core.tool.api.R; +import org.springframework.amqp.rabbit.connection.CorrelationData; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Log4j2 +@RestController +@AllArgsConstructor +@RequestMapping("/factory/common") +@Api(value = "工厂通用数据", tags = "工厂通用接口") +public class FactoryCommonController { + + private final RabbitTemplate rabbitTemplate; + private final IOrderStatusLogService orderStatusLogService; + + @ResponseBody + @PostMapping("/sendOrders") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订单数据推送", notes = "传入orderInfoDTO") + public R sendOrders(@Validated @RequestBody OrderInfoDTO orderInfoDTO) { + log.info("############sendOrders: 请求参数{}",orderInfoDTO); + try{ + + //先保存原始请求数据 + OrderStatusLog orderStatusLog = new OrderStatusLog(); + orderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO)); + orderStatusLog.setStatus(1); + orderStatusLog.setType(1); + orderStatusLogService.save(orderStatusLog); + + Map map=new HashMap<>(); + map.put("messageId", CommonUtil.getUUID()); + map.put("logId", orderStatusLog.getId()); + map.put("messageData",orderInfoDTO); + map.put("createTime",new Date().getTime()); + //将消息携带绑定键值 + rabbitTemplate.convertAndSend(RabbitConstant.OPEN_ORDER_EXCHANGE, RabbitConstant.OPEN_ORDER_ROUTING, map,new CorrelationData(String.valueOf(orderStatusLog.getId()))); + +// R r = factoryDataService.handleData(orderInfoDTO); + return R.success("调用成功"); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error("############sendOrders: 系统异常",e); + return R.fail(500,"############sendOrders: 系统异常"); + } + } + + + @ResponseBody + @PostMapping("/sendOrderStatus") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO") + public R sendOrderStatus(@RequestBody OrderStatusDTO orderStatusDTO) { + log.info("############sendOrderStatus: 请求参数{}",orderStatusDTO); + try{ + + //先保存原始请求数据 + OrderStatusLog orderStatusLog = new OrderStatusLog(); + orderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO)); + orderStatusLog.setStatus(1); + orderStatusLog.setType(2); + orderStatusLogService.save(orderStatusLog); + + Map map=new HashMap<>(); + map.put("messageId", CommonUtil.getUUID()); + map.put("logId", orderStatusLog.getId()); + map.put("type", "Push"); + map.put("messageData",orderStatusDTO); + map.put("createTime",new Date().getTime()); + //将消息携带绑定键值 + rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map); + map.put("type", "DealWith"); + rabbitTemplate.convertAndSend(RabbitConstant.DEAL_WITH_EXCHANGE, RabbitConstant.DEAL_WITH_ROUTING,map); + + +// R r = factoryDataService.handleStatusData(orderStatusDTO); + return R.success("调用成功"); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error("############sendOrderStatus: 系统异常",e); + return R.fail(500,"############sendOrderStatus: 系统异常"); + } + } + + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/FactoryAccountDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/FactoryAccountDTO.java similarity index 78% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/FactoryAccountDTO.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/FactoryAccountDTO.java index a0fb26e44..28535b6f0 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/FactoryAccountDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/FactoryAccountDTO.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.dto; +package com.logpm.factory.comfac.dto; import com.logpm.factory.snm.entity.FactoryAccount; import lombok.Data; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderInfoDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderInfoDTO.java similarity index 97% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderInfoDTO.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderInfoDTO.java index 365f29449..21a6a74e1 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderInfoDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderInfoDTO.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.dto; +package com.logpm.factory.comfac.dto; import lombok.Data; import org.springblade.core.tool.utils.StringUtil; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderStatusDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java similarity index 98% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderStatusDTO.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java index 852b4f929..7be76e04f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderStatusDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.dto; +package com.logpm.factory.comfac.dto; import lombok.Data; import org.springblade.core.tool.utils.StringUtil; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.java similarity index 96% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.java index f1af7eb5f..c264a97e2 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.comfac.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.FactoryAccount; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.xml similarity index 93% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.xml index a61c851ff..c1315d86e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.java similarity index 96% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.java index 25c4b28e8..553be22ea 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.comfac.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.FactoryToken; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.xml similarity index 93% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.xml index cf1083dff..471673931 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.java similarity index 96% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.java index 04b6b31b1..8d3e53777 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.comfac.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.OrderStatusLog; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.xml similarity index 93% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.xml index 3e4056f86..297d59f06 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/OrderStatusLogMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IAsyncDataService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java similarity index 63% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IAsyncDataService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java index 30c5e7d4b..9bb44b4fc 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IAsyncDataService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.comfac.service; public interface IAsyncDataService { diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAccountService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAccountService.java similarity index 84% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAccountService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAccountService.java index f737da042..27ee773ef 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAccountService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAccountService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.comfac.service; import com.logpm.factory.snm.entity.FactoryAccount; import org.springblade.core.mp.base.BaseService; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAuthService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAuthService.java similarity index 85% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAuthService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAuthService.java index 63b3f2a16..6270f7faf 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAuthService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAuthService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.comfac.service; import com.logpm.factory.snm.vo.FactoryTokenVO; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryTokenService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryTokenService.java similarity index 89% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryTokenService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryTokenService.java index 6e6982cc9..68f9369e0 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryTokenService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryTokenService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.comfac.service; import com.logpm.factory.snm.entity.FactoryToken; import org.springblade.core.mp.base.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/comfac/service/IOrderStatusLogService.java similarity index 81% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IOrderStatusLogService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IOrderStatusLogService.java index 2c0de1db6..912a82151 100644 --- 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/comfac/service/IOrderStatusLogService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.comfac.service; import com.logpm.factory.snm.entity.OrderStatusLog; import org.springblade.core.mp.base.BaseService; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java similarity index 97% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/AsyncDataServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index 2bb41662b..1d5f419e9 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.comfac.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -6,10 +6,10 @@ import com.logpm.factory.snm.constant.PanFactoryEnum; import com.logpm.factory.snm.entity.PanFactoryOrder; import com.logpm.factory.snm.entity.PanPackageInfo; import com.logpm.factory.snm.entity.PanPackageList; -import com.logpm.factory.snm.service.IAsyncDataService; -import com.logpm.factory.snm.service.IPanFactoryOrderService; -import com.logpm.factory.snm.service.IPanPackageInfoService; -import com.logpm.factory.snm.service.IPanPackageListService; +import com.logpm.factory.comfac.service.IAsyncDataService; +import com.logpm.factory.pan.service.IPanFactoryOrderService; +import com.logpm.factory.pan.service.IPanPackageInfoService; +import com.logpm.factory.pan.service.IPanPackageListService; import com.logpm.oldproject.entity.AdvanceDetailEntity; import com.logpm.oldproject.entity.AdvanceEntity; import com.logpm.oldproject.entity.DetailProductEntity; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAccountServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAccountServiceImpl.java similarity index 74% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAccountServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAccountServiceImpl.java index 56f1e4a77..c6b7766a0 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAccountServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAccountServiceImpl.java @@ -1,8 +1,8 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.comfac.service.impl; import com.logpm.factory.snm.entity.FactoryAccount; -import com.logpm.factory.snm.mapper.FactoryAccountMapper; -import com.logpm.factory.snm.service.IFactoryAccountService; +import com.logpm.factory.comfac.mapper.FactoryAccountMapper; +import com.logpm.factory.comfac.service.IFactoryAccountService; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAuthServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAuthServiceImpl.java similarity index 92% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAuthServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAuthServiceImpl.java index ae76876b8..67577e433 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAuthServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAuthServiceImpl.java @@ -1,12 +1,12 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.comfac.service.impl; import com.alibaba.nacos.common.utils.MD5Utils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.factory.snm.entity.FactoryAccount; import com.logpm.factory.snm.entity.FactoryToken; -import com.logpm.factory.snm.service.IFactoryAccountService; -import com.logpm.factory.snm.service.IFactoryAuthService; -import com.logpm.factory.snm.service.IFactoryTokenService; +import com.logpm.factory.comfac.service.IFactoryAccountService; +import com.logpm.factory.comfac.service.IFactoryAuthService; +import com.logpm.factory.comfac.service.IFactoryTokenService; import com.logpm.factory.snm.vo.FactoryTokenVO; import lombok.AllArgsConstructor; import org.slf4j.Logger; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryTokenServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java similarity index 90% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryTokenServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java index 2138208ef..6d17dbee9 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryTokenServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java @@ -1,10 +1,10 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.comfac.service.impl; import com.alibaba.nacos.common.utils.MD5Utils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.factory.snm.entity.FactoryToken; -import com.logpm.factory.snm.mapper.FactoryTokenMapper; -import com.logpm.factory.snm.service.IFactoryTokenService; +import com.logpm.factory.comfac.mapper.FactoryTokenMapper; +import com.logpm.factory.comfac.service.IFactoryTokenService; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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/comfac/service/impl/OrderStatusLogServiceImpl.java similarity index 74% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderStatusLogServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/OrderStatusLogServiceImpl.java index 305b4ec25..21626c0cd 100644 --- 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/comfac/service/impl/OrderStatusLogServiceImpl.java @@ -1,8 +1,8 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.comfac.service.impl; import com.logpm.factory.snm.entity.OrderStatusLog; -import com.logpm.factory.snm.mapper.OrderStatusLogMapper; -import com.logpm.factory.snm.service.IOrderStatusLogService; +import com.logpm.factory.comfac.mapper.OrderStatusLogMapper; +import com.logpm.factory.comfac.service.IOrderStatusLogService; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java index c73a0215b..1c5427209 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java @@ -1,7 +1,7 @@ package com.logpm.factory.config; import com.logpm.factory.interceptor.FactoryAccountsInterceptor; -import com.logpm.factory.snm.service.IFactoryTokenService; +import com.logpm.factory.comfac.service.IFactoryTokenService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistration; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java index b8c4999e4..515226d88 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java @@ -2,7 +2,7 @@ package com.logpm.factory.interceptor; import com.alibaba.fastjson.JSONObject; import com.logpm.factory.config.RequestWrapper; -import com.logpm.factory.snm.service.IFactoryTokenService; +import com.logpm.factory.comfac.service.IFactoryTokenService; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springblade.common.exception.CustomerException; 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 index b153d4b44..7dc949ffc 100644 --- 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 @@ -21,8 +21,8 @@ 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 com.logpm.factory.mt.service.IMtFactoryDataService; +import com.logpm.factory.comfac.service.IOrderStatusLogService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; 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/mt/mapper/MtFactoryOrderMainMapper.java similarity index 83% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.java index 5be6cb8c7..6788a3f90 100644 --- 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/mt/mapper/MtFactoryOrderMainMapper.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.mt.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.MtFactoryOrderMain; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml new file mode 100644 index 000000000..9cbe524ab --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + 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/mt/service/IMtFactoryDataService.java similarity index 83% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryDataService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java index f0d37d1ce..8c5bf8d68 100644 --- 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/mt/service/IMtFactoryDataService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.mt.service; import com.logpm.factory.mt.dto.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/mt/service/IMtFactoryOrderMainService.java similarity index 83% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IMtFactoryOrderMainService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java index e44d9a8b2..ed5af06df 100644 --- 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/mt/service/IMtFactoryOrderMainService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.mt.service; import com.logpm.factory.snm.entity.MtFactoryOrderMain; import org.springblade.core.mp.base.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/mt/service/impl/MtFactoryDataServiceImpl.java similarity index 87% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryDataServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java index ca983967d..e7249aa35 100644 --- 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/mt/service/impl/MtFactoryDataServiceImpl.java @@ -1,10 +1,10 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.mt.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 com.logpm.factory.mt.service.IMtFactoryDataService; +import com.logpm.factory.mt.service.IMtFactoryOrderMainService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; 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/mt/service/impl/MtFactoryOrderMainServiceImpl.java similarity index 68% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/MtFactoryOrderMainServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java index cc557b5bb..81fc033fc 100644 --- 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/mt/service/impl/MtFactoryOrderMainServiceImpl.java @@ -1,8 +1,8 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.mt.service.impl; import com.logpm.factory.snm.entity.MtFactoryOrderMain; -import com.logpm.factory.snm.mapper.MtFactoryOrderMainMapper; -import com.logpm.factory.snm.service.IMtFactoryOrderMainService; +import com.logpm.factory.mt.mapper.MtFactoryOrderMainMapper; +import com.logpm.factory.mt.service.IMtFactoryOrderMainService; import lombok.AllArgsConstructor; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java new file mode 100644 index 000000000..974b778b0 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java @@ -0,0 +1,143 @@ +/* + * 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.pan.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.factory.comfac.service.IAsyncDataService; +import com.logpm.factory.comfac.service.IOrderStatusLogService; +import com.logpm.factory.pan.dto.PanFactoryOrderDTO; +import com.logpm.factory.pan.service.IPanFactoryDataService; +import com.logpm.factory.pan.service.IPanFactoryOrderService; +import com.logpm.factory.pan.service.IPanPackageInfoService; +import com.logpm.factory.pan.service.IPanPackageListService; +import com.logpm.factory.snm.bean.Resp; +import com.logpm.factory.snm.entity.OrderStatusLog; +import com.logpm.factory.snm.entity.PanFactoryOrder; +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.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * 皮阿诺数据 控制器 + * + * @author zhy + * @since 2023-06-06 + */ +@Log4j2 +@RestController +@AllArgsConstructor +@RequestMapping("/factory/pan") +@Api(value = "工厂数据", tags = "工厂数据接口") +public class PanFactoryDataController extends BladeController { + + private final IPanFactoryOrderService factoryOrderService; + private final IPanPackageInfoService packageInfoService; + private final IPanPackageListService packageListService; + private final IPanFactoryDataService panFactoryDataService; + private final IAsyncDataService syncDataService; + private RabbitTemplate rabbitTemplate; + private final IOrderStatusLogService panOrderStatusLogService; + +// @ResponseBody +// @PostMapping("/token") +// @ApiOperationSupport(order = 1) +// @ApiOperation(value = "获取token推送", notes = "传入factoryAccountDTO") +// public R token(@Validated @RequestBody FactoryAccountDTO factoryAccountDTO, HttpServletResponse response) { +// log.info("############token: 获取账号token"); +// //通过企业id 应用id 秘钥 获取对应的token +// String corpid = factoryAccountDTO.getCorpid();//企业id +// String appkey = factoryAccountDTO.getAppkey();//应用id +// String appsecret = factoryAccountDTO.getAppsecret();//秘钥 +// +// try{ +// FactoryTokenVO factoryTokenVO = factoryDataService.getToken(corpid,appkey,appsecret); +// String token = factoryTokenVO.getToken(); +// //把token放入头 +// response.setHeader("Authorization",token); +// return R.data(factoryTokenVO); +// }catch (CustomerException e){ +// log.error(e.getMessage(),e); +// return R.fail(e.code,e.message); +// }catch (Exception e){ +// log.error(e.getMessage(),e); +// return R.fail(400,e.getMessage()); +// } +// } + + + + /** + * 工厂数据推送接口 + */ + @ResponseBody + @PostMapping("/data") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "通常数据推送", notes = "传入factoryOrderDTO") + public Resp data(@Validated @RequestBody PanFactoryOrderDTO factoryOrderDTO, HttpServletRequest request) { + log.info("############data: "); + String corpId = request.getHeader("corpId"); + factoryOrderDTO.setCorpid(corpId); + + //先保存原始请求数据 + OrderStatusLog panOrderStatusLog = new OrderStatusLog(); + panOrderStatusLog.setArgs(JSONObject.toJSONString(factoryOrderDTO)); + panOrderStatusLog.setStatus(1); + panOrderStatusLog.setType(3); + panOrderStatusLog.setBrand("皮阿诺"); + panOrderStatusLogService.save(panOrderStatusLog); + + //判断数据是否已存入 + 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,"订单数据已存在"); + } + + try{ + panFactoryDataService.saveData(factoryOrderDTO); + panOrderStatusLog.setStatus(0); + }catch (Exception e){ + log.warn("############data: 保存数据失败 orderNo={}",orderNo); + //修改保存数据的状态 + panOrderStatusLog.setStatus(2); + } + panOrderStatusLogService.saveOrUpdate(panOrderStatusLog); + + //开启异步线程处理数据 + syncDataService.handlerPanDataToHt(); + + return Resp.successOrderNo(factoryOrderDTO.getOrderNo(),factoryOrderDTO.getDeliveryNumber(),"SUCCESS"); + } + + + + + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanFactoryOrderDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanFactoryOrderDTO.java similarity index 92% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanFactoryOrderDTO.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanFactoryOrderDTO.java index b82b25b1a..3ab5aa863 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanFactoryOrderDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanFactoryOrderDTO.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.dto; +package com.logpm.factory.pan.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.logpm.factory.snm.entity.PanFactoryOrder; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageInfoDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageInfoDTO.java similarity index 93% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageInfoDTO.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageInfoDTO.java index fc2201a6c..331531f4b 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageInfoDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageInfoDTO.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.dto; +package com.logpm.factory.pan.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.logpm.factory.snm.entity.PanPackageInfo; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageListDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageListDTO.java similarity index 76% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageListDTO.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageListDTO.java index 21f97d68a..368e837d2 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageListDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageListDTO.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.dto; +package com.logpm.factory.pan.dto; import com.logpm.factory.snm.entity.PanPackageList; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.java similarity index 96% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.java index 2fed1de42..72282acfb 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.pan.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.PanFactoryOrder; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.xml similarity index 94% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.xml index bd0c7d410..45ffbe62a 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.java similarity index 96% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.java index 0fc1935bd..db27c6ce9 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.pan.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.PanPackageInfo; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.xml similarity index 94% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.xml index 0c5fd7074..396503d55 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageListMapper.java similarity index 96% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageListMapper.java index 820831ab6..9c35ad15e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageListMapper.java @@ -14,7 +14,7 @@ * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ -package com.logpm.factory.snm.mapper; +package com.logpm.factory.pan.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factory.snm.entity.PanPackageList; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageListMapper.xml similarity index 94% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.xml rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageListMapper.xml index cbd578f9b..e4d9ed3d3 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageListMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageListMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryDataService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java similarity index 51% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryDataService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java index 003238c1d..f0549aedd 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryDataService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java @@ -1,7 +1,8 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.pan.service; -import com.logpm.factory.snm.dto.OrderInfoDTO; -import com.logpm.factory.snm.dto.OrderStatusDTO; +import com.logpm.factory.comfac.dto.OrderInfoDTO; +import com.logpm.factory.comfac.dto.OrderStatusDTO; +import com.logpm.factory.pan.dto.PanFactoryOrderDTO; import org.springblade.core.tool.api.R; /** @@ -16,5 +17,6 @@ public interface IPanFactoryDataService { R handleStatusData(OrderStatusDTO orderStatusDTO); void handleDataToPlatform(String unitNo); - + + void saveData(PanFactoryOrderDTO factoryOrderDTO); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryOrderService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryOrderService.java similarity index 85% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryOrderService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryOrderService.java index 8e0ec1d52..9d50e7fc9 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanFactoryOrderService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryOrderService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.pan.service; import com.logpm.factory.snm.entity.PanFactoryOrder; import org.springblade.core.mp.base.BaseService; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageInfoService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanPackageInfoService.java similarity index 85% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageInfoService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanPackageInfoService.java index 8a135d893..5bd3dd972 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageInfoService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanPackageInfoService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.pan.service; import com.logpm.factory.snm.entity.PanPackageInfo; import org.springblade.core.mp.base.BaseService; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageListService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanPackageListService.java similarity index 82% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageListService.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanPackageListService.java index 828040571..9a776570c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IPanPackageListService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanPackageListService.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service; +package com.logpm.factory.pan.service; import com.logpm.factory.snm.entity.PanPackageList; import org.springblade.core.mp.base.BaseService; 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/pan/service/impl/PanFactoryDataServiceImpl.java similarity index 89% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index 181ada612..f8b53c9ac 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/pan/service/impl/PanFactoryDataServiceImpl.java @@ -1,4 +1,4 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.pan.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.http.HttpRequest; @@ -10,17 +10,20 @@ import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; import com.logpm.distribution.feign.IDistributionStockArticleClient; +import com.logpm.factory.comfac.dto.OrderInfoDTO; +import com.logpm.factory.comfac.dto.OrderStatusDTO; +import com.logpm.factory.comfac.service.IOrderStatusLogService; +import com.logpm.factory.pan.dto.*; +import com.logpm.factory.pan.service.IPanFactoryDataService; +import com.logpm.factory.pan.service.IPanFactoryOrderService; +import com.logpm.factory.pan.service.IPanPackageInfoService; +import com.logpm.factory.pan.service.IPanPackageListService; import com.logpm.factory.props.PanFactoryProperties; 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.OrderStatusLog; +import com.logpm.factory.snm.entity.PanFactoryOrder; 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.IOrderStatusLogService; -import com.logpm.factory.snm.service.IPanPackageInfoService; +import com.logpm.factory.snm.entity.PanPackageList; import com.logpm.oldproject.entity.AdvanceDetailEntity; import com.logpm.oldproject.entity.AdvanceEntity; import com.logpm.oldproject.entity.OrderEntity; @@ -50,6 +53,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { // private final IFactoryTokenService factoryTokenService; private final IPanFactoryOrderService factoryOrderService; + private final IPanPackageInfoService packageInfoService; + private final IPanPackageListService packageListService; private final PanFactoryProperties panFactoryProperties; private final IOrderStatusLogService panOrderStatusLogService; @@ -370,4 +375,35 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } } + @Transactional + @Override + public void saveData(PanFactoryOrderDTO factoryOrderDTO) { + PanFactoryOrder factoryOrder = new PanFactoryOrder(); + BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); + //保存订单数据 + 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); + } + } + } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryOrderServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryOrderServiceImpl.java similarity index 75% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryOrderServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryOrderServiceImpl.java index 7aa0d94ad..ea38ed49f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryOrderServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryOrderServiceImpl.java @@ -1,8 +1,8 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.pan.service.impl; import com.logpm.factory.snm.entity.PanFactoryOrder; -import com.logpm.factory.snm.mapper.PanFactoryOrderMapper; -import com.logpm.factory.snm.service.IPanFactoryOrderService; +import com.logpm.factory.pan.mapper.PanFactoryOrderMapper; +import com.logpm.factory.pan.service.IPanFactoryOrderService; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageInfoServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanPackageInfoServiceImpl.java similarity index 75% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageInfoServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanPackageInfoServiceImpl.java index 22d759968..1d641ac3f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageInfoServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanPackageInfoServiceImpl.java @@ -1,8 +1,8 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.pan.service.impl; import com.logpm.factory.snm.entity.PanPackageInfo; -import com.logpm.factory.snm.mapper.PanPackageInfoMapper; -import com.logpm.factory.snm.service.IPanPackageInfoService; +import com.logpm.factory.pan.mapper.PanPackageInfoMapper; +import com.logpm.factory.pan.service.IPanPackageInfoService; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageListServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanPackageListServiceImpl.java similarity index 75% rename from blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageListServiceImpl.java rename to blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanPackageListServiceImpl.java index f4de7b4f1..921452e7f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanPackageListServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanPackageListServiceImpl.java @@ -1,8 +1,8 @@ -package com.logpm.factory.snm.service.impl; +package com.logpm.factory.pan.service.impl; import com.logpm.factory.snm.entity.PanPackageList; -import com.logpm.factory.snm.mapper.PanPackageListMapper; -import com.logpm.factory.snm.service.IPanPackageListService; +import com.logpm.factory.pan.mapper.PanPackageListMapper; +import com.logpm.factory.pan.service.IPanPackageListService; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java index 5c7314161..02712afe2 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java @@ -1,7 +1,7 @@ package com.logpm.factory.receiver; -import com.logpm.factory.snm.dto.OrderStatusDTO; -import com.logpm.factory.snm.service.IPanFactoryDataService; +import com.logpm.factory.comfac.dto.OrderStatusDTO; +import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.oldproject.feign.IAdvanceDetailClient; import com.rabbitmq.client.Channel; import lombok.extern.slf4j.Slf4j; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ErrorQueueHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ErrorQueueHandler.java index 8410156ec..29e491e7d 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ErrorQueueHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ErrorQueueHandler.java @@ -2,7 +2,7 @@ package com.logpm.factory.receiver; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.logpm.factory.snm.entity.OrderStatusLog; -import com.logpm.factory.snm.service.IOrderStatusLogService; +import com.logpm.factory.comfac.service.IOrderStatusLogService; import com.rabbitmq.client.Channel; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RabbitConstant; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java index bb1787d7e..fbad5d14c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java @@ -1,7 +1,7 @@ package com.logpm.factory.receiver; -import com.logpm.factory.snm.dto.OrderInfoDTO; -import com.logpm.factory.snm.service.IPanFactoryDataService; +import com.logpm.factory.comfac.dto.OrderInfoDTO; +import com.logpm.factory.pan.service.IPanFactoryDataService; import com.rabbitmq.client.Channel; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RabbitConstant; 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 deleted file mode 100644 index 0746f1dc9..000000000 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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.snm.controller; - -import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -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.OrderStatusLog; -import com.logpm.factory.snm.entity.PanPackageInfo; -import com.logpm.factory.snm.entity.PanPackageList; -import com.logpm.factory.snm.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import lombok.extern.log4j.Log4j2; -import org.springblade.common.constant.RabbitConstant; -import org.springblade.common.exception.CustomerException; -import org.springblade.common.utils.CommonUtil; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.tool.api.R; -import org.springframework.amqp.rabbit.connection.CorrelationData; -import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.*; - -/** - * 皮阿诺数据 控制器 - * - * @author zhy - * @since 2023-06-06 - */ -@Log4j2 -@RestController -@AllArgsConstructor -@RequestMapping("/factory/pan") -@Api(value = "工厂数据", tags = "工厂数据接口") -public class PanFactoryDataController extends BladeController { - - private final IPanFactoryOrderService factoryOrderService; - private final IPanPackageInfoService packageInfoService; - private final IPanPackageListService packageListService; - private final IPanFactoryDataService factoryDataService; - private final IAsyncDataService syncDataService; - private RabbitTemplate rabbitTemplate; - private final IOrderStatusLogService panOrderStatusLogService; - -// @ResponseBody -// @PostMapping("/token") -// @ApiOperationSupport(order = 1) -// @ApiOperation(value = "获取token推送", notes = "传入factoryAccountDTO") -// public R token(@Validated @RequestBody FactoryAccountDTO factoryAccountDTO, HttpServletResponse response) { -// log.info("############token: 获取账号token"); -// //通过企业id 应用id 秘钥 获取对应的token -// String corpid = factoryAccountDTO.getCorpid();//企业id -// String appkey = factoryAccountDTO.getAppkey();//应用id -// String appsecret = factoryAccountDTO.getAppsecret();//秘钥 -// -// try{ -// FactoryTokenVO factoryTokenVO = factoryDataService.getToken(corpid,appkey,appsecret); -// String token = factoryTokenVO.getToken(); -// //把token放入头 -// response.setHeader("Authorization",token); -// return R.data(factoryTokenVO); -// }catch (CustomerException e){ -// log.error(e.getMessage(),e); -// return R.fail(e.code,e.message); -// }catch (Exception e){ -// log.error(e.getMessage(),e); -// return R.fail(400,e.getMessage()); -// } -// } - - - - /** - * 工厂数据推送接口 - */ - @ResponseBody - @PostMapping("/data") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "通常数据推送", notes = "传入factoryOrderDTO") - public Resp data(@Validated @RequestBody PanFactoryOrderDTO factoryOrderDTO, HttpServletRequest request) { - log.info("############data: "); - String corpId = request.getHeader("corpId"); - - //先保存原始请求数据 - OrderStatusLog panOrderStatusLog = new OrderStatusLog(); - panOrderStatusLog.setArgs(JSONObject.toJSONString(factoryOrderDTO)); - panOrderStatusLog.setStatus(1); - panOrderStatusLog.setType(3); - panOrderStatusLogService.save(panOrderStatusLog); - - //判断数据是否已存入 - 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.successOrderNo(factoryOrder.getOrderNo(),factoryOrder.getDeliveryNumber(),"SUCCESS"); - } - - - @ResponseBody - @PostMapping("/sendOrders") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "订单数据推送", notes = "传入orderInfoDTO") - public R sendOrders(@Validated @RequestBody OrderInfoDTO orderInfoDTO) { - log.info("############sendOrders: 请求参数{}",orderInfoDTO); - try{ - - //先保存原始请求数据 - OrderStatusLog panOrderStatusLog = new OrderStatusLog(); - panOrderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO)); - panOrderStatusLog.setStatus(1); - panOrderStatusLog.setType(1); - panOrderStatusLogService.save(panOrderStatusLog); - - Map map=new HashMap<>(); - map.put("messageId", CommonUtil.getUUID()); - map.put("logId", panOrderStatusLog.getId()); - map.put("messageData",orderInfoDTO); - map.put("createTime",new Date().getTime()); - //将消息携带绑定键值 - rabbitTemplate.convertAndSend(RabbitConstant.OPEN_ORDER_EXCHANGE, RabbitConstant.OPEN_ORDER_ROUTING, map,new CorrelationData(String.valueOf(panOrderStatusLog.getId()))); - -// R r = factoryDataService.handleData(orderInfoDTO); - return R.success("调用成功"); - }catch (CustomerException e){ - log.error(e.message,e); - return R.fail(e.code,e.message); - }catch (Exception e){ - log.error("############sendOrders: 系统异常",e); - return R.fail(500,"############sendOrders: 系统异常"); - } - } - - - @ResponseBody - @PostMapping("/sendOrderStatus") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO") - public R sendOrderStatus(@RequestBody OrderStatusDTO orderStatusDTO) { - log.info("############sendOrderStatus: 请求参数{}",orderStatusDTO); - try{ - - //先保存原始请求数据 - OrderStatusLog panOrderStatusLog = new OrderStatusLog(); - panOrderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO)); - panOrderStatusLog.setStatus(1); - panOrderStatusLog.setType(2); - panOrderStatusLogService.save(panOrderStatusLog); - - Map map=new HashMap<>(); - map.put("messageId", CommonUtil.getUUID()); - map.put("logId", panOrderStatusLog.getId()); - map.put("type", "Push"); - map.put("messageData",orderStatusDTO); - map.put("createTime",new Date().getTime()); - //将消息携带绑定键值 - rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map); - map.put("type", "DealWith"); - rabbitTemplate.convertAndSend(RabbitConstant.DEAL_WITH_EXCHANGE, RabbitConstant.DEAL_WITH_ROUTING,map); - - -// R r = factoryDataService.handleStatusData(orderStatusDTO); - return R.success("调用成功"); - }catch (CustomerException e){ - log.error(e.message,e); - return R.fail(e.code,e.message); - }catch (Exception e){ - log.error("############sendOrderStatus: 系统异常",e); - return R.fail(500,"############sendOrderStatus: 系统异常"); - } - } - - -} 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 deleted file mode 100644 index 5093c771a..000000000 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/MtFactoryOrderMainMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - -