| | |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.dto.InsProductBindingDto; |
| | | import com.ruoyi.inspect.dto.InsProductDto; |
| | | import com.ruoyi.inspect.mapper.InsOrderMapper; |
| | | import com.ruoyi.inspect.mapper.InsProductMapper; |
| | | import com.ruoyi.inspect.mapper.InsSampleMapper; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | for (InsProduct product : insProducts) { |
| | | for (InsProduct insProduct1 : insProductBindingList) { |
| | | insProduct1.setId(null); |
| | | insProduct1.setBindingProductId(product.getId()); |
| | | insProduct1.setBindingProductId(Math.toIntExact(product.getId())); |
| | | insProduct1.setCableTag(product.getCableTag()); |
| | | } |
| | | this.saveBatch(insProductBindingList); |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检查项目批量分配检验人 |
| | | * |
| | | * @param insProductDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int batchUpdateInsProductCheckUser(InsProductDto insProductDto) { |
| | | if(ObjectUtils.isEmpty(insProductDto) || CollectionUtils.isEmpty(insProductDto.getInsProductDtoList())){ |
| | | return 0; |
| | | } |
| | | List<InsProductDto> insProductDtoList = insProductDto.getInsProductDtoList(); |
| | | for (InsProductDto productDto : insProductDtoList) { |
| | | InsProduct insProduct = new InsProduct(); |
| | | insProduct.setId(Long.valueOf(productDto.getInsProductId())); |
| | | insProduct.setCheckUserId(productDto.getCheckUserId()); |
| | | insProductMapper.updateById(insProduct); |
| | | } |
| | | return insProductDtoList.size(); |
| | | } |
| | | } |
| | | |
| | | |