| | |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ProjectNumVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.StatisticsDataVo; |
| | | import com.yuanchu.limslaboratory.service.HomeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | return mapList; |
| | | } |
| | | |
| | | //计算原材料与成品的合格率 |
| | | @Override |
| | | public StatisticsDataVo qualified() { |
| | | StatisticsDataVo statisticsDataVo = new StatisticsDataVo(); |
| | | //原材料检验单总数 |
| | | Integer allmater = inspectionMapper.getallmater(); |
| | | //原材料合格率 |
| | | Long mater = inspectionMapper.qualified(1); |
| | | statisticsDataVo.setMaterial(getRadio(allmater, mater)); |
| | | //原材料不合格率 |
| | | Long unmater = inspectionMapper.qualified(0); |
| | | statisticsDataVo.setUnmaterial(getRadio(allmater, unmater)); |
| | | //原材料未检验率 |
| | | Long notmater = inspectionMapper.qualified(null); |
| | | statisticsDataVo.setNotmaterial(getRadio(allmater, notmater)); |
| | | |
| | | //成品检验单总数 |
| | | Integer allfin = inspectionMapper.getallfin(); |
| | | //成品合格率 |
| | | //成品不合格率 |
| | | //成品未检验率 |
| | | |
| | | return statisticsDataVo; |
| | | } |
| | | |
| | | /*计算百分比*/ |
| | | private BigDecimal getRadio(Integer all, Long num) { |
| | | if (all.intValue() == 0) { |