|  |  | 
 |  |  | package com.yuanchu.mom.controller; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.yuanchu.mom.annotation.CustomClazzName; | 
 |  |  | import com.yuanchu.mom.annotation.ValueAuth; | 
 |  |  | 
 |  |  | import com.yuanchu.mom.utils.JackSonUtil; | 
 |  |  | import com.yuanchu.mom.vo.Result; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  | import org.springframework.web.multipart.MultipartFile; | 
 |  |  |  | 
 |  |  | import javax.annotation.Resource; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @ValueClassify(value = "è®°å½çæ§å¶") | 
 |  |  |     @ApiOperation(value = "å¯¼åºæä»¶å®¡æ¹è®°å½") | 
 |  |  |     @PostMapping("/exportOutManageRecordCheck") | 
 |  |  |     public Result exportOutManageRecordCheck(@RequestBody Map<String, Object> data, HttpServletResponse response) throws Exception { | 
 |  |  |         ManageRecordCheck manageRecordCheck = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), ManageRecordCheck.class); | 
 |  |  |         return Result.success(manageRecordCheckService.exportOutManageRecordCheck(manageRecordCheck,response)); | 
 |  |  |     @GetMapping("/exportOutManageRecordCheck") | 
 |  |  |     public void exportOutManageRecordCheck(String documentName,String documentCode, HttpServletResponse response) throws Exception { | 
 |  |  |         ManageRecordCheck manageRecordCheck = new ManageRecordCheck(); | 
 |  |  |         if (ObjectUtils.isNotEmpty(documentName)) { | 
 |  |  |             manageRecordCheck.setDocumentName(documentName); | 
 |  |  |         } | 
 |  |  |         if (ObjectUtils.isNotEmpty(documentCode)) { | 
 |  |  |             manageRecordCheck.setDocumentCode(documentCode); | 
 |  |  |         } | 
 |  |  |         manageRecordCheckService.exportOutManageRecordCheck(manageRecordCheck,response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ValueClassify(value = "è®°å½çæ§å¶") | 
 
 |  |  | 
 |  |  |     private Integer receiveUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ¥æ¶æ¶é´") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate receiveDate; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("åæ¶ç¼å·") | 
 |  |  | 
 |  |  |     @ValueTableShow(9) | 
 |  |  |     @ExcelProperty(value = "åæ¶æ¥æ") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate recycleDate; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("åæ¶è¯´æ") | 
 |  |  | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("éä»¶") | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     int ratifyManageRecordCheck(Integer id, String ratifyState); | 
 |  |  |  | 
 |  |  |     String exportOutManageRecordCheck(ManageRecordCheck manageRecordCheck, HttpServletResponse response); | 
 |  |  |     void exportOutManageRecordCheck(ManageRecordCheck manageRecordCheck, HttpServletResponse response); | 
 |  |  |  | 
 |  |  |     int exportInManageRecordCheck(MultipartFile file); | 
 |  |  |  | 
 
 |  |  | 
 |  |  |             internalCorrectFileMapper.insert(InternalCorrectFile); | 
 |  |  |             return true; | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new ErrorException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public void exportPersonTraining(HttpServletResponse response) { | 
 |  |  |         // æ¥è¯¢è¯¦æ
 | 
 |  |  |         IPage<ManageControlPlanListVo> detailedDtos = baseMapper.getPageList(new Page(1, -1), true); | 
 |  |  |         IPage<ManageControlPlanListVo> detailedDtos = baseMapper.getPageList(new Page(-1, -1), true); | 
 |  |  |         if (detailedDtos.getRecords().isEmpty()) { | 
 |  |  |             throw new ErrorException("审核éè¿çæ°æ®ä¸ºç©ºï¼è¯·å®¡æ ¸éè¿åå¨å¯¼åº"); | 
 |  |  |         } | 
 
 |  |  | 
 |  |  |         } | 
 |  |  |         XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( | 
 |  |  |                 new HashMap<String, Object>() {{ | 
 |  |  |                     put("cancelList", auditList); | 
 |  |  |                     put("auditList", auditList); | 
 |  |  |                 }}); | 
 |  |  |         String name = UUID.randomUUID() + "_æä»¶ä¿®è®¢è¡¨" + ".docx"; | 
 |  |  |         try { | 
 
 |  |  | 
 |  |  | import com.yuanchu.mom.service.ManageRecordCheckService; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.yuanchu.mom.utils.QueryWrappers; | 
 |  |  | import com.yuanchu.mom.utils.XWPFDocumentUtils; | 
 |  |  | import org.apache.commons.io.IOUtils; | 
 |  |  | import org.apache.poi.xwpf.usermodel.*; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | 
 |  |  | import javax.annotation.Resource; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.io.*; | 
 |  |  | import java.net.URLEncoder; | 
 |  |  | import java.nio.file.Files; | 
 |  |  | import java.nio.file.Paths; | 
 |  |  | import java.time.LocalDate; | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public String exportOutManageRecordCheck(ManageRecordCheck manageRecordCheck, HttpServletResponse response) { | 
 |  |  |     public void exportOutManageRecordCheck(ManageRecordCheck manageRecordCheck, HttpServletResponse response) { | 
 |  |  |         List<ManageRecordCheck> manageRecordCheckList = manageRecordCheckMapper.pageManageRecordCheck(new Page(-1, -1), QueryWrappers.queryWrappers(manageRecordCheck)).getRecords(); | 
 |  |  |         //çææ£éªæ¥ååæ¾ç»è®°è¡¨ | 
 |  |  |         InputStream inputStream = this.getClass().getResourceAsStream("/static/check-deal.docx"); | 
 |  |  | 
 |  |  |                 new HashMap<String, Object>() {{ | 
 |  |  |                     put("checkList", checkList); | 
 |  |  |                 }}); | 
 |  |  |         String name = UUID.randomUUID() + "_æä»¶å®¡æ¹è®°å½" + ".docx"; | 
 |  |  |         // å¤çæ¢è¡é®é¢ | 
 |  |  |         XWPFDocumentUtils.updateMergeByDocument(template.getXWPFDocument()); | 
 |  |  |         try { | 
 |  |  |             template.writeAndClose(Files.newOutputStream(Paths.get(wordUrl + "/" + name))); | 
 |  |  |         } catch (IOException e) { | 
 |  |  |             throw new RuntimeException(e); | 
 |  |  |             response.setContentType("application/msword"); | 
 |  |  |             String fileName = URLEncoder.encode( | 
 |  |  |                     "æä»¶å®¡æ¹è®°å½", "UTF-8"); | 
 |  |  |             response.setHeader("Content-disposition", | 
 |  |  |                     "attachment;filename=" + fileName + ".docx"); | 
 |  |  |             OutputStream os = response.getOutputStream(); | 
 |  |  |             template.write(os); | 
 |  |  |             os.flush(); | 
 |  |  |             os.close(); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new RuntimeException("导åºå¤±è´¥"); | 
 |  |  |         } | 
 |  |  |         //å¤çä¸è±ææ¢è¡çé®é¢ | 
 |  |  |         String path = wordUrl + "/" + name; | 
 |  |  |         try { | 
 |  |  |             FileInputStream stream1 = new FileInputStream(path); | 
 |  |  |             XWPFDocument document1 = new XWPFDocument(stream1); | 
 |  |  |             List<XWPFTable> xwpfTables1 = document1.getTables(); | 
 |  |  |             for (int i = 0; i < xwpfTables1.size(); i++) { | 
 |  |  |                 for (int j = 0; j < xwpfTables1.get(i).getRows().size(); j++) { | 
 |  |  |                     for (int k = 0; k < xwpfTables1.get(i).getRows().get(j).getTableCells().size(); k++) { | 
 |  |  |                         if (xwpfTables1.get(i).getRows().get(j).getTableCells().get(k).getText().contains("@")) { | 
 |  |  |                             String text = xwpfTables1.get(i).getRows().get(j).getTableCells().get(k).getText(); | 
 |  |  |                             String[] split = text.split("@"); | 
 |  |  |                             xwpfTables1.get(i).getRows().get(j).getTableCells().get(k).removeParagraph(0); | 
 |  |  |                             XWPFParagraph xwpfParagraph = xwpfTables1.get(i).getRows().get(j).getTableCells().get(k).addParagraph(); | 
 |  |  |                             XWPFRun run = xwpfParagraph.createRun(); | 
 |  |  |                             run.setText(split[0]); | 
 |  |  |                             if (ObjectUtils.isNotNull(split[1])) { | 
 |  |  |                                 run.addBreak(); | 
 |  |  |                                 run.setText(split[1]); | 
 |  |  |                             } | 
 |  |  |                             xwpfParagraph.setAlignment(ParagraphAlignment.CENTER); | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             FileOutputStream fileOutputStream1 = new FileOutputStream(path); | 
 |  |  |             document1.write(fileOutputStream1); | 
 |  |  |             fileOutputStream1.close(); | 
 |  |  |         } catch (FileNotFoundException e) { | 
 |  |  |             throw new RuntimeException(e); | 
 |  |  |         } catch (IOException e) { | 
 |  |  |             throw new RuntimeException(e); | 
 |  |  |         } | 
 |  |  |         return name; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 
 |  |  | 
 |  |  |                         } catch (Exception e) { | 
 |  |  |                             manageRecordIssueRecycle.setSignedDate(null); | 
 |  |  |                         } | 
 |  |  |  | 
 |  |  |                         ManageRecordIssueRecycle issueRecycle = manageRecordIssueRecycleMapper.selectOne(Wrappers.<ManageRecordIssueRecycle>lambdaQuery() | 
 |  |  |                                 .eq(ManageRecordIssueRecycle::getDocumentCode, manageRecordIssueRecycle.getDocumentCode()) | 
 |  |  |                                 .eq(ManageRecordIssueRecycle::getDocumentName, manageRecordIssueRecycle.getDocumentName()) | 
 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public void exportPersonTraining(HttpServletResponse response) { | 
 |  |  |         // æ¥è¯¢è¯¦æ
 | 
 |  |  |         IPage<ManageRiskAssessmentResultsVo> detailedDtos = baseMapper.getPageResults(new Page(1, -1), true); | 
 |  |  |         IPage<ManageRiskAssessmentResultsVo> detailedDtos = baseMapper.getPageResults(new Page(-1, -1), true); | 
 |  |  |         if (detailedDtos.getRecords().isEmpty()) { | 
 |  |  |             throw new ErrorException("审核éè¿çæ°æ®ä¸ºç©ºï¼è¯·å®¡æ ¸éè¿åå¨å¯¼åº"); | 
 |  |  |         } | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     <select id="pageManageDocumentAlter" resultMap="BaseResultMap"> | 
 |  |  |         select * from (select cmda.*, | 
 |  |  |         name createUserName | 
 |  |  |         u1.name createUserName, | 
 |  |  |         u2.name checkUserName | 
 |  |  |         from cnas_manage_document_alter cmda | 
 |  |  |         left join user u on cmda.create_user = u.id) A | 
 |  |  |         left join user u1 on cmda.create_user = u1.id | 
 |  |  |         left join user u2 on cmda.check_user = u2.id | 
 |  |  |         ) A | 
 |  |  |         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> | 
 |  |  |             ${ew.customSqlSegment} | 
 |  |  |         </if> | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     <select id="pageManageDocumentCancel" resultMap="BaseResultMap"> | 
 |  |  |         select * from (select mdc.*, | 
 |  |  |         u.name createUserName | 
 |  |  |         u1.name createUserName, | 
 |  |  |         u2.name checkUserName | 
 |  |  |         from cnas_manage_document_cancel mdc | 
 |  |  |         left join user u on mdc.create_user = u.id)A | 
 |  |  |         left join user u1 on mdc.create_user = u1.id | 
 |  |  |         left join user u2 on mdc.check_user = u2.id | 
 |  |  |         )A | 
 |  |  |         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> | 
 |  |  |             ${ew.customSqlSegment} | 
 |  |  |         </if> | 
 
 |  |  | 
 |  |  | import com.yuanchu.mom.annotation.ValueAuth; | 
 |  |  | import com.yuanchu.mom.annotation.ValueClassify; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDetailsDto; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDto; | 
 |  |  | import com.yuanchu.mom.exception.ErrorException; | 
 |  |  | import com.yuanchu.mom.mapper.QualitySuperviseDetailsCorrectFileMapper; | 
 |  |  | import com.yuanchu.mom.pojo.*; | 
 |  |  | 
 |  |  |     @ValueAuth | 
 |  |  |     @ApiOperation(value = "çç£è®¡åå表") | 
 |  |  |     @PostMapping("/pageQualitySupervise") | 
 |  |  |     public Result<IPage<QualitySupervise>> pageQualitySupervise(@RequestBody Map<String, Object> data) throws Exception { | 
 |  |  |     public Result<IPage<QualitySuperviseDto>> pageQualitySupervise(@RequestBody Map<String, Object> data) throws Exception { | 
 |  |  |         Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); | 
 |  |  |         QualitySupervise qualitySupervise = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), QualitySupervise.class); | 
 |  |  |         QualitySupervise qualitySupervise = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), QualitySuperviseDto.class); | 
 |  |  |         return Result.success(qualitySuperviseService.pageQualitySupervise(page, qualitySupervise)); | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ¹å人") | 
 |  |  |     private String ratifyName; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å建人") | 
 |  |  |     private String createUserName; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.yuanchu.mom.dto; | 
 |  |  |  | 
 |  |  | import com.yuanchu.mom.pojo.QualityMonitor; | 
 |  |  | import com.yuanchu.mom.pojo.QualitySupervise; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @Author zhuo | 
 |  |  |  * @Date 2024/11/6 | 
 |  |  |  */ | 
 |  |  | @Data | 
 |  |  | public class QualitySuperviseDto extends QualitySupervise { | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("ç¼å¶äºº") | 
 |  |  |     private String writeName; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ¹å人") | 
 |  |  |     private String ratifyName; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å建人") | 
 |  |  |     private String createUserName; | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDto; | 
 |  |  | import com.yuanchu.mom.pojo.QualitySupervise; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | import org.apache.ibatis.annotations.Param; | 
 |  |  | 
 |  |  |      * @param qualitySuperviseQueryWrapper | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     IPage<QualitySupervise> pageQualitySupervise(@Param("page") Page page, @Param("ew") QueryWrapper<QualitySupervise> qualitySuperviseQueryWrapper); | 
 |  |  |     IPage<QualitySuperviseDto> pageQualitySupervise(@Param("page") Page page, @Param("ew") QueryWrapper<QualitySupervise> qualitySuperviseQueryWrapper); | 
 |  |  | } | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDetailsDto; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDto; | 
 |  |  | import com.yuanchu.mom.pojo.*; | 
 |  |  | import org.springframework.web.multipart.MultipartFile; | 
 |  |  |  | 
 |  |  | 
 |  |  |      * çç£è®¡åå表 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     IPage<QualitySupervise> pageQualitySupervise(Page page, QualitySupervise qualitySupervise); | 
 |  |  |     IPage<QualitySuperviseDto> pageQualitySupervise(Page page, QualitySupervise qualitySupervise); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * çç£è®¡å详æ
å表 | 
 
 |  |  | 
 |  |  |             // å°äººåç¾å对象添å å°éåä¸ | 
 |  |  |             pictureRenderDataList.add(finalUserSignatureUrl); | 
 |  |  |         } | 
 |  |  |         while (pictureRenderDataList.size() < 5) { | 
 |  |  |             pictureRenderDataList.add(null); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // è·å设å¤ä¿¡æ¯ | 
 |  |  |         List<ProcessMethodVerifyMachineAttachment> processMethodVerifyMachineAttachmentList = processMethodVerifyMachineAttachmentService.list(Wrappers.<ProcessMethodVerifyMachineAttachment>lambdaQuery() | 
 |  |  | 
 |  |  |                 new HashMap<String, Object>() {{ | 
 |  |  |                     put("processMethodVerify", exportWordTemplate); | 
 |  |  |                     put("processMethodVerifyMachineAttachmentList", processMethodVerifyMachineAttachmentList); | 
 |  |  |                     put("affirmUserUrl1",pictureRenderDataList.get(0)); | 
 |  |  |                     put("affirmUserUrl2",pictureRenderDataList.get(1)); | 
 |  |  |                     put("affirmUserUrl3",pictureRenderDataList.get(2)); | 
 |  |  |                     put("affirmUserUrl4",pictureRenderDataList.get(3)); | 
 |  |  |                     put("affirmUserUrl5",pictureRenderDataList.get(4)); | 
 |  |  |                 }}); | 
 |  |  |  | 
 |  |  |         // å¤çæ¢è¡é®é¢ | 
 |  |  | 
 |  |  |         // ï¼æï¼æ¯å¦æ»¡è¶³ | 
 |  |  |         processMethodVerifyExportWordDto.setMaterialIsSatisfiedStr(processMethodVerify.getMaterialIsSatisfied() == 1 ? "â" : "Ã"); | 
 |  |  |         // ï¼æ³ï¼æ¯å¦æ»¡è¶³ | 
 |  |  |         processMethodVerifyExportWordDto.setMethodIsSatisfiedStr(processMethodVerify.getMethodIsSatisfied() == 1? "â" : "Ã"); | 
 |  |  |         processMethodVerifyExportWordDto.setMethodIsSatisfiedStr(processMethodVerify.getMethodIsSatisfied() == 1 ? "â" : "Ã"); | 
 |  |  |         // ï¼ç¯ï¼æ¯å¦æ»¡è¶³ | 
 |  |  |         processMethodVerifyExportWordDto.setEnvironmentIsSatisfiedStr(processMethodVerify.getEnvironmentIsSatisfied() == 1 ? "â" : "Ã"); | 
 |  |  |         // ï¼æµéæº¯æºæ§ï¼æ¯å¦æ»¡è¶³ | 
 |  |  | 
 |  |  |         // ï¼å
¶ä»ï¼æ¯å¦æ»¡è¶³ | 
 |  |  |         processMethodVerifyExportWordDto.setOtherIsSatisfiedStr(processMethodVerify.getOtherIsSatisfied() == 1 ? "â" : "Ã"); | 
 |  |  |         // ç¡®è®¤æ¥æ | 
 |  |  |         processMethodVerifyExportWordDto.setConfirmDateStr(processMethodVerify.getConfirmDate() != null ? processMethodVerify.getConfirmDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")): null); | 
 |  |  |         processMethodVerifyExportWordDto.setConfirmDateStr(processMethodVerify.getConfirmDate() != null ? processMethodVerify.getConfirmDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) : null); | 
 |  |  |         return processMethodVerifyExportWordDto; | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDetailsAccordingDto; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDetailsCorrectDto; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDetailsDto; | 
 |  |  | import com.yuanchu.mom.dto.QualitySuperviseDto; | 
 |  |  | import com.yuanchu.mom.excel.QualitySuperviseDetailsUpload; | 
 |  |  | import com.yuanchu.mom.exception.ErrorException; | 
 |  |  | import com.yuanchu.mom.mapper.*; | 
 |  |  | 
 |  |  |                             StringUtils.isNotBlank(detailsUpload.getSupervisePurpose()) && | 
 |  |  |                             StringUtils.isNotBlank(detailsUpload.getSuperviseProject()) && | 
 |  |  |                             StringUtils.isNotBlank(detailsUpload.getSupervisee()) && | 
 |  |  |                             StringUtils.isNotBlank(detailsUpload.getSuperviseReason()) && | 
 |  |  |                             StringUtils.isNotBlank(detailsUpload.getRemark())) { | 
 |  |  |                             StringUtils.isNotBlank(detailsUpload.getSuperviseReason())) { | 
 |  |  |                         // å¯¹è±¡å¤å¶ | 
 |  |  |                         QualitySuperviseDetails superviseDetails = new QualitySuperviseDetails(); | 
 |  |  |                         BeanUtils.copyProperties(detailsUpload, superviseDetails); | 
 |  |  | 
 |  |  |     public boolean ratifyQualitySupervise(QualitySupervise qualitySupervise) { | 
 |  |  |         // å½åç»å½ç¨æ· | 
 |  |  |         Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); | 
 |  |  |         User user = userMapper.selectById(userId); | 
 |  |  |         baseMapper.update(null, Wrappers.<QualitySupervise>lambdaUpdate() | 
 |  |  |                 .eq(QualitySupervise::getSuperviseId, qualitySupervise.getSuperviseId()) | 
 |  |  |                 .set(QualitySupervise::getRatifyUserId, userId) | 
 |  |  |                 .set(QualitySupervise::getRatifyUserName, user.getName()) | 
 |  |  |                 .set(QualitySupervise::getRatifyRemark, qualitySupervise.getRatifyRemark()) | 
 |  |  |                 .set(QualitySupervise::getRatifyStatus, qualitySupervise.getRatifyStatus()) | 
 |  |  |                 .set(QualitySupervise::getRatifyTime, LocalDateTime.now()) | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public IPage<QualitySupervise> pageQualitySupervise(Page page, QualitySupervise qualitySupervise) { | 
 |  |  |     public IPage<QualitySuperviseDto> pageQualitySupervise(Page page, QualitySupervise qualitySupervise) { | 
 |  |  |         return baseMapper.pageQualitySupervise(page, QueryWrappers.queryWrappers(qualitySupervise)); | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  |     <select id="pageQualityMonitor" resultType="com.yuanchu.mom.dto.QualityMonitorDto"> | 
 |  |  |         select * | 
 |  |  |         from (select cqm.*, | 
 |  |  |                      u1.name write_name, | 
 |  |  |                      u2.name examine_name, | 
 |  |  |                      u3.name ratify_name | 
 |  |  |               from cnas_quality_monitor cqm | 
 |  |  |                        left join user u1 on u1.id = cqm.write_user_id | 
 |  |  |                        left join user u2 on u2.id = cqm.write_user_id | 
 |  |  |                        left join user u3 on u3.id = cqm.write_user_id | 
 |  |  |               order by cqm.create_time desc) a | 
 |  |  |         u1.name write_name, | 
 |  |  |         u2.name examine_name, | 
 |  |  |         u3.name ratify_name, | 
 |  |  |         u4.name createUserName | 
 |  |  |         from cnas_quality_monitor cqm | 
 |  |  |         left join user u1 on u1.id = cqm.write_user_id | 
 |  |  |         left join user u2 on u2.id = cqm.examine_user_id | 
 |  |  |         left join user u3 on u3.id = cqm.ratify_user_id | 
 |  |  |         left join user u4 on u4.id = cqm.create_user | 
 |  |  |         order by cqm.create_time desc) a | 
 |  |  |         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> | 
 |  |  |             ${ew.customSqlSegment} | 
 |  |  |         </if> | 
 
 |  |  | 
 |  |  | <?xml version="1.0" encoding="UTF-8" ?> | 
 |  |  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | 
 |  |  | <mapper namespace="com.yuanchu.mom.mapper.QualitySuperviseMapper"> | 
 |  |  |  | 
 |  |  |     <!-- çç£è®¡åå表 --> | 
 |  |  |     <select id="pageQualitySupervise" resultType="com.yuanchu.mom.pojo.QualitySupervise"> | 
 |  |  |     <select id="pageQualitySupervise" resultType="com.yuanchu.mom.dto.QualitySuperviseDto"> | 
 |  |  |         select * | 
 |  |  |         from (select * | 
 |  |  |               from cnas_quality_supervise | 
 |  |  |               order by create_time desc ) a | 
 |  |  |         from (select cqs.*, | 
 |  |  |         u1.name write_name, | 
 |  |  |         u3.name ratify_name, | 
 |  |  |         u4.name createUserName | 
 |  |  |         from cnas_quality_supervise cqs | 
 |  |  |         left join user u1 on u1.id = cqs.write_user_id | 
 |  |  |         left join user u3 on u3.id = cqs.ratify_user_id | 
 |  |  |         left join user u4 on u4.id = cqs.create_user | 
 |  |  |         order by create_time desc ) a | 
 |  |  |         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> | 
 |  |  |             ${ew.customSqlSegment} | 
 |  |  |         </if> | 
 
 |  |  | 
 |  |  |         order by type desc,io.id desc | 
 |  |  |         ) a | 
 |  |  |         LEFT JOIN | 
 |  |  |         (SELECT r.id, r.ins_order_id, is_ratify, url, url_s,sample_code FROM ins_report r left join  ins_sample isa on r.ins_sample_id = isa.id WHERE is_ratify = 1) ir ON a.id = | 
 |  |  |         (SELECT r.id, r.ins_order_id, is_ratify, url, url_s,sample_code FROM ins_report r left join ins_sample isa on | 
 |  |  |         r.ins_sample_id = isa.id WHERE is_ratify = 1) ir ON a.id = | 
 |  |  |         ir.ins_order_id )b | 
 |  |  |         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> | 
 |  |  |             ${ew.customSqlSegment} | 
 |  |  | 
 |  |  |         A.model, | 
 |  |  |         A.inspection_item, | 
 |  |  |         A.company, | 
 |  |  |         A.cost  , | 
 |  |  |         A.cost , | 
 |  |  |         A.`name`, | 
 |  |  |         COUNT(1)     num, | 
 |  |  |         COUNT(1) num, | 
 |  |  |         ROUND(SUM(A.price),2) price | 
 |  |  |         FROM (SELECT i.id, | 
 |  |  |         i.entrust_code, | 
 |  |  | 
 |  |  |         isa.sample, | 
 |  |  |         isa.model, | 
 |  |  |         ins_sample_id, | 
 |  |  |         times  cost, | 
 |  |  |         sum(c.price * times)                                   price, | 
 |  |  |         times cost, | 
 |  |  |         sum(c.price * times) price, | 
 |  |  |         GROUP_CONCAT(distinct c.inspection_item SEPARATOR ',') inspection_item, | 
 |  |  |         i.company, | 
 |  |  |         u.`name` | 
 |  |  | 
 |  |  |         </if> | 
 |  |  |     </select> | 
 |  |  |     <select id="selectDeviceList" resultType="java.util.Map"> | 
 |  |  |         select device_name,specification_model,management_number,<!--DATE_ADD(date_format(last_calibration_date, | 
 |  |  |         '%Y-%m-%d'),INTERVAL calibration_date month)-->  date_format(next_calibration_date,'%Y-%m-%d') | 
 |  |  |         select device_name, | 
 |  |  |         specification_model, | 
 |  |  |         management_number, | 
 |  |  |         date_format(CASE | 
 |  |  |         WHEN dmr.next_calibration_date is not null THEN dmr.next_calibration_date | 
 |  |  |         WHEN d.next_calibration_date > CURDATE() THEN d.next_calibration_date | 
 |  |  |         END,'%Y-%m-%d') | 
 |  |  |         <!--date_format(next_calibration_date,'%Y-%m-%d')--> | 
 |  |  |         latest_traceability | 
 |  |  |         from device | 
 |  |  |         where device.management_number in | 
 |  |  |         from device d | 
 |  |  |         left join | 
 |  |  |         device_metric_record dmr on d.id = dmr.device_id | 
 |  |  |         where d.management_number in | 
 |  |  |         <foreach collection="names" index="index" open="(" separator="," close=")" item="val"> | 
 |  |  |             #{val} | 
 |  |  |         </foreach> | 
 |  |  | 
 |  |  |         A.inspection_item, | 
 |  |  |         A.company, | 
 |  |  |         A.`name`, | 
 |  |  |         COUNT(1)     num, | 
 |  |  |         COUNT(1) num, | 
 |  |  |         ROUND(SUM(A.price),2) price | 
 |  |  |         FROM (SELECT i.id, | 
 |  |  |         i.entrust_code, | 
 |  |  | 
 |  |  |         isa.sample, | 
 |  |  |         isa.model, | 
 |  |  |         ins_sample_id, | 
 |  |  |         sum(c.price * times)                                   price, | 
 |  |  |         sum(c.price * times) price, | 
 |  |  |         GROUP_CONCAT(distinct c.inspection_item SEPARATOR ',') inspection_item, | 
 |  |  |         i.company, | 
 |  |  |         u.`name` |