From b4c983f227987631acdfbcb0b3aa720691137df7 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 26 Jan 2024 17:04:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A1=A5=E4=B8=81=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8C=85=E4=BB=B6=E7=AD=BE=E6=94=B6=E5=AE=8C?= =?UTF-8?q?=EF=BC=8C=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E6=9C=AA=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E7=9A=84=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patch/jobhandle/OrderDataRepair.java | 40 +++++++++++++++++++ .../logpm/patch/mapper/OrderDataMapper.java | 16 ++++++++ .../logpm/patch/mapper/OrderDataMapper.xml | 21 ++++++++++ .../patch/service/IOrderDataService.java | 9 +++++ .../service/impl/OrderDataServiceImpl.java | 28 +++++++++++++ 5 files changed, 114 insertions(+) create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java new file mode 100644 index 000000000..b0fb86d2e --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java @@ -0,0 +1,40 @@ +package com.logpm.patch.jobhandle; + +import com.logpm.patch.service.IOrderDataService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Slf4j +@AllArgsConstructor +@Component +public class OrderDataRepair { + + private final IOrderDataService orderDataService; + + @XxlJob("repairOrderSignStatus") + public ReturnT repairOrderSignStatus(String param) { + log.info("####################repairOrderSignStatus: 修复订单签收状态 开始"); + + //查询所有包件已入库并且已签收的订单状态不为已签收的数据修复状态 + List ls = orderDataService.findAllNoSignStatusOrder(); + for (Long orderId : ls) { + try{ + log.info("#############repairOrderSignStatus: 当前处理的订单id为{}",orderId); + orderDataService.updateOrderStatusByOrderId(orderId,"80"); + }catch (Exception e){ + log.error("##############repairOrderSignStatus: 处理订单id为{}的订单失败",orderId); + continue; + } + } + + log.info("####################repairOrderSignStatus: 修复订单签收状态 完成"); + return ReturnT.SUCCESS; + } + + +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java new file mode 100644 index 000000000..4ed3e9065 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java @@ -0,0 +1,16 @@ +package com.logpm.patch.mapper; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface OrderDataMapper { + + + List findAllNoSignStatusOrder(); + + void updateOrderStatusByOrderId(@Param("orderId") Long orderId, @Param("orderStatus") String orderStatus); + +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml new file mode 100644 index 000000000..53ab0a555 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + update logpm_distribution_stock_article + set order_status = #{orderStatus} + where id = #{orderId} + + + diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java new file mode 100644 index 000000000..3d3091713 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java @@ -0,0 +1,9 @@ +package com.logpm.patch.service; + +import java.util.List; + +public interface IOrderDataService { + List findAllNoSignStatusOrder(); + + void updateOrderStatusByOrderId(Long orderId, String orderStatus); +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java new file mode 100644 index 000000000..b2a4c100f --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java @@ -0,0 +1,28 @@ +package com.logpm.patch.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.logpm.patch.mapper.OrderDataMapper; +import com.logpm.patch.service.IOrderDataService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service +@AllArgsConstructor +public class OrderDataServiceImpl implements IOrderDataService { + + private final OrderDataMapper orderDataMapper; + + @Override + public List findAllNoSignStatusOrder() { + return orderDataMapper.findAllNoSignStatusOrder(); + } + + @Override + public void updateOrderStatusByOrderId(Long orderId, String orderStatus) { + orderDataMapper.updateOrderStatusByOrderId(orderId,orderStatus); + } +}