| | |
| | | |
| | | @ApiOperation(value = "查询资质明细列表") |
| | | @PostMapping("/getCertificationDetail") |
| | | @ValueAuth |
| | | public Result getCertificationDetail(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | Certification certification = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Certification.class); |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime firstTime; |
| | | |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty(value = "最近颁发时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime recentlyTime; |
| | |
| | | private Integer createUser; |
| | | |
| | | @ValueTableShow(9) |
| | | @ApiModelProperty(value = "创建人") |
| | | @ApiModelProperty(value = "更新人") |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "修改人id") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ValueTableShow(10) |
| | | @ApiModelProperty(value = "创建时间") |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty(value = "最近颁发时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.mapper.InformationNotificationMapper; |
| | | import com.yuanchu.mom.pojo.InformationNotification; |
| | | import com.yuanchu.mom.pojo.InformationNotificationDto; |
| | |
| | | |
| | | @ApiOperation(value = "滚动分页查询") |
| | | @GetMapping("page") |
| | | @ValueAuth |
| | | public Result<?> getPage(Long size, Long current, String messageType) { |
| | | return Result.success(informationNotificationService.getPage(new Page<>(current, size), messageType)); |
| | | } |
| | | |
| | | @ApiOperation(value = "更新消息状态(拒绝、接收)") |
| | | @PutMapping("updateMessageStatus") |
| | | @ValueAuth |
| | | public Result<?> updateMessageStatus(@RequestBody InformationNotification informationNotification) { |
| | | informationNotificationService.updateById(informationNotification); |
| | | return Result.success(); |
| | |
| | | |
| | | @ApiOperation(value = "标记所有信息为已读/删除所有已读消息") |
| | | @PutMapping("informationReadOrDelete/{isMarkAllInformationRead}") |
| | | @ValueAuth |
| | | public Result<?> markAllInformationReadOrDeleteAllReadMessages(@PathVariable("isMarkAllInformationRead") Boolean isMarkAllInformationRead) { |
| | | informationNotificationService.markAllInformationReadOrDeleteAllReadMessages(isMarkAllInformationRead); |
| | | return Result.success(); |
| | |
| | | |
| | | @ApiOperation(value = "根据Id删除数据") |
| | | @DeleteMapping("deleteDataBasedOnId") |
| | | @ValueAuth |
| | | public Result<?> deleteDataBasedOnId(Integer id) { |
| | | informationNotificationService.removeById(id); |
| | | return Result.success(); |
| | |
| | | |
| | | @ApiOperation(value = "查询是否存在未读数据") |
| | | @GetMapping("checkForUnreadData") |
| | | @ValueAuth |
| | | public Result<?> checkForUnreadData() { |
| | | return Result.success(informationNotificationService.checkForUnreadData()); |
| | | } |
| | | |
| | | @ApiOperation(value = "点击详情触发修改状态为已读") |
| | | @PutMapping("triggerModificationStatusToRead/{id}") |
| | | @ValueAuth |
| | | public Result<?> triggerModificationStatusToRead(@PathVariable("id") Integer id) { |
| | | informationNotificationService.triggerModificationStatusToRead(id); |
| | | return Result.success(); |
| | |
| | | @ValueTableShow(value = 4, name = "样品型号") |
| | | private String model; |
| | | |
| | | @ValueTableShow(value = 5, name = "样品状态") |
| | | // @ValueTableShow(value = 5, name = "样品状态") |
| | | private Integer insState; |
| | | |
| | | @ValueTableShow(value = 15, name = "单位") |
| | |
| | | |
| | | private String inspectionItemType; |
| | | |
| | | @ValueTableShow(value = 11, name = "检验值类型") |
| | | // @ValueTableShow(value = 11, name = "检验值类型") |
| | | private String inspectionValueType; |
| | | |
| | | @ValueTableShow(value = 12, name = "要求值") |
| | |
| | | List<Map<String, Object>> tables = new ArrayList<>(); |
| | | Set<String> standardMethod = new HashSet<>(); |
| | | Set<String> deviceSet = new HashSet<>(); |
| | | AtomicReference<String> models = new AtomicReference<>(""); |
| | | Set<String> models = new HashSet<>(); |
| | | AtomicReference<Integer> productSize = new AtomicReference<>(0); |
| | | String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; |
| | | samples.forEach(a -> { |
| | | models.add(a.getModel()); |
| | | Set<String> templateSet = new HashSet<>(); |
| | | getTemplateThing(set, map2, a); |
| | | for (InsProduct b : a.getInsProduct()) { |
| | | models.set(models.get()+b.getModel()); |
| | | standardMethod.add(b.getMethodS()); |
| | | productSize.set(productSize.get()+1); |
| | | if (b.getInsProductResult() != null) { |
| | |
| | | String url; |
| | | try { |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx"); |
| | | File file = File.createTempFile("temp", ".tmp");OutputStream outputStream = new FileOutputStream(file); |
| | | File file = File.createTempFile("temp", ".tmp"); |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | } catch (FileNotFoundException e) { |
| | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String modelStr = ""; |
| | | for (String model : models) { |
| | | modelStr += "," + model; |
| | | } |
| | | String finalModelStr = modelStr; |
| | | ConfigureBuilder builder = Configure.builder(); |
| | | builder.useSpringEL(true); |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | |
| | | put("standardMethod", standardMethod2); |
| | | put("deviceList", deviceList); |
| | | put("twoCode", Pictures.ofLocal(codePath).create()); |
| | | put("models", models); |
| | | put("models", finalModelStr.replace(",", "")); |
| | | put("productSize", productSize); |
| | | put("createTime", now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"))); |
| | | put("createTimeEn", monthNames[now.getMonthValue()-1]+" "+now.getDayOfMonth()+", "+now.getYear()); |
| | |
| | | put("ratifyUrl", null); |
| | | }}); |
| | | try { |
| | | String name = now.format(DateTimeFormatter.ofPattern("yy_MM_dd&HH_mm_ss")) + ".docx"; |
| | | String name = insReport.getCode().replace("/", "") + ".docx"; |
| | | template.writeAndClose(Files.newOutputStream(Paths.get(wordUrl + "/" + name))); |
| | | insReport.setUrl("/word/" + name); |
| | | insReportMapper.insert(insReport); |
| | |
| | | import com.yuanchu.mom.dto.ReportPageDto; |
| | | import com.yuanchu.mom.dto.SampleOrderDto; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.InsOrderMapper; |
| | | import com.yuanchu.mom.mapper.UserMapper; |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | import com.yuanchu.mom.pojo.InsReport; |
| | | import com.yuanchu.mom.service.InsReportService; |
| | | import com.yuanchu.mom.mapper.InsReportMapper; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.ByteArrayOutputStream; |
| | |
| | | |
| | | @Value("${file.path}") |
| | | private String imgUrl; |
| | | |
| | | @Resource |
| | | private InsOrderMapper insOrderMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> pageInsReport(Page page, ReportPageDto reportPageDto) { |
| | |
| | | if (isExamine==0){ |
| | | //如果审核不通过 |
| | | insReport.setState(0);//提交状态改为待提交 |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | //获取审核人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl(); |
| | |
| | | |
| | | //批准 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) { |
| | | InsReport insReport = insReportMapper.selectById(id); |
| | | insReport.setIsRatify(isRatify); |
| | |
| | | if (isRatify==0){ |
| | | //如果批准不通过 |
| | | insReport.setState(0);//提交状态改为待提交 |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | //获取审核人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl(); |
| | |
| | | wordInsertUrl(new HashMap<String, Object>(){{ |
| | | put("ratifyUrl", Pictures.ofLocal(imgUrl+"/"+signatureUrl).create()); |
| | | }}, (urlS==null?url:urlS).replace("/word", wordUrl)); |
| | | InsOrder insOrder = new InsOrder(); |
| | | insOrder.setId(insReportMapper.selectById(id).getInsOrderId()); |
| | | insOrder.setState(4); |
| | | insOrderMapper.updateById(insOrder); |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | |
| | |
| | | <select id="selectSampleAndProductByOrderId" resultType="com.yuanchu.mom.dto.SampleProductDto2"> |
| | | select * |
| | | from ( |
| | | select i.id,isa.sample_code,isa.sample,isa.model,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass, |
| | | select i.id,isa.sample_code,isa.sample,isa.model,isa.ins_state,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass, |
| | | ip.son_laboratory,ip.inspection_item_type,ip.inspection_value_type,ip.ask,ip.`last_value`,ip.ins_result,ipr.equip_value |
| | | from ins_sample isa |
| | | left join ins_order i on isa.ins_order_id = i.id |