| | |
| | | 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.deepoove.poi.config.Configure; |
| | | import com.deepoove.poi.config.ConfigureBuilder; |
| | | import com.deepoove.poi.data.*; |
| | | import com.deepoove.poi.data.style.*; |
| | | import com.deepoove.poi.util.TableTools; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.*; |
| | | import com.yuanchu.mom.vo.*; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.*; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | |
| | | if (BeanUtil.isEmpty(order.getInsTime())) { |
| | | insOrder.setInsTime(LocalDateTime.now()); |
| | | insOrderMapper.updateById(insOrder); |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, id).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, 1)); |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate() |
| | | .eq(InsOrderState::getInsOrderId, id) |
| | | .eq(InsOrderState::getLaboratory, laboratory) |
| | | .set(InsOrderState::getInsTime, LocalDateTime.now()) |
| | | .set(InsOrderState::getInsState, 1)); |
| | | } |
| | | Map<String, Object> map = insOrderService.getInsOrderAndSample(id, laboratory); |
| | | List<SampleProductDto> list = JSON.parseArray(JSON.toJSONString(map.get("sampleProduct")), SampleProductDto.class); |
| | |
| | | } catch (Exception e) { |
| | | insProduct.setLastValue("");//'' |
| | | } |
| | | //试验前样品检查 |
| | | try { |
| | | JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("beforeCheck"))); |
| | | if (resValue.get("v") != null) { |
| | | Object o = JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v"); |
| | | result.setBeforeCheck(o.equals("") ? null : (o.toString())); |
| | | } |
| | | } catch (Exception e) { |
| | | result.setBeforeCheck("");//'' |
| | | } |
| | | //试验后样品检查 |
| | | try { |
| | | JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("afterCheck"))); |
| | | if (resValue.get("v") != null) { |
| | | Object o = JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v"); |
| | | result.setAfterCheck(o.equals("") ? null : (o.toString())); |
| | | } |
| | | } catch (Exception e) { |
| | | result.setAfterCheck("");//'' |
| | | } |
| | | //设备编号 |
| | | if (jo.get("equipValue") != null) { |
| | | JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("equipValue"))); |
| | |
| | | if (insProduct.getAsk().equals("/")) { |
| | | ressult = 3; //不判定 |
| | | } |
| | | if (!isValueValid(valueStr, new String[]{insProduct.getAsk()})) { |
| | | else if (!isValueValid(valueStr, new String[]{insProduct.getAsk()})) { |
| | | ressult = 0; //不合格 |
| | | } |
| | | } else { |
| | | } |
| | | else { |
| | | // 如果要求值是(2°≥20,7°≥25,12°≥25)这种情况 |
| | | String[] askParts = insProduct.getAsk().split(","); |
| | | String[] angles = insProductResult2.getAngle().split(","); |
| | |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate() |
| | | .eq(InsOrderState::getInsOrderId, orderId) |
| | | .eq(InsOrderState::getLaboratory, laboratory) |
| | | .set(InsOrderState::getInsTime, now) |
| | | .set(InsOrderState::getInsState, 6) |
| | | .set(InsOrderState::getVerifyTell, tell) |
| | | .set(InsOrderState::getVerifyUser, userId)); |
| | |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate() |
| | | .eq(InsOrderState::getInsOrderId, orderId) |
| | | .eq(InsOrderState::getLaboratory, laboratory) |
| | | .set(InsOrderState::getInsTime, now) |
| | | .set(InsOrderState::getInsState, 5) |
| | | .set(InsOrderState::getVerifyTell, tell) |
| | | .set(InsOrderState::getVerifyUser, userId)); |
| | |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate() |
| | | .eq(InsOrderState::getInsOrderId, orderId) |
| | | .eq(InsOrderState::getLaboratory, laboratory) |
| | | .set(InsOrderState::getInsTime, LocalDateTime.now()) |
| | | .set(InsOrderState::getInsState, 3) |
| | | .set(InsOrderState::getVerifyUser, verifyUser)); |
| | | /*这个情况先关闭----如果是C类订单且是下发到质量部,则直接复核通过(结束试验)*/ |
| | |
| | | return null; |
| | | }); |
| | | /*生成电路试验的站点报告并上传到附件中*/ |
| | | /*if (laboratory.equals("电路试验")) { |
| | | MultipartFile file = wordUtils.generateWord(note, term, orderState); |
| | | uploadFile(orderId,file); |
| | | }*/ |
| | | if (laboratory.equals("电路试验")) { |
| | | wordUtils.generateWord(note, term, orderState); |
| | | // try { |
| | | // wordUtils.generateWord(note, term, orderState); |
| | | // }catch (Exception e){ |
| | | // throw new ErrorException("电路试验的站点报告生成有误,请联系开发人员调整!"); |
| | | // } |
| | | } |
| | | // 删除数采采集次数 |
| | | String key = "frequency" + ":" + entrustCode + ":*"; |
| | | RedisUtil.delsLike(key); |