| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | for (SampleProductDto samples : list) { |
| | | if (BeanUtil.isEmpty(samples.getInsProduct())) continue; |
| | | for (InsProduct product : samples.getInsProduct()) { |
| | | if (product.getTemplateId() == null) { |
| | | product.setTemplate(new ArrayList<>()); |
| | | continue; |
| | | } |
| | | if(set.add(product.getTemplateId())){ |
| | | map2.put(product.getTemplateId(), standardTemplateService.getStandTempThingById(product.getTemplateId()) + ""); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int verifyPlan(Integer orderId, String laboratory, Integer type, String tell) { |
| | | Integer num = (type==1?5:4); |
| | | return insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, orderId).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, num).set(InsOrderState::getVerifyTell, tell)); |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, orderId).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, num).set(InsOrderState::getVerifyTell, tell).set(InsOrderState::getVerifyUser, getLook.selectPowerByMethodAndUserId(null).get("userId"))); |
| | | List<InsOrderState> insOrderStates = insOrderStateMapper.selectList(Wrappers.<InsOrderState>lambdaQuery().eq(InsOrderState::getInsOrderId, orderId)); |
| | | long count = insOrderStates.stream().filter(a -> a.getInsState() == 5).count(); |
| | | if (count == insOrderStates.size()) { |
| | | XWPFTemplate template = XWPFTemplate.compile("template.docx").render( |
| | | new HashMap<String, Object>() {{ |
| | | put("title", "Hi, poi-tl Word模板引擎"); |
| | | }}); |
| | | try { |
| | | template.writeAndClose(new FileOutputStream("output.docx")); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId)); |
| | | insSamples.forEach(a -> { |
| | | System.out.println(a); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsSampleId, a.getId())); |
| | | insProducts.forEach(System.out::println); |
| | | }); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |