From ba999d484c2f17ef125bed1ed61e207f7c260e17 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 14 Nov 2023 14:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=93=81=E8=AE=A1=E5=88=92=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op-mes/src/main/java/com/op/mes/mapper/MesMapper.java | 2 ++ .../com/op/mes/service/impl/IWCInterfaceServiceImpl.java | 7 ++++++- .../op-mes/src/main/resources/mapper/mes/MesMapper.xml | 3 +++ .../src/main/java/com/op/plan/domain/ProOrder.java | 4 ++-- .../java/com/op/plan/mapper/ProOrderWorkorderMapper.java | 2 ++ .../com/op/plan/service/impl/ProOrderServiceImpl.java | 4 ++-- .../resources/mapper/plan/ProOrderWorkorderMapper.xml | 8 ++++++++ 7 files changed, 25 insertions(+), 5 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java index d9c8a5e9..b903ca16 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java @@ -54,4 +54,6 @@ public interface MesMapper { void addSapLog(SysSapLog sysSapLog); List> selectcxjList(); + + void deleteDateByTableName0(@Param("table")String table,@Param("ymdhms")String ymdhms); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 1ee92724..e1761292 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -236,7 +236,12 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { LocalDate nextWeek = today.plus(-3, ChronoUnit.DAYS); String ymdhms7 = nextWeek.format(ymdhms)+" 00:00:00"; for(String table:tables){ - mesMapper.deleteDateByTableName(table,ymdhms7); + if("mes_interface_log".equals(table)){ + mesMapper.deleteDateByTableName0(table,ymdhms7); + }else{ + mesMapper.deleteDateByTableName(table,ymdhms7); + } + } } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml index ae338574..0430bc98 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml @@ -178,5 +178,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from ${table} where create_time >= #{startDate} and #{endDate}>create_time + + delete from ${table} where #{ymdhms} > CONVERT(varchar(30),creter_time, 120) + diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java index ffb51e77..3e6128ca 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java @@ -137,8 +137,8 @@ public class ProOrder extends TreeEntity { private String planDateEnd; /** 创建日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "创建日期", width = 20, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "创建日期", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 更新日期 */ diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java index 708b08f1..0818455e 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java @@ -150,5 +150,7 @@ public interface ProOrderWorkorderMapper { List selectProOrderWorkorderByOrderId(String orderId); int getProSortNo(ProOrder proOrder); + + void deleteProOrderWorkorderByOrderIds(String[] orderIds); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 01c5cf64..d7191c56 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -472,6 +472,7 @@ public class ProOrderServiceImpl implements IProOrderService { ProOrder orderExit = proOrderMapper.selectProOrderByOrderCode(proOrder.getOrderCode()); if (orderExit==null) {//不存在就插入 proOrder.setId(IdUtils.fastSimpleUUID()); + proOrder.setCreateTime(nowDate); proOrderMapper.insertProOrder(proOrder); logger.info("=======订单"+proOrder.getOrderCode()+"同步成功"); } else {//存在,如果没活动更新,否则不允许更新,关闭订单 @@ -493,7 +494,7 @@ public class ProOrderServiceImpl implements IProOrderService { //删除批次pro_order_workorder_batch proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderIds(ids); //删除工单pro_order_workorder - proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(ids); + proOrderWorkorderMapper.deleteProOrderWorkorderByOrderIds(ids); } logger.info("=======订单"+proOrder.getOrderCode()+"同步成功"); }else{ @@ -547,7 +548,6 @@ public class ProOrderServiceImpl implements IProOrderService { order.setPlanFactoryCode(factoryCode); order.setFactoryCode(factoryCode); order.setCreateBy(SecurityUtils.getUsername()); - order.setCreateTime(DateUtils.getNowDate()); order.setOrderType("LJ01"); order.setProdType("prod"); order.setStatus("o0"); diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index 694a8a40..6da59778 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -440,4 +440,12 @@ set del_flag = '1' where order_id = #{id} + + update pro_order_workorder + set del_flag = '1' + where order_id in + + #{orderId} + +