diff --git a/console/src/main/resources/application-dev.yml b/console/src/main/resources/application-dev.yml index 729e3584..63d01fd9 100644 --- a/console/src/main/resources/application-dev.yml +++ b/console/src/main/resources/application-dev.yml @@ -32,7 +32,7 @@ ws: port: 8000 user: mesd001 pwd: a123456 - valid: N + enabled: false ftp: host: 106.52.244.124 diff --git a/console/src/main/resources/application-local.yml b/console/src/main/resources/application-local.yml index 6c9cb5ca..3810a601 100644 --- a/console/src/main/resources/application-local.yml +++ b/console/src/main/resources/application-local.yml @@ -63,6 +63,7 @@ ws: user: mes001 pwd: mesprd valid: Y + enabled: false #quartz任务启用 quartz: diff --git a/console/src/main/resources/application-prd.yml b/console/src/main/resources/application-prd.yml index 84d1022d..a83a50d6 100644 --- a/console/src/main/resources/application-prd.yml +++ b/console/src/main/resources/application-prd.yml @@ -33,6 +33,7 @@ ws: user: mes001 pwd: mesprd valid: Y + enabled: true #ftp ftp: diff --git a/console/src/main/resources/application-qas.yml b/console/src/main/resources/application-qas.yml index fe7f399d..49b5d5e2 100644 --- a/console/src/main/resources/application-qas.yml +++ b/console/src/main/resources/application-qas.yml @@ -33,6 +33,7 @@ ws: user: mesd001 pwd: a123456 valid: N + enabled: false #ftp ftp: diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index 4a77a180..3429b3dd 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -31,7 +31,10 @@ import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.mapper.SfcDataAssembleMapper; import com.foreverwin.mesnac.production.model.LoadInventory; import com.foreverwin.mesnac.production.model.SfcHoldLog; -import com.foreverwin.mesnac.production.service.*; +import com.foreverwin.mesnac.production.service.LoadInventoryService; +import com.foreverwin.mesnac.production.service.PodTemplateService; +import com.foreverwin.mesnac.production.service.SfcCrossService; +import com.foreverwin.mesnac.production.service.SfcHoldLogService; import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.meext.MEServices; import com.foreverwin.modular.core.util.CommonMethods; @@ -40,6 +43,7 @@ import com.sap.me.production.AssemblyComponent; import com.sap.me.production.AssemblyDataField; import com.sap.me.production.AssemblyServiceInterface; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -55,6 +59,8 @@ import java.util.*; @Service @Transactional(rollbackFor = Exception.class) public class PodTemplateServiceImpl implements PodTemplateService { + @Value("${ws.erp.enabled}") + private boolean enabled; @Autowired private ResrceService resrceService; @Autowired @@ -334,7 +340,9 @@ public class PodTemplateServiceImpl implements PodTemplateService { //更改派工单状态 sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour); //报工 - sendErp(sfc, stepId, qty, BigDecimal.ZERO, workHour); + if (enabled){ + sendErp(sfc, stepId, qty, BigDecimal.ZERO, workHour); + } } catch (Exception e) { ExceptionUtil.throwException(e); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java index b4ea1a2f..9c3dc100 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcScrapServiceImpl.java @@ -81,6 +81,9 @@ public class SfcScrapServiceImpl extends ServiceImpl i @Autowired private SplitSfcMapper splitSfcMapper; + @Value("${ws.erp.enabled}") + private boolean enabled; + @Override public IPage selectPage(FrontPage frontPage, SfcScrap sfcScrap) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -159,8 +162,9 @@ public class SfcScrapServiceImpl extends ServiceImpl i sfcScrap.setModifiedDateTime(now); //向生产派工那边发送数据 - // podTemplateService.sendErp(sfcScrap.getSfc(),sfcScrap.getStepId(),BigDecimal.valueOf(0L),BigDecimal.valueOf(sfcScrap.getQty()),BigDecimal.valueOf(0L)); - + if (enabled) { + podTemplateService.sendErp(sfcScrap.getSfc(), sfcScrap.getStepId(), BigDecimal.valueOf(0L), BigDecimal.valueOf(sfcScrap.getQty()), BigDecimal.valueOf(0L)); + } try{ //调用mes公共接口,报废 ScrapSfcRequest scrapSfcRequest = new ScrapSfcRequest();