丽知:调出调入加锁
This commit is contained in:
parent
0c6174b7f4
commit
218863d9cb
|
@ -52,7 +52,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||||
public class TransferInPluginInitializer extends PluginBaseEntity {
|
public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class);
|
Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class);
|
||||||
|
|
||||||
private static final ReentrantLock LOCK = new ReentrantLock(true);
|
private static final Object OBJECT_LOCK = new Object();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -152,6 +152,8 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
public void start() {
|
public void start() {
|
||||||
try {
|
try {
|
||||||
|
synchronized (OBJECT_LOCK) {
|
||||||
|
|
||||||
//获取当前时间
|
//获取当前时间
|
||||||
Date currentDate = new Date();
|
Date currentDate = new Date();
|
||||||
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
|
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
|
||||||
|
@ -175,6 +177,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
implement(filterTransferInOrders);
|
implement(filterTransferInOrders);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -187,6 +190,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
public void start(String stockinNo) {
|
public void start(String stockinNo) {
|
||||||
try {
|
try {
|
||||||
|
synchronized (OBJECT_LOCK) {
|
||||||
|
|
||||||
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
|
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
|
||||||
queryOfsStockinOrderRequestVO.setCode(stockinNo);
|
queryOfsStockinOrderRequestVO.setCode(stockinNo);
|
||||||
|
@ -203,7 +207,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
Assert.state(false, "丽知:OFS调拨入库--->U8C调拨入库根据单据号[入库完成]:{},该调拨入库单已被推送成功,请勿重新推送", stockinNo);
|
Assert.state(false, "丽知:OFS调拨入库--->U8C调拨入库根据单据号[入库完成]:{},该调拨入库单已被推送成功,请勿重新推送", stockinNo);
|
||||||
}
|
}
|
||||||
implement(filterTransferInOrders);
|
implement(filterTransferInOrders);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单),start(String goodsName)方法报错:", e);
|
logger.error("丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单),start(String goodsName)方法报错:", e);
|
||||||
|
@ -216,6 +220,8 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
public void start(String startTime, String endTime) {
|
public void start(String startTime, String endTime) {
|
||||||
try {
|
try {
|
||||||
|
synchronized (OBJECT_LOCK) {
|
||||||
|
|
||||||
Date business_start = DateUtil.parse(startTime);
|
Date business_start = DateUtil.parse(startTime);
|
||||||
Date business_end = DateUtil.parse(endTime);
|
Date business_end = DateUtil.parse(endTime);
|
||||||
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
||||||
|
@ -237,6 +243,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
||||||
Assert.state(false, "丽知:OFS调拨入库订单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]:{}-{},该调期调拨入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime);
|
Assert.state(false, "丽知:OFS调拨入库订单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]:{}-{},该调期调拨入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime);
|
||||||
}
|
}
|
||||||
implement(filterTransferInOrders);
|
implement(filterTransferInOrders);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||||
public class TransferOutPluginInitializer extends PluginBaseEntity {
|
public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
Logger logger = LoggerFactory.getLogger(TransferOutPluginInitializer.class);
|
Logger logger = LoggerFactory.getLogger(TransferOutPluginInitializer.class);
|
||||||
|
|
||||||
private static final ReentrantLock LOCK = new ReentrantLock(true);
|
private static final Object OBJECT_LOCK = new Object();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -153,6 +153,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
public void start() {
|
public void start() {
|
||||||
try {
|
try {
|
||||||
|
synchronized (OBJECT_LOCK) {
|
||||||
//获取当前时间
|
//获取当前时间
|
||||||
Date currentDate = new Date();
|
Date currentDate = new Date();
|
||||||
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
|
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
|
||||||
|
@ -175,6 +176,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
//推送U8C
|
//推送U8C
|
||||||
implement(filterTransferOutOrders);
|
implement(filterTransferOutOrders);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start()方法报错:", e);
|
logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start()方法报错:", e);
|
||||||
}
|
}
|
||||||
|
@ -185,6 +187,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
public void start(String stockoutNo) {
|
public void start(String stockoutNo) {
|
||||||
try {
|
try {
|
||||||
|
synchronized (OBJECT_LOCK) {
|
||||||
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
|
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
|
||||||
queryOfsStockoutOrderRequestVO.setCode(stockoutNo);
|
queryOfsStockoutOrderRequestVO.setCode(stockoutNo);
|
||||||
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
|
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
|
||||||
|
@ -199,6 +202,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
//推送U8C
|
//推送U8C
|
||||||
implement(filterTransferOutOrders);
|
implement(filterTransferOutOrders);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String goodsName)方法报错:", e);
|
logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String goodsName)方法报错:", e);
|
||||||
|
@ -210,6 +214,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
public void start(String startTime, String endTime) {
|
public void start(String startTime, String endTime) {
|
||||||
try {
|
try {
|
||||||
|
synchronized (OBJECT_LOCK) {
|
||||||
Date business_start = DateUtil.parse(startTime);
|
Date business_start = DateUtil.parse(startTime);
|
||||||
Date business_end = DateUtil.parse(endTime);
|
Date business_end = DateUtil.parse(endTime);
|
||||||
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
||||||
|
@ -232,6 +237,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
||||||
//推送U8C
|
//推送U8C
|
||||||
// implement(transferOutOrder);
|
// implement(transferOutOrder);
|
||||||
implement(filterTransferOutOrders);
|
implement(filterTransferOutOrders);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String startTime, String endTime)方法报错:", e);
|
logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String startTime, String endTime)方法报错:", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue