客户满意度新增附件与委托单关联;供应商管理新增附件;标准物质接收、记录、验收模块调整;委托单新增已完成列表接口(满意度下拉用);管理记录服务调整
| | |
| | | public Result delAnalyseFile(Integer analyseFileId){ |
| | | return Result.success(clientSatisfactionAnalyseFileMapper.deleteById(analyseFileId)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ»¡æåº¦éä»¶ |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢æ»¡æåº¦éä»¶") |
| | | @GetMapping("/selectAttachments") |
| | | public Result selectAttachments(Integer clientSatisfactionId) { |
| | | return Result.success(clientSatisfactionService.selectAttachments(clientSatisfactionId)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ 满æåº¦éä»¶ |
| | | */ |
| | | @Operation(summary = "ä¸ä¼ 满æåº¦éä»¶") |
| | | @PostMapping("/uploadAttachment") |
| | | public Result uploadAttachment(@RequestParam("clientSatisfactionId") Integer clientSatisfactionId, |
| | | @RequestParam("file") MultipartFile file) { |
| | | return Result.success(clientSatisfactionService.uploadAttachment(clientSatisfactionId, file)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿»¡æåº¦éä»¶ |
| | | */ |
| | | @Operation(summary = "å 餿»¡æåº¦éä»¶") |
| | | @DeleteMapping("/deleteAttachment") |
| | | public Result deleteAttachment(Long id) { |
| | | return Result.success(clientSatisfactionService.deleteAttachment(id)); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.manage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.manage.pojo.ClientSatisfactionAttachment; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * å®¢æ·æ»¡æåº¦éä»¶ |
| | | */ |
| | | @Mapper |
| | | public interface ClientSatisfactionAttachmentMapper extends BaseMapper<ClientSatisfactionAttachment> { |
| | | } |
| | |
| | | @Schema(description = "夿³¨(对æä»¬ç叿)") |
| | | private String remark; |
| | | |
| | | @Schema(description = "å§æåid(ins_order.id)") |
| | | private Integer orderId; |
| | | |
| | | @Schema(description = "å§æåç¼å·") |
| | | private String entrustCode; |
| | | |
| | | @Schema(description = "æ ·ååç§°") |
| | | private String sampleName; |
| | | |
| | | @Schema(description = "å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.manage.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * å®¢æ·æ»¡æåº¦éä»¶ |
| | | */ |
| | | @Data |
| | | @TableName("cnas_client_satisfaction_attachment") |
| | | public class ClientSatisfactionAttachment { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Integer clientSatisfactionId; |
| | | private String fileName; |
| | | private String fileUrl; |
| | | private Integer sort; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.manage.pojo.ClientSatisfaction; |
| | | import com.ruoyi.manage.pojo.ClientSatisfactionAnalyseFile; |
| | | import com.ruoyi.manage.pojo.ClientSatisfactionAttachment; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å®¢æ·æ»¡æåº¦ |
| | |
| | | * @param userId ä¿®æ¹äººid |
| | | */ |
| | | void confirmClientSatisfaction(ClientSatisfaction clientSatisfaction, Integer userId); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ»¡æåº¦éä»¶ |
| | | * @param clientSatisfactionId 满æåº¦è®°å½id |
| | | * @return |
| | | */ |
| | | List<ClientSatisfactionAttachment> selectAttachments(Integer clientSatisfactionId); |
| | | |
| | | /** |
| | | * ä¸ä¼ 满æåº¦éä»¶ |
| | | * @param clientSatisfactionId 满æåº¦è®°å½id |
| | | * @param file |
| | | * @return |
| | | */ |
| | | ClientSatisfactionAttachment uploadAttachment(Integer clientSatisfactionId, MultipartFile file); |
| | | |
| | | /** |
| | | * å 餿»¡æåº¦éä»¶ |
| | | * @param id éä»¶id |
| | | * @return |
| | | */ |
| | | boolean deleteAttachment(Long id); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.manage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.deepoove.poi.config.ConfigureBuilder; |
| | | import com.deepoove.poi.data.Pictures; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.manage.dto.ClientSatisfactionDto; |
| | | import com.ruoyi.manage.mapper.ClientSatisfactionAnalyseFileMapper; |
| | | import com.ruoyi.manage.mapper.ClientSatisfactionAttachmentMapper; |
| | | import com.ruoyi.manage.mapper.ClientSatisfactionMapper; |
| | | import com.ruoyi.manage.pojo.ClientSatisfaction; |
| | | import com.ruoyi.manage.pojo.ClientSatisfactionAnalyseFile; |
| | | import com.ruoyi.manage.pojo.ClientSatisfactionAttachment; |
| | | import com.ruoyi.manage.service.ClientSatisfactionService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private ClientSatisfactionAnalyseFileMapper clientSatisfactionAnalyseFileMapper; |
| | | |
| | | @Resource |
| | | private ClientSatisfactionAttachmentMapper clientSatisfactionAttachmentMapper; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | |
| | | clientSatisfaction.setConfirmStatus(1); |
| | | baseMapper.updateById(clientSatisfaction); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ»¡æåº¦éä»¶ |
| | | * |
| | | * @param clientSatisfactionId 满æåº¦è®°å½id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ClientSatisfactionAttachment> selectAttachments(Integer clientSatisfactionId) { |
| | | return clientSatisfactionAttachmentMapper.selectList(new QueryWrapper<ClientSatisfactionAttachment>().lambda() |
| | | .eq(ClientSatisfactionAttachment::getClientSatisfactionId, clientSatisfactionId) |
| | | .orderByAsc(ClientSatisfactionAttachment::getSort, ClientSatisfactionAttachment::getId)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ 满æåº¦éä»¶ |
| | | * |
| | | * @param clientSatisfactionId 满æåº¦è®°å½id |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ClientSatisfactionAttachment uploadAttachment(Integer clientSatisfactionId, MultipartFile file) { |
| | | if (baseMapper.selectById(clientSatisfactionId) == null) { |
| | | throw new BaseException("å®¢æ·æ»¡æåº¦è°æ¥ä¸åå¨"); |
| | | } |
| | | if (file == null || file.isEmpty()) { |
| | | throw new BaseException("éä»¶ä¸è½ä¸ºç©º"); |
| | | } |
| | | // ç³»ç»å
¨å±ä¸ä¼ ä¸é为200MBï¼è¿éæåç»åºå好æç¤º |
| | | if (file.getSize() > 200L * 1024 * 1024) { |
| | | throw new BaseException("éä»¶ä¸è½è¶
è¿200MB"); |
| | | } |
| | | String originalName = file.getOriginalFilename(); |
| | | if (originalName == null || originalName.trim().isEmpty()) { |
| | | originalName = "æªå½åæä»¶"; |
| | | } |
| | | // ä¸ªå«æµè§å¨å¯è½å¸¦ä¸è·¯å¾åç¼ï¼åªä¿çæä»¶åæ¬èº« |
| | | originalName = originalName.replaceAll(".*[/\\\\]", ""); |
| | | try { |
| | | // å¾çæ¾å¾çç®å½ï¼/img éæè·¯å¾ï¼ï¼å
¶ä½ä»»ææ ¼å¼æ¾ word ç®å½ï¼/word éæè·¯å¾ï¼ |
| | | boolean image = originalName.matches("(?i).+\\.(jpg|jpeg|png|gif)$"); |
| | | File directory = new File(image ? imgUrl : wordUrl); |
| | | if (!directory.exists()) { |
| | | directory.mkdirs(); |
| | | } |
| | | String fileUrl = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmmssSSS")) + "-" + originalName; |
| | | file.transferTo(new File(directory, fileUrl)); |
| | | ClientSatisfactionAttachment attachment = new ClientSatisfactionAttachment(); |
| | | attachment.setClientSatisfactionId(clientSatisfactionId); |
| | | attachment.setFileName(originalName); |
| | | attachment.setFileUrl(fileUrl); |
| | | attachment.setSort(selectAttachments(clientSatisfactionId).size()); |
| | | clientSatisfactionAttachmentMapper.insert(attachment); |
| | | return attachment; |
| | | } catch (IOException e) { |
| | | throw new BaseException("éä»¶ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å 餿»¡æåº¦éä»¶ |
| | | * |
| | | * @param id éä»¶id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean deleteAttachment(Long id) { |
| | | return clientSatisfactionAttachmentMapper.deleteById(id) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | List<ManageRecordIntervals> manageRecordIntervalsList = new ArrayList<>(); |
| | | |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | //è·åå½å年份 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // å®ä¹æ¥ææ ¼å¼ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); |
| | | // æ ¼å¼åå½åæ¥æ |
| | | String currentMonth = currentDate.format(formatter); |
| | | ManageRecordIntervalsTotal manageRecordIntervalsTotal = manageRecordIntervalsTotalMapper.selectOne(Wrappers.<ManageRecordIntervalsTotal>lambdaQuery().eq(ManageRecordIntervalsTotal::getYear, currentMonth)); |
| | | ManageRecordIntervalsTotal manageRecordIntervalsTotal = getOrCreateCurrentYearTotal(); |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | XWPFDocument document = new XWPFDocument(inputStream); |
| | |
| | | |
| | | @Override |
| | | public int addManageRecordIntervals(ManageRecordIntervals manageRecordIntervals) { |
| | | //è·åå½å年份 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // å®ä¹æ¥ææ ¼å¼ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); |
| | | // æ ¼å¼åå½åæ¥æ |
| | | String currentMonth = currentDate.format(formatter); |
| | | ManageRecordIntervalsTotal manageRecordIntervalsTotal = manageRecordIntervalsTotalMapper.selectOne(Wrappers.<ManageRecordIntervalsTotal>lambdaQuery().eq(ManageRecordIntervalsTotal::getYear, currentMonth)); |
| | | ManageRecordIntervalsTotal manageRecordIntervalsTotal = getOrCreateCurrentYearTotal(); |
| | | manageRecordIntervals.setRecordIntervalsTotalId(manageRecordIntervalsTotal.getId()); |
| | | manageRecordIntervalsMapper.insert(manageRecordIntervals); |
| | | manageRecordIntervalsTotal.setTotalNum(1 + manageRecordIntervalsTotal.getTotalNum()); |
| | |
| | | ManageRecordIntervals manageRecordIntervals = manageRecordIntervalsMapper.selectById(id); |
| | | manageRecordIntervalsMapper.deleteById(id); |
| | | ManageRecordIntervalsTotal manageRecordIntervalsTotal = manageRecordIntervalsTotalMapper.selectById(manageRecordIntervals.getRecordIntervalsTotalId()); |
| | | manageRecordIntervalsTotal.setTotalNum(manageRecordIntervalsTotal.getTotalNum() - 1); |
| | | if (manageRecordIntervalsTotal == null) { |
| | | return 0; |
| | | } |
| | | manageRecordIntervalsTotal.setTotalNum((manageRecordIntervalsTotal.getTotalNum() == null ? 0 : manageRecordIntervalsTotal.getTotalNum()) - 1); |
| | | return manageRecordIntervalsTotalMapper.updateById(manageRecordIntervalsTotal); |
| | | } |
| | | |
| | | // å¹´åº¦æ±æ»è®°å½åæ¬ç±æ¯å¹´ 1 æ 1 æ¥ç宿¶ä»»å¡å建ï¼ä»»å¡æªå¯ç¨æ¶æ¤å¤å
åºèªå¨è¡¥å»ºï¼é¿å
å id æ¶æ¥ç©ºæé |
| | | private ManageRecordIntervalsTotal getOrCreateCurrentYearTotal() { |
| | | String year = String.valueOf(LocalDate.now().getYear()); |
| | | ManageRecordIntervalsTotal manageRecordIntervalsTotal = manageRecordIntervalsTotalMapper.selectOne(Wrappers.<ManageRecordIntervalsTotal>lambdaQuery().eq(ManageRecordIntervalsTotal::getYear, year)); |
| | | if (manageRecordIntervalsTotal == null) { |
| | | manageRecordIntervalsTotal = new ManageRecordIntervalsTotal(); |
| | | manageRecordIntervalsTotal.setYear(year); |
| | | manageRecordIntervalsTotal.setTotalNum(0); |
| | | manageRecordIntervalsTotalMapper.insert(manageRecordIntervalsTotal); |
| | | } else if (manageRecordIntervalsTotal.getTotalNum() == null) { |
| | | manageRecordIntervalsTotal.setTotalNum(0); |
| | | } |
| | | return manageRecordIntervalsTotal; |
| | | } |
| | | |
| | | // æ°´å¹³åå¹¶åå
æ ¼ |
| | | private static void mergeCellsHorizontally(XWPFTable table, int row, int fromCol, int toCol) { |
| | | for (int i = fromCol; i <= toCol; i++) { |
| | |
| | | @Override |
| | | public IPage<ManageRecordVerify> pageManageRecordVerify(Page page, ManageRecordVerify manageRecordVerify) { |
| | | if (ObjectUtils.isEmpty(manageRecordVerify.getManageRecordTotalId())) { |
| | | //è·åå½å年份 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // å®ä¹æ¥ææ ¼å¼ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); |
| | | // æ ¼å¼åå½åæ¥æ |
| | | String currentMonth = currentDate.format(formatter); |
| | | //æ¥è¯¢åå² |
| | | ManageRecordTotal manageRecordTotal = manageRecordTotalMapper.selectOne(Wrappers.<ManageRecordTotal>lambdaQuery().eq(ManageRecordTotal::getYear, currentMonth)); |
| | | manageRecordVerify.setManageRecordTotalId(manageRecordTotal.getId()); |
| | | manageRecordVerify.setManageRecordTotalId(getOrCreateCurrentYearTotal().getId()); |
| | | } |
| | | return manageRecordVerifyMapper.pageManageRecordVerify(page, QueryWrappers.queryWrappers(manageRecordVerify)); |
| | | } |
| | | |
| | | @Override |
| | | public int addManageRecordVerify(ManageRecordVerify manageRecordVerify) { |
| | | //è·åå½å年份 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // å®ä¹æ¥ææ ¼å¼ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); |
| | | // æ ¼å¼åå½åæ¥æ |
| | | String currentMonth = currentDate.format(formatter); |
| | | ManageRecordTotal manageRecordTotal = manageRecordTotalMapper.selectOne(Wrappers.<ManageRecordTotal>lambdaQuery().eq(ManageRecordTotal::getYear, currentMonth)); |
| | | ManageRecordTotal manageRecordTotal = getOrCreateCurrentYearTotal(); |
| | | manageRecordVerify.setManageRecordTotalId(manageRecordTotal.getId()); |
| | | manageRecordVerifyMapper.insert(manageRecordVerify); |
| | | manageRecordTotal.setTotalNum(1 + manageRecordTotal.getTotalNum()); |
| | |
| | | ManageRecordVerify manageRecordVerify = manageRecordVerifyMapper.selectById(id); |
| | | manageRecordVerifyMapper.deleteById(id); |
| | | ManageRecordTotal manageRecordTotal = manageRecordTotalMapper.selectById(manageRecordVerify.getManageRecordTotalId()); |
| | | manageRecordTotal.setTotalNum(manageRecordTotal.getTotalNum() - 1); |
| | | if (manageRecordTotal == null) { |
| | | return 0; |
| | | } |
| | | manageRecordTotal.setTotalNum((manageRecordTotal.getTotalNum() == null ? 0 : manageRecordTotal.getTotalNum()) - 1); |
| | | return manageRecordTotalMapper.updateById(manageRecordTotal); |
| | | } |
| | | |
| | |
| | | public int exportManageRecordVerify(MultipartFile file) { |
| | | List<ManageRecordVerify> manageRecordVerifyList = new ArrayList<>(); |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | //è·åå½å年份 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // å®ä¹æ¥ææ ¼å¼ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); |
| | | // æ ¼å¼åå½åæ¥æ |
| | | String currentMonth = currentDate.format(formatter); |
| | | ManageRecordTotal manageRecordTotal = manageRecordTotalMapper.selectOne(Wrappers.<ManageRecordTotal>lambdaQuery().eq(ManageRecordTotal::getYear, currentMonth)); |
| | | ManageRecordTotal manageRecordTotal = getOrCreateCurrentYearTotal(); |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | XWPFDocument document = new XWPFDocument(inputStream); |
| | |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | // å¹´åº¦æ±æ»è®°å½åæ¬ç±æ¯å¹´ 1 æ 1 æ¥ç宿¶ä»»å¡å建ï¼ä»»å¡æªå¯ç¨æ¶æ¤å¤å
åºèªå¨è¡¥å»ºï¼é¿å
å id æ¶æ¥ç©ºæé |
| | | private ManageRecordTotal getOrCreateCurrentYearTotal() { |
| | | String year = String.valueOf(LocalDate.now().getYear()); |
| | | ManageRecordTotal manageRecordTotal = manageRecordTotalMapper.selectOne(Wrappers.<ManageRecordTotal>lambdaQuery().eq(ManageRecordTotal::getYear, year)); |
| | | if (manageRecordTotal == null) { |
| | | manageRecordTotal = new ManageRecordTotal(); |
| | | manageRecordTotal.setYear(year); |
| | | manageRecordTotal.setTotalNum(0); |
| | | manageRecordTotalMapper.insert(manageRecordTotal); |
| | | } else if (manageRecordTotal.getTotalNum() == null) { |
| | | manageRecordTotal.setTotalNum(0); |
| | | } |
| | | return manageRecordTotal; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.require.dto.AcceptanceDto; |
| | | import com.ruoyi.require.pojo.FeStandardSubstance; |
| | | import com.ruoyi.require.pojo.FeStandardSubstanceAcceptanceInspection; |
| | | import com.ruoyi.require.service.FeStandardSubstanceAcceptanceInspectionService; |
| | | import com.ruoyi.require.service.FeStandardSubstanceAcceptanceService; |
| | | import com.ruoyi.require.service.FeStandardSubstanceService; |
| | | import com.ruoyi.require.vo.AcceptanceVo; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | private FeStandardSubstanceAcceptanceInspectionService inspectionService; |
| | | @Resource |
| | | private FeStandardSubstanceAcceptanceService feStandardSubstanceAcceptanceService; |
| | | @Resource |
| | | private FeStandardSubstanceService feStandardSubstanceService; |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping("/addAcceptance") |
| | |
| | | |
| | | @Operation(summary = "ç¼è¾") |
| | | @PostMapping("/updateAcceptance") |
| | | @Transactional |
| | | public Result updateAcceptance(@RequestBody AcceptanceDto acceptanceDto) { |
| | | FeStandardSubstance substance = acceptanceDto.getSubstance(); |
| | | if (substance != null) { |
| | | if (substance.getId() == null) { |
| | | substance.setState(0); |
| | | feStandardSubstanceService.save(substance); |
| | | } else { |
| | | // é¢ç¨ç¶æç±é¢ç¨/å½è¿æä½ç»´æ¤ï¼ç¼è¾éªæ¶åæ¶ä¸åå |
| | | substance.setState(null); |
| | | feStandardSubstanceService.updateById(substance); |
| | | } |
| | | acceptanceDto.getAcceptance().setSubstanceId(substance.getId()); |
| | | } |
| | | feStandardSubstanceAcceptanceService.updateById(acceptanceDto.getAcceptance()); |
| | | for (FeStandardSubstanceAcceptanceInspection v : acceptanceDto.getList()) { |
| | | if (v.getId()== null) { |
| | |
| | | return Result.success(); |
| | | } |
| | | |
| | | @Operation(summary = "æ åç©è´¨æ¸
åå½è¿") |
| | | @PostMapping("/returnSubstance") |
| | | @Transactional |
| | | public Result returnSubstance(@RequestBody FeStandardSubstanceRecord record) { |
| | | feStandardSubstanceRecordService.returnSubstance(record); |
| | | return Result.success(); |
| | | @Operation(summary = "æ¥è¯¢æ åç©è´¨å©ä½å¯é¢ç¨æ°é") |
| | | @GetMapping("/getRemainingQuantity/{substanceId}") |
| | | public Result<Long> getRemainingQuantity(@PathVariable("substanceId") Integer substanceId) { |
| | | return Result.success(feStandardSubstanceRecordService.getRemainingQuantity(substanceId)); |
| | | } |
| | | |
| | | @Operation(summary = "æ åç©è´¨æ¸
åé¢ç¨æ¥è¯¢") |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | return Result.success(supplierManagementService.selectSupplierManagementAll()); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥è¯¢ä¾åºåéä»¶") |
| | | @GetMapping("/selectAttachments") |
| | | public Result selectAttachments(Integer supplierManagementId) { |
| | | return Result.success(supplierManagementService.selectAttachments(supplierManagementId)); |
| | | } |
| | | |
| | | @Operation(summary = "ä¸ä¼ ä¾åºåéä»¶") |
| | | @PostMapping("/uploadAttachment") |
| | | public Result uploadAttachment(@RequestParam("supplierManagementId") Integer supplierManagementId, |
| | | @RequestParam("file") MultipartFile file) { |
| | | return Result.success(supplierManagementService.uploadAttachment(supplierManagementId, file)); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤ä¾åºåéä»¶") |
| | | @DeleteMapping("/deleteAttachment") |
| | | public Result deleteAttachment(Long id) { |
| | | return Result.success(supplierManagementService.deleteAttachment(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.require.dto; |
| | | |
| | | import com.ruoyi.require.pojo.FeStandardSubstance; |
| | | import com.ruoyi.require.pojo.FeStandardSubstanceAcceptance; |
| | | import com.ruoyi.require.pojo.FeStandardSubstanceAcceptanceInspection; |
| | | import lombok.Data; |
| | |
| | | |
| | | private FeStandardSubstanceAcceptance acceptance; |
| | | |
| | | private FeStandardSubstance substance; |
| | | |
| | | private List<FeStandardSubstanceAcceptanceInspection> list; |
| | | } |
| | |
| | | @ExcelProperty("ç产åå®¶") |
| | | private String factoryManufacturer; |
| | | |
| | | @ExcelProperty("åºåºç¼å·") |
| | | @ExcelProperty("åºåç¼å·") |
| | | private String factoryNum; |
| | | |
| | | @ExcelProperty("管çç¼å·") |
| | |
| | | @ExcelProperty("æææ") |
| | | private LocalDateTime effectiveDate; |
| | | |
| | | @ExcelProperty("ææ¡£ç¼å·") |
| | | @ExcelProperty("æ¡£æ¡ç¼å·") |
| | | private String fileNum; |
| | | |
| | | @ExcelProperty("åæ¾ä½ç½®") |
| | |
| | | @ExcelProperty("è§æ ¼åå·*") |
| | | private String model; |
| | | |
| | | @ExcelProperty("ç产åå®¶*") |
| | | @ExcelProperty("ç产åå®¶") |
| | | private String factoryManufacturer; |
| | | |
| | | @ExcelProperty("åºåç¼å·*") |
| | |
| | | @ExcelProperty("æ°é*") |
| | | private String quantity; |
| | | |
| | | @ExcelProperty("åä½") |
| | | private String unit; |
| | | |
| | | @ExcelProperty("è´ç½®æ¥æ*(yyyy-MM-dd)") |
| | | private String acquisitionDate; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.require.pojo.SupplierManagementAttachment; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SupplierManagementAttachmentMapper extends BaseMapper<SupplierManagementAttachment> { |
| | | } |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | |
| | | @Schema(description = "ç产åå®¶") |
| | | private String factoryManufacturer; |
| | | |
| | | @Schema(description = "åºåºç¼å·") |
| | | @Schema(description = "ä¾åºå") |
| | | private String supplier; |
| | | |
| | | @Schema(description = "åºåç¼å·") |
| | | private String factoryNum; |
| | | |
| | | @Schema(description = "管çç¼å·") |
| | |
| | | @Schema(description = "æ°é") |
| | | private Long quantity; |
| | | |
| | | @Schema(description = "åä½") |
| | | private String unit; |
| | | |
| | | @Schema(description = "è´ç½®æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime acquisitionDate; |
| | | |
| | | @Schema(description = "æææ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime effectiveDate; |
| | | |
| | | @Schema(description = "ææ¡£ç¼å·") |
| | | @Schema(description = "æ¡£æ¡ç¼å·") |
| | | private String fileNum; |
| | | |
| | | @Schema(description = "åæ¾ä½ç½®") |
| | |
| | | private String createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | |
| | | |
| | | @ExcelIgnore |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ExcelIgnore |
| | |
| | | |
| | | @ExcelIgnore |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | |
| | | @Schema(description = "ç©è´¨id") |
| | | private Integer substanceId; |
| | | |
| | | @Schema(description = "æ¬æ¬¡é¢ç¨æ°é") |
| | | private Long borrowQuantity; |
| | | |
| | | @Schema(description = "åå§æ°é(é¢ç¨æ¶å¿«ç
§)") |
| | | private Long originalQuantity; |
| | | |
| | | @Schema(description = "é¢ç¨åå©ä½æ°é") |
| | | private Long remainingQuantity; |
| | | |
| | | @Schema(description = "åç¨-å®å¥½æ§") |
| | | private String integrity; |
| | | |
| | |
| | | private String phone; |
| | | |
| | | @Schema(description = "åç¨-ååºæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime borrowDate; |
| | | |
| | | @Schema(description = "å½è¿æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime borrowReturnDate; |
| | | |
| | | @Schema(description = "ååºäºº") |
| | |
| | | private String returnedPerson; |
| | | |
| | | @Schema(description = "å½è¿-æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime returnDate; |
| | | |
| | | @Schema(description = "å½è¿-å®å¥½æ§") |
| | |
| | | private String createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("cnas_supplier_management_attachment") |
| | | public class SupplierManagementAttachment { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Integer supplierManagementId; |
| | | private String fileName; |
| | | private String fileUrl; |
| | | private Integer sort; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | |
| | | void borrowSubstance(FeStandardSubstanceRecord feStandardSubstanceRecord); |
| | | |
| | | void returnSubstance(FeStandardSubstanceRecord feStandardSubstanceRecord); |
| | | |
| | | List<FeStandardSubstanceRecord> getSubstanceRecord(Integer id); |
| | | |
| | | IPage<SubstanceRecordVo> getPage(Page page, SubstanceRecordVo vo); |
| | | |
| | | Long getRemainingQuantity(Integer substanceId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.require.pojo.SupplierManagement; |
| | | import com.ruoyi.require.pojo.SupplierManagementAttachment; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | List<SupplierManagement> selectSupplierManagementByParentId(Integer parentId); |
| | | |
| | | List<SupplierManagement> selectSupplierManagementAll(); |
| | | |
| | | List<SupplierManagementAttachment> selectAttachments(Integer supplierManagementId); |
| | | |
| | | SupplierManagementAttachment uploadAttachment(Integer supplierManagementId, MultipartFile file); |
| | | |
| | | boolean deleteAttachment(Long id); |
| | | } |
| | |
| | | @Override |
| | | public void addAcceptance(AcceptanceDto dto) { |
| | | FeStandardSubstanceAcceptance acceptance = dto.getAcceptance(); |
| | | FeStandardSubstance substance = dto.getSubstance(); |
| | | if (substance != null) { |
| | | if (substance.getId() == null) { |
| | | substance.setState(0); |
| | | feStandardSubstanceMapper.insert(substance); |
| | | } |
| | | acceptance.setSubstanceId(substance.getId()); |
| | | } |
| | | this.baseMapper.insert(acceptance); |
| | | List<FeStandardSubstanceAcceptanceInspection> list = dto.getList(); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | |
| | | |
| | | @Override |
| | | public void borrowSubstance(FeStandardSubstanceRecord feStandardSubstanceRecord) { |
| | | FeStandardSubstance standardSubstance = feStandardSubstanceMapper.selectOne(Wrappers.<FeStandardSubstance>lambdaQuery() |
| | | .eq(FeStandardSubstance::getId, feStandardSubstanceRecord.getSubstanceId()) |
| | | .eq(FeStandardSubstance::getState, 0) |
| | | .last("limit 1")); |
| | | if (ObjectUtils.isEmpty(standardSubstance)){ |
| | | throw new ErrorException("该ç©è´¨å·²è¢«ååºï¼"); |
| | | Long borrowQuantity = feStandardSubstanceRecord.getBorrowQuantity(); |
| | | if (borrowQuantity == null || borrowQuantity <= 0) { |
| | | throw new ErrorException("è¯·å¡«åæ£ç¡®çé¢ç¨æ°éï¼"); |
| | | } |
| | | FeStandardSubstance standardSubstance = feStandardSubstanceMapper.selectById(feStandardSubstanceRecord.getSubstanceId()); |
| | | if (ObjectUtils.isEmpty(standardSubstance)){ |
| | | throw new ErrorException("该æ åç©è´¨ä¸åå¨ï¼"); |
| | | } |
| | | long remaining = calcRemaining(standardSubstance); |
| | | if (remaining <= 0) { |
| | | throw new ErrorException("该æ åç©è´¨å·²å
¨é¨é¢ç¨ï¼å©ä½æ°é为0ï¼"); |
| | | } |
| | | if (borrowQuantity > remaining) { |
| | | throw new ErrorException("é¢ç¨æ°éä¸è½è¶
è¿å©ä½æ°éï¼å½åå©ä½" + remaining + "ï¼ï¼"); |
| | | } |
| | | long remainingAfter = remaining - borrowQuantity; |
| | | feStandardSubstanceRecord.setRemainingQuantity(remainingAfter); |
| | | // è®°å½é¢ç¨å½æ¶çåå§æ°éå¿«ç
§ï¼ä¹åæ¸
åéåæ¹æ°éä¸å½±ååå²é¢ç¨è®°å½ |
| | | feStandardSubstanceRecord.setOriginalQuantity(standardSubstance.getQuantity()); |
| | | this.baseMapper.insert(feStandardSubstanceRecord); |
| | | standardSubstance.setState(1); |
| | | standardSubstance.setState(remainingAfter == 0 ? 1 : 0); |
| | | feStandardSubstanceMapper.updateById(standardSubstance); |
| | | } |
| | | |
| | | @Override |
| | | public void returnSubstance(FeStandardSubstanceRecord feStandardSubstanceRecord) { |
| | | FeStandardSubstance standardSubstance = feStandardSubstanceMapper.selectOne(Wrappers.<FeStandardSubstance>lambdaQuery() |
| | | .eq(FeStandardSubstance::getId, feStandardSubstanceRecord.getSubstanceId()) |
| | | .eq(FeStandardSubstance::getState, 1)); |
| | | public Long getRemainingQuantity(Integer substanceId) { |
| | | FeStandardSubstance standardSubstance = feStandardSubstanceMapper.selectById(substanceId); |
| | | if (ObjectUtils.isEmpty(standardSubstance)){ |
| | | throw new ErrorException("该ç©è´¨æªè¢«é¢ç¨ï¼æ éå½è¿ï¼"); |
| | | return 0L; |
| | | } |
| | | standardSubstance.setState(0); |
| | | feStandardSubstanceMapper.updateById(standardSubstance); |
| | | baseMapper.update(feStandardSubstanceRecord, Wrappers.<FeStandardSubstanceRecord>lambdaUpdate() |
| | | .eq(FeStandardSubstanceRecord::getSubstanceId, feStandardSubstanceRecord.getSubstanceId()) |
| | | .eq(FeStandardSubstanceRecord::getStatus, 0)); |
| | | return Math.max(calcRemaining(standardSubstance), 0L); |
| | | } |
| | | |
| | | private long calcRemaining(FeStandardSubstance substance) { |
| | | long total = substance.getQuantity() == null ? 0L : substance.getQuantity(); |
| | | long borrowed = 0L; |
| | | List<FeStandardSubstanceRecord> records = this.baseMapper.selectList(Wrappers.<FeStandardSubstanceRecord>lambdaQuery() |
| | | .eq(FeStandardSubstanceRecord::getSubstanceId, substance.getId())); |
| | | for (FeStandardSubstanceRecord record : records) { |
| | | if ("1".equals(record.getStatus())) { // åå²å½è¿è®°å½ä¸è®¡å
¥å·²é¢ç¨ |
| | | continue; |
| | | } |
| | | borrowed += record.getBorrowQuantity() == null ? total : record.getBorrowQuantity(); |
| | | } |
| | | return total - borrowed; |
| | | } |
| | | |
| | | @Override |
| | |
| | | FeStandardSubstance substance = new FeStandardSubstance(); |
| | | substance.setName(required(row.getName(), rowNumber, "æ åç©è´¨åç§°")); |
| | | substance.setModel(required(row.getModel(), rowNumber, "è§æ ¼åå·")); |
| | | substance.setFactoryManufacturer(required(row.getFactoryManufacturer(), rowNumber, "ç产åå®¶")); |
| | | substance.setFactoryManufacturer(trim(row.getFactoryManufacturer())); |
| | | substance.setFactoryNum(required(row.getFactoryNum(), rowNumber, "åºåç¼å·")); |
| | | substance.setManageNum(manageNum); |
| | | substance.setUncertainty(required(row.getUncertainty(), rowNumber, "ä¸ç¡®å®åº¦")); |
| | | substance.setQuantity(parseQuantity(row.getQuantity(), rowNumber)); |
| | | substance.setUnit(trim(row.getUnit())); |
| | | substance.setAcquisitionDate(parseDate(row.getAcquisitionDate(), rowNumber, "è´ç½®æ¥æ")); |
| | | substance.setEffectiveDate(parseDate(row.getEffectiveDate(), rowNumber, "æææ")); |
| | | substance.setFileNum(required(row.getFileNum(), rowNumber, "æ¡£æ¡ç¼å·")); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.require.dto.SupplierManagementDto; |
| | | import com.ruoyi.require.mapper.SupplierManagementAttachmentMapper; |
| | | import com.ruoyi.require.mapper.SupplierManagementMapper; |
| | | import com.ruoyi.require.pojo.SupplierManagement; |
| | | import com.ruoyi.require.pojo.SupplierManagementAttachment; |
| | | import com.ruoyi.require.service.SupplierManagementService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private SupplierManagementMapper supplierManagementMapper; |
| | | |
| | | @Autowired |
| | | private SupplierManagementAttachmentMapper supplierManagementAttachmentMapper; |
| | | |
| | | @Value("${file.path}") |
| | | private String filePath; |
| | | |
| | | @Value("${wordUrl}") |
| | | private String wordUrl; |
| | | |
| | | public SupplierManagementServiceImpl(SupplierManagementMapper supplierManagementMapper) { |
| | | this.supplierManagementMapper = supplierManagementMapper; |
| | |
| | | public List<SupplierManagement> selectSupplierManagementAll() { |
| | | return supplierManagementMapper.selectList(null); |
| | | } |
| | | |
| | | @Override |
| | | public List<SupplierManagementAttachment> selectAttachments(Integer supplierManagementId) { |
| | | return supplierManagementAttachmentMapper.selectList(new QueryWrapper<SupplierManagementAttachment>().lambda() |
| | | .eq(SupplierManagementAttachment::getSupplierManagementId, supplierManagementId) |
| | | .orderByAsc(SupplierManagementAttachment::getSort, SupplierManagementAttachment::getId)); |
| | | } |
| | | |
| | | @Override |
| | | public SupplierManagementAttachment uploadAttachment(Integer supplierManagementId, MultipartFile file) { |
| | | if (supplierManagementMapper.selectById(supplierManagementId) == null) { |
| | | throw new BaseException("ä¾åºåä¸åå¨"); |
| | | } |
| | | if (file == null || file.isEmpty()) { |
| | | throw new BaseException("éä»¶ä¸è½ä¸ºç©º"); |
| | | } |
| | | // ç³»ç»å
¨å±ä¸ä¼ ä¸é为200MBï¼è¿éæåç»åºå好æç¤º |
| | | if (file.getSize() > 200L * 1024 * 1024) { |
| | | throw new BaseException("éä»¶ä¸è½è¶
è¿200MB"); |
| | | } |
| | | String originalName = file.getOriginalFilename(); |
| | | if (originalName == null || originalName.trim().isEmpty()) { |
| | | originalName = "æªå½åæä»¶"; |
| | | } |
| | | // ä¸ªå«æµè§å¨å¯è½å¸¦ä¸è·¯å¾åç¼ï¼åªä¿çæä»¶åæ¬èº« |
| | | originalName = originalName.replaceAll(".*[/\\\\]", ""); |
| | | try { |
| | | // å¾çæ¾å¾çç®å½ï¼/img éæè·¯å¾ï¼ï¼å
¶ä½ä»»ææ ¼å¼æ¾ word ç®å½ï¼/word éæè·¯å¾ï¼ |
| | | boolean image = originalName.matches("(?i).+\\.(jpg|jpeg|png|gif)$"); |
| | | File directory = new File(image ? filePath : wordUrl); |
| | | if (!directory.exists()) { |
| | | directory.mkdirs(); |
| | | } |
| | | String fileUrl = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmmssSSS")) + "-" + originalName; |
| | | file.transferTo(new File(directory, fileUrl)); |
| | | SupplierManagementAttachment attachment = new SupplierManagementAttachment(); |
| | | attachment.setSupplierManagementId(supplierManagementId); |
| | | attachment.setFileName(originalName); |
| | | attachment.setFileUrl(fileUrl); |
| | | attachment.setSort(selectAttachments(supplierManagementId).size()); |
| | | supplierManagementAttachmentMapper.insert(attachment); |
| | | return attachment; |
| | | } catch (IOException e) { |
| | | throw new BaseException("éä»¶ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteAttachment(Long id) { |
| | | return supplierManagementAttachmentMapper.deleteById(id) > 0; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.require.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | @Schema(description = "ç产åå®¶") |
| | | private String factoryManufacturer; |
| | | |
| | | @Schema(description = "åºåºç¼å·") |
| | | @Schema(description = "åºåç¼å·") |
| | | private String factoryNum; |
| | | |
| | | @Schema(description = "管çç¼å·") |
| | |
| | | @Schema(description = "æ°é") |
| | | private Long quantity; |
| | | |
| | | @Schema(description = "åä½") |
| | | private String unit; |
| | | |
| | | @Schema(description = "è´ç½®æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime acquisitionDate; |
| | | |
| | | @Schema(description = "æææ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime effectiveDate; |
| | | |
| | | @Schema(description = "ææ¡£ç¼å·") |
| | | @Schema(description = "æ¡£æ¡ç¼å·") |
| | | private String fileNum; |
| | | |
| | | @Schema(description = "åæ¾ä½ç½®") |
| | | private String position; |
| | | |
| | | @Schema(description = "æäº¤æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | package com.ruoyi.require.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | @Schema(description = "è§æ ¼åå·") |
| | | private String model; |
| | | |
| | | @Schema(description = "åºåºç¼å·") |
| | | @Schema(description = "åºåç¼å·") |
| | | private String factoryNum; |
| | | |
| | | @Schema(description = "æ°é") |
| | | private Long quantity; |
| | | |
| | | @Schema(description = "åä½") |
| | | private String unit; |
| | | |
| | | @Schema(description = "æ¬æ¬¡é¢ç¨æ°é") |
| | | private Long borrowQuantity; |
| | | |
| | | @Schema(description = "é¢ç¨åå©ä½æ°é") |
| | | private Long remainingQuantity; |
| | | |
| | | @Schema(description = "é¢ç¨äºº") |
| | | private String borrowUser; |
| | | |
| | | @Schema(description = "ååºæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime borrowDate; |
| | | |
| | | @Schema(description = "å½è¿æ¥æ") |
| | | private LocalDateTime returnDate; |
| | | |
| | | @Schema(description = "å½è¿äºº") |
| | | private String returnedPerson; |
| | | |
| | | @Schema(description = "å®å¥½æ§") |
| | | private String returnIntegrity; |
| | | |
| | | @Schema(description = "0ï¼åç¨ 1:å½è¿") |
| | | private String status; |
| | | |
| | | @Schema(description = "夿³¨") |
| | | private String remark; |
| | |
| | | ss.manage_num, |
| | | ss.uncertainty, |
| | | ss.quantity, |
| | | ss.unit, |
| | | ss.acquisition_date, |
| | | ss.effective_date, |
| | | ss.file_num, |
| | | ss.position |
| | | ss.position, |
| | | sa.create_time |
| | | FROM cnas_fe_standard_substance_acceptance sa |
| | | LEFT JOIN cnas_fe_standard_substance ss on ss.id = sa.substance_id |
| | | <where> |
| | |
| | | ss.name, |
| | | ss.model, |
| | | ss.factory_num, |
| | | ss.quantity, |
| | | COALESCE(ssr.original_quantity, ss.quantity) AS quantity, |
| | | ss.unit, |
| | | COALESCE(ssr.borrow_quantity, ss.quantity) AS borrowQuantity, |
| | | COALESCE(ssr.remaining_quantity, 0) AS remainingQuantity, |
| | | ssr.borrow_user, |
| | | ssr.borrow_date, |
| | | ssr.return_date, |
| | | ssr.integrity, |
| | | ssr.return_integrity, |
| | | ssr.returned_person, |
| | | ss.remark |
| | | FROM cnas_fe_standard_substance_record ssr |
| | | LEFT JOIN cnas_fe_standard_substance ss on ss.id = ssr.substance_id |
| | |
| | | package com.ruoyi.inspect.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.InventoryDetailDTO; |
| | |
| | | return insOrderService.judgeNotSpotCheckOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder()); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥è¯¢å·²å®æå§æå(å®¢æ·æ»¡æåº¦ä¸æç¨, ä»
å·²æ£éªstate=4)") |
| | | @GetMapping("/selectCompletedOrders") |
| | | public Result selectCompletedOrders() { |
| | | LambdaQueryWrapper<InsOrder> qw = new LambdaQueryWrapper<>(); |
| | | qw.select(InsOrder::getId, InsOrder::getEntrustCode, InsOrder::getCompany, |
| | | InsOrder::getCompanyId, InsOrder::getSampleView) |
| | | .eq(InsOrder::getState, 4) |
| | | .isNotNull(InsOrder::getCompany) |
| | | .orderByDesc(InsOrder::getCreateTime); |
| | | return Result.success(insOrderService.page(new Page<>(1, 500), qw).getRecords()); |
| | | } |
| | | |
| | | } |