erp报工取配置文件

master
philip 4 years ago
parent 3b2d862d1a
commit e46e1bda13

@ -32,7 +32,7 @@ ws:
port: 8000
user: mesd001
pwd: a123456
valid: N
enabled: false
ftp:
host: 106.52.244.124

@ -63,6 +63,7 @@ ws:
user: mes001
pwd: mesprd
valid: Y
enabled: false
#quartz任务启用
quartz:

@ -33,6 +33,7 @@ ws:
user: mes001
pwd: mesprd
valid: Y
enabled: true
#ftp
ftp:

@ -33,6 +33,7 @@ ws:
user: mesd001
pwd: a123456
valid: N
enabled: false
#ftp
ftp:

@ -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);
}

@ -81,6 +81,9 @@ public class SfcScrapServiceImpl extends ServiceImpl<SfcScrapMapper, SfcScrap> i
@Autowired
private SplitSfcMapper splitSfcMapper;
@Value("${ws.erp.enabled}")
private boolean enabled;
@Override
public IPage<SfcScrap> selectPage(FrontPage<SfcScrap> frontPage, SfcScrap sfcScrap) {
QueryWrapper<SfcScrap> queryWrapper = new QueryWrapper<>();
@ -159,8 +162,9 @@ public class SfcScrapServiceImpl extends ServiceImpl<SfcScrapMapper, SfcScrap> 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();

Loading…
Cancel
Save