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); + } +}