生产报废

master
赵嘉伟 4 years ago
parent 0ea1db37c6
commit 90cc22108b

@ -0,0 +1,24 @@
package com.foreverwin.mesnac.anomaly.service;
import com.foreverwin.mesnac.anomaly.dto.ScrapDto;
import java.util.List;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-28
*/
public interface ProductionScrap {
/**
*
* @param sfc
* @return
*/
boolean jgProductionIsScrap(String site,String sfc);
/**
*
*/
List<ScrapDto> getScrapDtoBysfc(String site,String sfc);
}

@ -0,0 +1,43 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import com.foreverwin.mesnac.anomaly.dto.ScrapDto;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.ProductionScrap;
import com.foreverwin.modular.core.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-28
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class ProductionScrapImpl implements ProductionScrap {
@Autowired
private AbnormalBillService abnormalBillService;
@Autowired
private AbnormalBillMapper abnormalBillMapper;
@Override
public boolean jgProductionIsScrap(String site,String sfc) {
//查询该sfc在质量异常异常方案是否是报废,如果是则大于1
Integer num = abnormalBillMapper.findAbnormalMethodBySFC(site, sfc);
return num <= 0;
}
@Override
public List<ScrapDto> getScrapDtoBysfc(String site,String sfc) {
if(this.jgProductionIsScrap(site,sfc)){
throw new BaseException("该产品条码的异常方案不是报废");
}
return abnormalBillMapper.findScrapDtoBySfc(site, sfc);
}
}
Loading…
Cancel
Save