| | |
| | | import com.ruoyi.basic.dto.CopyStandardProductListDto; |
| | | import com.ruoyi.basic.dto.InsSampleReceiveDto; |
| | | import com.ruoyi.basic.dto.ResetTreeDragDTO; |
| | | import com.ruoyi.basic.dto.StandardProductListUpdateRecordDto; |
| | | import com.ruoyi.basic.enums.StandardProductListChcekTypeEnums; |
| | | import com.ruoyi.basic.mapper.*; |
| | | import com.ruoyi.basic.pojo.*; |
| | | import com.ruoyi.basic.service.StandardMethodListService; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StandardProductListUpdateRecordService; |
| | | import com.ruoyi.common.config.MinioConfig; |
| | | import com.ruoyi.common.core.domain.MinioResult; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.file.MinioUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | |
| | | * @createDate 2024-03-05 10:33:29 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardProductListUpdateRecordServiceImpl extends ServiceImpl<StandardProductListUpdateRecordMapper, StandardProductListUpdateRecord> |
| | | implements StandardProductListUpdateRecordService { |
| | | |
| | |
| | | @Autowired |
| | | private StandardProductListUpdateRecordRelMapper standardProductListUpdateRecordRelMapper; |
| | | |
| | | @Resource |
| | | private MinioUtils minioUtils; |
| | | |
| | | @Autowired |
| | | private MinioConfig minioConfig; |
| | | |
| | | /** |
| | | * 标准树下检验项修改记录分页查询 |
| | | * @param page |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<StandardProductListUpdateRecord> standardProductListRecordPage(Page page, StandardProductListUpdateRecord record) { |
| | | return standardProductListUpdateRecordMapper.standardProductListRecordPage(page,QueryWrappers.queryWrappers(record)); |
| | | public IPage<StandardProductListUpdateRecordDto> standardProductListRecordPage(Page page, StandardProductListUpdateRecordDto record) { |
| | | return standardProductListUpdateRecordMapper.standardProductListRecordPage(page,record); |
| | | } |
| | | |
| | | /** |
| | | * 标准树下检验项修改记录分页查询 |
| | | * @param page |
| | | * 标准树下检验项修改记录查询 |
| | | * @param standardProductListUpdateRecordRel |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<StandardProductListUpdateRecordRel> standardProductListRecordRelPage(Page page, StandardProductListUpdateRecordRel standardProductListUpdateRecordRel) { |
| | | return standardProductListUpdateRecordRelMapper.standardProductListRecordRelPage(page,QueryWrappers.queryWrappers(standardProductListUpdateRecordRel)); |
| | | public Map<String,Object> standardProductListRecordRelPage(StandardProductListUpdateRecordRel standardProductListUpdateRecordRel) { |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | | List<StandardProductListUpdateRecordRel> recordRelList = standardProductListUpdateRecordRelMapper.standardProductListRecordRelPage(QueryWrappers.queryWrappers(standardProductListUpdateRecordRel)); |
| | | resultMap.put("productList",recordRelList); |
| | | resultMap.put("total",recordRelList.size()); |
| | | return resultMap; |
| | | } |
| | | |
| | | /** |
| | | * 标准树下修改记录文件上传 |
| | | * |
| | | * @param file |
| | | * @param id |
| | | */ |
| | | @Override |
| | | public void uploadRecordFile(MultipartFile file, Long id) { |
| | | try { |
| | | MinioResult result = minioUtils.upload(minioConfig.getBucketName(), file, true); |
| | | // 保存路径 |
| | | StandardProductListUpdateRecord standardProductListUpdateRecord = new StandardProductListUpdateRecord(); |
| | | standardProductListUpdateRecord.setId(id); |
| | | standardProductListUpdateRecord.setFileName(result.getOriginalName()); |
| | | standardProductListUpdateRecord.setFilePath(result.getBucketFileName()); |
| | | standardProductListUpdateRecord.setFilePreviewPath(result.getPreviewExpiry()); |
| | | standardProductListUpdateRecordMapper.updateById(standardProductListUpdateRecord); |
| | | }catch (Exception e){ |
| | | throw new RuntimeException("文件上传失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |