| | |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(InsOrderPlanVO.class)); |
| | | Integer userId = null; |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | User user = userMapper.selectById(map1.get("userId"));//当前登录的人 |
| | | |
| | | //获取当前人所属实验室id |
| | | String departLimsId = user.getDepartLimsId(); |
| | | String laboratory = null; |
| | | if (ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //查询对应架构名称(通信实验室,电力实验室,检测办) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("实验室")) { |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | Integer userId =null; |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId()) ) { |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | userId = map1.get("userId"); |
| | | userId = map1.get("userId"); |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId,sonLaboratory); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId,sonLaboratory,laboratory); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | map.put("head", PrintChina.printChina(InsOrderPlanTaskSwitchVo.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | User user = userMapper.selectById(map1.get("userId"));//当前登录的人 |
| | | |
| | | //获取当前人所属实验室id |
| | | String departLimsId = user.getDepartLimsId(); |
| | | String laboratory = null; |
| | | if (ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //查询对应架构名称(通信实验室,电力实验室,检测办) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("实验室")) { |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) { |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | IPage<InsOrderPlanTaskSwitchVo> insOrderPage = insSampleMapper.inspectionOrderDetailsTaskSwitching(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId,sonLaboratory); |
| | | IPage<InsOrderPlanTaskSwitchVo> insOrderPage = insSampleMapper.inspectionOrderDetailsTaskSwitching(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId,sonLaboratory,laboratory); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | insProducts = insSampleMapper.getInsProduct3(id); |
| | | break; |
| | | } |
| | | // 数采新增 |
| | | getDeviceMessage(insProducts, request); |
| | | |
| | | Set<Integer> set = new HashSet<>(); |
| | | Map<Integer, String> map2 = new HashMap<>(); |
| | |
| | | return insProducts; |
| | | } |
| | | |
| | | private List<InsProduct> getDeviceMessage(List<InsProduct> insProducts, HttpServletRequest request) { |
| | | String ipAddress = request.getRemoteAddr(); |
| | | // 防止回环地址变为IPv6 |
| | | String ip = ipAddress.equals("0:0:0:0:0:0:0:1") ? "127.0.0.1" : ipAddress; |
| | | insProducts.forEach(i -> { |
| | | Map<String, Object> devices = baseMapper.getDeviceMessage(ip, i.getInspectionItem(), i.getInspectionItemSubclass()); |
| | | if (ObjectUtils.isNotEmpty(devices) && ObjectUtils.isNotEmpty(devices.get("file_type")) && ObjectUtils.isNotEmpty(devices.get("collect_url"))) { |
| | | InsProductResult insProductResult = i.getInsProductResult(); |
| | | if (ObjectUtils.isEmpty(insProductResult)) { |
| | | insProductResult = new InsProductResult(); |
| | | } |
| | | List<Object> list = new ArrayList<>(); |
| | | Map<Object, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("v", devices.get("device_name")); |
| | | list.add(hashMap); |
| | | insProductResult.setEquipName(JSON.toJSON(list).toString()); |
| | | List<Object> listValue = new ArrayList<>(); |
| | | Map<Object, Object> hashMapValue = new HashMap<>(); |
| | | hashMapValue.put("v", devices.get("management_number")); |
| | | listValue.add(hashMapValue); |
| | | insProductResult.setEquipName(JSON.toJSON(list).toString()); |
| | | insProductResult.setEquipValue(JSON.toJSON(listValue).toString()); |
| | | i.setInsProductResult(insProductResult); |
| | | } |
| | | }); |
| | | return insProducts; |
| | | } |
| | | @Override |
| | | public List<String> checkSubmitPlan(Integer orderId, String laboratory) { |
| | | List<String> collect = new ArrayList<>(); |
| | |
| | | ProductVo productVo = new ProductVo(); |
| | | productVo.setCode(insFiber.getCode()); |
| | | productVo.setColor(fiber.getColor()); |
| | | productVo.setBushColor(fiber.getBushColor()); |
| | | productVo.setBushColor(insBushing.getColor()); |
| | | if (ObjectUtils.isNotEmpty(insProductResult)) { |
| | | insProduct.setInsProductResult(insProductResult); |
| | | } |
| | |
| | | for (InsProduct insProduct : insProducts) { |
| | | InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | ProductVo productVo = new ProductVo(); |
| | | productVo.setCode("/"); |
| | | productVo.setCode("-"); |
| | | productVo.setColor(fiber.getColor()); |
| | | productVo.setBushColor(fiber.getBushColor()); |
| | | insProduct.setInsProductResult(insProductResult); |
| | |
| | | LocalTime startTime = LocalTime.parse(shiftTime.getStartTime(), forma); |
| | | LocalTime endTime = LocalTime.parse(shiftTime.getEndTime(), forma); |
| | | // 检查当前时间是否在范围内(包括边界) |
| | | boolean isWithinRange = !now.isBefore(startTime) && !now.isAfter(endTime); |
| | | boolean isWithinRange; |
| | | if (endTime.isAfter(startTime)) { |
| | | // 不跨天的情况 |
| | | isWithinRange = !now.isBefore(startTime) && !now.isAfter(endTime); |
| | | } else { |
| | | // 跨天的情况 |
| | | isWithinRange = !now.isBefore(startTime) || !now.isAfter(endTime); |
| | | } |
| | | //加班 |
| | | AuxiliaryOutputWorkingHours count1 = auxiliaryOutputWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() |
| | | .eq(AuxiliaryOutputWorkingHours::getCheck, userId) |
| | |
| | | } catch (Exception e) { |
| | | throw new ErrorException("找不到检验人的签名"); |
| | | } |
| | | if (signatureUrl.equals("")) { |
| | | if (ObjectUtils.isEmpty(signatureUrl) || signatureUrl.equals("")) { |
| | | throw new ErrorException("找不到检验人的签名"); |
| | | } |
| | | //Custom custom = customMapper.selectById(user.get("company")); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | else { |
| | | //复核不通过将把复核的负责人去掉 |
| | | Integer id = insSampleUserMapper.selectOne(Wrappers.<InsSampleUser>lambdaQuery().eq(InsSampleUser::getInsSampleId, orderId).orderByDesc(InsSampleUser::getId).last("limit 1")).getId(); |
| | | insSampleUserMapper.deleteById(id); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode, String sampleCode) { |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode) { |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); |
| | | List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | |
| | | return null; |
| | | }); |
| | | // 删除数采采集次数 |
| | | String key = "frequency" + ":" + entrustCode + ":" + sampleCode; |
| | | RedisUtil.del(key); |
| | | String key = "frequency" + ":" + entrustCode + ":*"; |
| | | RedisUtil.delsLike(key); |
| | | return 1; |
| | | } |
| | | |