| | |
| | | record.setCreateUserDepart(limsName); |
| | | } |
| | | //çææ£éªæ¥ååæ¾ç»è®°è¡¨ |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/audit-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("audit", tableRenderData); |
| | | table.put("index1", index1); |
| | | auditList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("size", finalIndex); |
| | | put("cancelList", auditList); |
| | | }}); |
| | | String name = UUID.randomUUID() + "_æä»¶ä¿®è®¢è¡¨" + ".docx"; |
| | |
| | | public String exportOutManageRecordCancel(ManageRecordCancel manageRecordCancel, HttpServletResponse response) { |
| | | List<ManageRecordCancel> manageRecordCancelList = manageRecordCancelMapper.pageManageRecordCancel(new Page(-1, -1), QueryWrappers.queryWrappers(manageRecordCancel)).getRecords(); |
| | | //çææ£éªæ¥ååæ¾ç»è®°è¡¨ |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/cancel-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("cancel", tableRenderData); |
| | | table.put("index1", index1); |
| | | cancelList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("size", finalIndex); |
| | | put("cancelList", cancelList); |
| | | }}); |
| | | String name = UUID.randomUUID() + "_æä»¶éæ¯ç³è¯·è¡¨" + ".docx"; |
| | |
| | | public String exportOutManageRecordCheck(ManageRecordCheck manageRecordCheck, HttpServletResponse response) { |
| | | List<ManageRecordCheck> manageRecordCheckList = manageRecordCheckMapper.pageManageRecordCheck(new Page(-1, -1), QueryWrappers.queryWrappers(manageRecordCheck)).getRecords(); |
| | | //çææ£éªæ¥ååæ¾ç»è®°è¡¨ |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/check-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("check", tableRenderData); |
| | | table.put("index1", index1); |
| | | checkList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("size", finalIndex); |
| | | put("checkList", checkList); |
| | | }}); |
| | | String name = UUID.randomUUID() + "_æä»¶å®¡æ¹è®°å½" + ".docx"; |
| | |
| | | public String exportOutManageRecordIntervals(ManageRecordIntervals manageRecordIntervals, HttpServletResponse response) { |
| | | List<ManageRecordIntervals> manageRecordIntervalsList = manageRecordIntervalsMapper.pageManageRecordIntervals(new Page(-1, -1), QueryWrappers.queryWrappers(manageRecordIntervals)).getRecords(); |
| | | //çææ£éªæ¥ååæ¾ç»è®°è¡¨ |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/intervals-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("intervals", tableRenderData); |
| | | table.put("index1", index1); |
| | | intervalsList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("size", finalIndex); |
| | | put("intervalsList", intervalsList); |
| | | }}); |
| | | String name = UUID.randomUUID() + "_æä»¶å®æå®¡æ¥è®°å½è¡¨" + ".docx"; |
| | |
| | | List<ManageRecordIntervals> manageRecordIntervalsList = manageRecordIntervalsMapper.selectList(Wrappers.<ManageRecordIntervals>lambdaQuery().eq(ManageRecordIntervals::getRecordIntervalsTotalId,id)); |
| | | String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; |
| | | //çææ£éªæ¥ååæ¾ç»è®°è¡¨ |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/intervals-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("intervals", tableRenderData); |
| | | table.put("index1", index1); |
| | | intervalsList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("size", finalIndex); |
| | | put("intervalsList", intervalsList); |
| | | put("submitDate", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyå¹´MMæddæ¥"))); |
| | | put("submitDateEn", monthNames[LocalDate.now().getMonthValue() - 1] + " " + LocalDate.now().getDayOfMonth() + ", " + LocalDate.now().getYear()); |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("recycle", tableRenderData); |
| | | table.put("index1", index1); |
| | | recycleList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("size", finalIndex); |
| | | put("recycleList", recycleList); |
| | | }}); |
| | | String name = UUID.randomUUID() + "_æææä»¶çåæ¾ä¸åæ¶è®°å½" + ".docx"; |
| | |
| | | |
| | | private String recordTotaldeal(Integer id,String signatureUrl){ |
| | | List<ManageRecordVerify> manageRecordVerifies = manageRecordVerifyMapper.selectList(Wrappers.<ManageRecordVerify>lambdaQuery().eq(ManageRecordVerify::getManageRecordTotalId,id)); |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/verify-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("verify", tableRenderData); |
| | | table.put("index1", index1); |
| | | verifyList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("verifyList", verifyList); |
| | | put("size", finalIndex); |
| | | put("submitDate", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyå¹´MMæddæ¥"))); |
| | | put("submitDateEn", monthNames[LocalDate.now().getMonthValue() - 1] + " " + LocalDate.now().getDayOfMonth() + ", " + LocalDate.now().getYear()); |
| | | put("ratifyDate", "{{ratifyDate}}"); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ProcessReport; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | IPage<ProcessReport> pageProcessReport(Page page, @Param("ew") QueryWrapper<ProcessReport> queryWrappers); |
| | | |
| | | List<ProcessReport> getIds(List<Integer> ids); |
| | | List<ProcessReport> getIds(@Param("ids") List<Integer> ids); |
| | | } |
| | |
| | | private String complainName; |
| | | |
| | | @ApiModelProperty("å¤é®å
³è(æ£æµæ¥åid)") |
| | | @ExcelIgnore |
| | | private Integer insReportId; |
| | | |
| | | @ExcelIgnore |
| | | @TableField(select = false,exist = false) |
| | | //ç¨æ¥æ°å¢ä¼ åçæ¥åç¼å· |
| | | private String code; |
| | | @ExcelProperty(value = "æ£æµæ¥åç¼å·") |
| | | private String insReport; |
| | | |
| | | @ApiModelProperty("æ ·åç¼å·") |
| | | @ExcelIgnore |
| | |
| | | |
| | | @Override |
| | | public int addProcessComplain(ProcessComplain processComplain) { |
| | | //夿æ¥åç¼å·åæ ·åç¼å·æ¯å¦åå¨ |
| | | InsReport insReport = insReportMapper.selectOne(Wrappers.<InsReport>lambdaQuery().eq(InsReport::getCode, processComplain.getCode())); |
| | | if (ObjectUtils.isEmpty(insReport)) throw new ErrorException("æ¥åç¼å·è¾å
¥æè¯¯"); |
| | | processComplain.setInsReportId(insReport.getId()); |
| | | InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getSampleCode, processComplain.getSampleCode())); |
| | | if (ObjectUtils.isEmpty(insSample)) throw new ErrorException("æ ·åç¼å·è¾å
¥æè¯¯"); |
| | | //æè¯ç¼å·çæ |
| | | String giveCode = this.giveCode.giveCode("JCZX-", "cnas_process_complain", "", "yyMMdd"); |
| | | processComplain.setComplainNo(giveCode); |
| | |
| | | processReport.setSignatoryName(signatoryName); |
| | | } |
| | | //çææ£éªæ¥ååæ¾ç»è®°è¡¨ |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/report-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("report", tableRenderData); |
| | | table.put("index1", index1); |
| | | reportList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("reportList", reportList); |
| | | }}); |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("sample", tableRenderData); |
| | | table.put("index1", index1); |
| | | sampleList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("sampleList", sampleList); |
| | | put("size", finalIndex); |
| | | put("examineUrl", null); |
| | | put("ratifyUrl", null); |
| | | put("writeUrl", new FilePictureRenderData(100,50,imgUrl + "/" + signatureUrl)); |
| | |
| | | //çææ ·åå¤ç表word |
| | | private String processTotaldeal(Integer id,String signatureUrl){ |
| | | List<ProcessDeal> processDeals = processDealMapper.selectList(Wrappers.<ProcessDeal>lambdaQuery().eq(ProcessDeal::getTotaldealId,id)); |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/sample-deal.docx"); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | |
| | |
| | | tableRenderData.setTableStyle(tableStyle); |
| | | Map<String, Object> table = new HashMap<>(); |
| | | table.put("sample", tableRenderData); |
| | | table.put("index1", index1); |
| | | sampleList.add(table); |
| | | index1++; |
| | | } |
| | | } |
| | | Integer finalIndex = index1; |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("sampleList", sampleList); |
| | | put("size", finalIndex); |
| | | put("examineUrl", null); |
| | | put("ratifyUrl", null); |
| | | put("writeUrl", new FilePictureRenderData(100,50,imgUrl + "/" + signatureUrl)); |
| | |
| | | <id column="id" property="id"/> |
| | | <result column="complain_no" property="complainNo"/> |
| | | <result column="complain_name" property="complainName"/> |
| | | <result column="ins_report_id" property="insReportId"/> |
| | | <result column="ins_report" property="insReport"/> |
| | | <result column="sample_code" property="sampleCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="complainant" property="complainant"/> |
| | |
| | | </select> |
| | | <select id="getProcessComplain" resultType="com.yuanchu.mom.dto.ProcessComplainDto"> |
| | | select cpc.*, |
| | | ir.code, |
| | | u1.name complainant, |
| | | u1.phone, |
| | | u1.email, |
| | |
| | | left join user u4 on cpc.cause_analysis_user = u4.id |
| | | left join user u5 on cpc.corrective_action_user = u5.id |
| | | left join user u6 on cpc.corrective_action_confirmation_user = u6.id |
| | | left join ins_report ir on cpc.ins_report_id = ir.id |
| | | where cpc.id=#{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | <select id="pageProcessReport" resultType="com.yuanchu.mom.pojo.ProcessReport"> |
| | | select * from (select cpr.* , |
| | | u1.name sendUserName |
| | | from cnas_process_report cpr |
| | | left join user u1 on send_user=u1.id )A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getIds" resultType="com.yuanchu.mom.pojo.ProcessReport"> |
| | | select cpr.* , |
| | | u1.name sendUserName |
| | |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="pageProcessReport" resultType="com.yuanchu.mom.pojo.ProcessReport"> |
| | | select * from (select cpr.* , |
| | | u1.name sendUserName |
| | | from cnas_process_report cpr |
| | | left join user u1 on send_user=u1.id )A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | </mapper> |
ÎļþÃû´Ó inspect-server/src/main/java/com/yuanchu/mom/mapper/ProcessReportMapper.java ÐÞ¸Ä |
| | |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-11-05 08:58:39 |
| | | */ |
| | | public interface ProcessReportMapper extends BaseMapper<ProcessReport> { |
| | | public interface ProcessReportMapper1 extends BaseMapper<ProcessReport> { |
| | | |
| | | } |
| | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | import org.apache.poi.xwpf.usermodel.ParagraphAlignment; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private InsReportMapper insReportMapper; |
| | | |
| | | @Resource |
| | | ProcessReportMapper processReportMapper; |
| | | @Autowired |
| | | ProcessReportMapper1 processReportMapper; |
| | | |
| | | @Value("${wordUrl}") |
| | | private String wordUrl; |