diff --git a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java index dfbf906c..8d949d06 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java @@ -18,6 +18,7 @@ import com.op.system.api.domain.sap.SapSupplier; import com.op.system.api.model.SapProOrder; import org.apache.commons.lang3.time.DateFormatUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import java.util.Date; @@ -234,7 +235,9 @@ public class SapController extends BaseController { R r = sapWorkCenterService.sapWorkCenterSync(qo); if(r.getCode()==200){ List dtos = (List) r.getData(); - sapWorkCenterService.syncWorkCenter(dtos); + if(!CollectionUtils.isEmpty(dtos)) { + sapWorkCenterService.syncWorkCenter(dtos); + } }else{ logger.error("++++++++++++" + dateSource.get("poolName")+"错误信息:"+ r.getMsg()); } @@ -268,7 +271,10 @@ public class SapController extends BaseController { R r = sapWorkCenterService.sapSupplierSync(sapSupplierQuery); if(r.getCode()==200){ List dtos = (List) r.getData(); - sapWorkCenterService.syncSupplier(dtos); + if(!CollectionUtils.isEmpty(dtos)){ + sapWorkCenterService.syncSupplier(dtos); + } + }else{ logger.error("++++++++++++" + dateSource.get("poolName")+"错误信息:"+ r.getMsg()); } @@ -303,7 +309,9 @@ public class SapController extends BaseController { R r = sapWorkCenterService.sapCustomSync(sapCustom); if(r.getCode()==200){ List dtos = (List) r.getData(); - sapWorkCenterService.syncCustom(dtos); + if(!CollectionUtils.isEmpty(dtos)) { + sapWorkCenterService.syncCustom(dtos); + } }else{ logger.error("++++++++++++" + dateSource.get("poolName")+"错误信息:"+ r.getMsg()); }