refactor(deletedata): 优化数据删除逻辑

- 注释掉销售订单的删除操作
- 在 DeleteU8cDataUtil 中添加同步块,确保数据删除操作的线程安全
- 调整 SQL 查询中的 cbiztype 参数格式,统一使用单引号
This commit is contained in:
liuy 2024-12-19 17:46:53 +08:00
parent 5fbe2a3642
commit 124a9d78c9
3 changed files with 12 additions and 8 deletions

View File

@ -31,7 +31,7 @@ public class DeleteU8cDataUtilTest {
//删除销售出库单 //删除销售出库单
// deleteU8cDataUtil.deleteIcGeneralH(); // deleteU8cDataUtil.deleteIcGeneralH();
//删除销售订单 //删除销售订单
deleteU8cDataUtil.deleteSoSale(); // deleteU8cDataUtil.deleteSoSale();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -33,16 +33,20 @@ public class DeleteU8cDataUtil {
protected Logger logger = LogManager.getLogger(super.getClass()); protected Logger logger = LogManager.getLogger(super.getClass());
private static final Object LOCK_OBJECT = new Object();
public void deleteTargetU8cData() { public void deleteTargetU8cData() {
Thread thread = new Thread(new Runnable() { Thread thread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
//删除销售发票 synchronized (LOCK_OBJECT) {
deleteSoSaleinvoice(); //删除销售发票
//删除销售出库单 // deleteSoSaleinvoice();
deleteIcGeneralH(); //删除销售出库单
//删除销售订单 // deleteIcGeneralH();
deleteSoSale(); //删除销售订单
// deleteSoSale();
}
} }
}, "删除U8C11月份TOC对应的销售发票、销售出库单、销售订单"); }, "删除U8C11月份TOC对应的销售发票、销售出库单、销售订单");
thread.start(); thread.start();

View File

@ -80,7 +80,7 @@
so_sale a so_sale a
LEFT JOIN bd_corp b ON b.pk_corp = a.pk_corp LEFT JOIN bd_corp b ON b.pk_corp = a.pk_corp
WHERE WHERE
a.cbiztype IN ('0001A110000000001TH5', '0001A110000000001TH6') a.cbiztype IN ( '0001A110000000001TH5', '0001A110000000001TH6' )
AND a.dbilldate >= '2024-11-01 00:00:00' AND a.dbilldate >= '2024-11-01 00:00:00'
AND a.dbilldate <= '2024-11-30 23:59:59' AND a.dbilldate <= '2024-11-30 23:59:59'
AND a.fstatus = 1 AND a.fstatus = 1