| | |
| | | import com.yuanchu.mom.pojo.RawInspect; |
| | | import com.yuanchu.mom.service.RawInsProductService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | |
| | | //更新检验项目(填写检验值,检验设备) |
| | | @Override |
| | | public void updaterawInsProduct(int userId,Integer rpId ,String testValue,Integer devId) { |
| | | public void updaterawInsProduct(int userId, Integer rpId, String testValue, Integer devId) { |
| | | RawInsProduct rawInsProduct = rawInsProductMapper.selectById(rpId); |
| | | //赋值设备 |
| | | rawInsProduct.setDeviceId(devId); |
| | |
| | | if (list.contains(0)) { |
| | | //如果其中一个检验值不合格则该项目检验不合格 |
| | | rawInsProduct.setTestState(0); |
| | | }else { |
| | | } else { |
| | | rawInsProduct.setTestState(1); |
| | | } |
| | | /*更新原材料检验项目表*/ |
| | |
| | | rawInspectMapper.updateById(rawInspect); |
| | | } |
| | | |
| | | //只更改设备,之前的检验值删掉 |
| | | @Override |
| | | public void updateDevByRpId(Integer rpId, Integer devId) { |
| | | RawInsProduct rawInsProduct = new RawInsProduct(); |
| | | rawInsProduct.setId(rpId); |
| | | rawInsProduct.setDeviceId(devId); |
| | | rawInsProduct.setTestValue(null); |
| | | rawInsProduct.setTestState(null); |
| | | rawInsProductMapper.updateById(rawInsProduct); |
| | | } |
| | | |
| | | /*判断检测值是否满足标准值和内控值的要求,如果不满足则检验结论为不合格*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| | | boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr); |