| | |
| | | import com.yuanchu.limslaboratory.pojo.vo.StatisticsDataVo; |
| | | import com.yuanchu.limslaboratory.service.HomeService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | //计算原材料与成品的合格率 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public StatisticsDataVo qualified() { |
| | | StatisticsDataVo statisticsDataVo = new StatisticsDataVo(); |
| | | //原材料检验单总数 |
| | |
| | | //成品检验单总数 |
| | | Integer allfin = inspectionMapper.getallfin(); |
| | | //成品合格率 |
| | | Long finished = inspectionMapper.qualifiedfin(1); |
| | | statisticsDataVo.setFinished(getRadio(allfin, finished)); |
| | | //成品不合格率 |
| | | Long unfinished = inspectionMapper.qualifiedfin(0); |
| | | statisticsDataVo.setUnfinished(getRadio(allfin, unfinished)); |
| | | //成品未检验率 |
| | | Long notfinished = inspectionMapper.qualifiedfin(null); |
| | | statisticsDataVo.setNotfinished(getRadio(allfin, notfinished)); |
| | | |
| | | return statisticsDataVo; |
| | | } |