| | |
| | | |
| | | @Service |
| | | @Transactional |
| | | public class TjSysAsyncServiceImpl implements TjAsyncService { |
| | | public class TjSysAsyncServiceImpl implements TjAsyncService { |
| | | @Resource |
| | | private ITjProjectService projectService; |
| | | @Resource |
| | |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | long l = System.currentTimeMillis(); |
| | | |
| | | LambdaQueryWrapper<TjAskMedicalHistory> wq=new LambdaQueryWrapper<>(); |
| | | wq.eq(TjAskMedicalHistory::getCusId,tjCustomer.getCusId()); |
| | | LambdaQueryWrapper<TjAskMedicalHistory> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjAskMedicalHistory::getCusId, tjCustomer.getCusId()); |
| | | wq.isNull(TjAskMedicalHistory::getTjNum); |
| | | TjAskMedicalHistory history = tjAskMedicalHistoryService.getOne(wq); |
| | | if(null !=history){ |
| | | if (null != history) { |
| | | history.setTjNum(tjOrder.getTjNumber()); |
| | | tjAskMedicalHistoryService.updateById(history); |
| | | } |
| | | |
| | | List<TbTransition> tbTransitionList =null; |
| | | List<TbTransition> tbTransitionList = null; |
| | | if (redisCache.hasKey(tjCustomer.getCusIdcard())) { |
| | | tbTransitionList = redisCache.getCacheList(tjCustomer.getCusIdcard()); |
| | | redisCache.deleteObject(tjCustomer.getCusIdcard()); |
| | | }else { |
| | | } else { |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, tjCustomer.getCusIdcard()); |
| | | tbTransitionList = transitionService.list(wqq); |
| | |
| | | redisCache.deleteObject(tjCustomer.getCusIdcard() + "cusId"); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(),String.valueOf(tjOrder.getOrderId()),sysUser.getNickName(),String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | |
| | | //修改每项的原价现价 |
| | | for (TbTransition transition : tbTransitionList) { |
| | |
| | | LambdaQueryWrapper<TjOrderDetail> wrapper1 = new LambdaQueryWrapper<>(); |
| | | wrapper1.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | List<TjOrderDetail> list = tjOrderDetailService.list(wrapper1); |
| | | if (list != null && list.size()>0) { |
| | | if (list != null && list.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : list) { |
| | | TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); |
| | | if(tjProject==null){ |
| | | if (tjProject == null) { |
| | | continue; |
| | | } |
| | | tjOrderDetail.setProject(tjProject); |
| | |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | } |
| | | if(tjFlowingWater.getPayStasus()==1){ |
| | | if (tjFlowingWater.getPayStasus() == 1) { |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } |
| | | } |
| | | System.out.println("这段代码时间"+(l-System.currentTimeMillis())); |
| | | System.out.println("这段代码时间" + (l - System.currentTimeMillis())); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void ttextracted(TjOrder tjOrder, TjCustomer tjCustomer,SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | public void ttextracted(TjOrder tjOrder, TjCustomer tjCustomer, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | |
| | | boolean b = tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | if (!b){ |
| | | List<TjGroupingPro> proList = groupingProService.list(new LambdaQueryWrapper<TjGroupingPro>().eq(TjGroupingPro::getGroupingId,tjOrder.getGroupId())); |
| | | if(null !=proList && proList.size()>0){ |
| | | if (!b) { |
| | | List<TjGroupingPro> proList = groupingProService.list(new LambdaQueryWrapper<TjGroupingPro>().eq(TjGroupingPro::getGroupingId, tjOrder.getGroupId())); |
| | | if (null != proList && proList.size() > 0) { |
| | | for (TjGroupingPro groupingPro : proList) { |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | // if (null != transition.getPacId()) { |
| | |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | //获取该项目的默认值赋值给结果 |
| | | if(null !=project.getProDefault()){ |
| | | if (null != project.getProDefault()) { |
| | | detail.setProResult(project.getProDefault()); |
| | | }else { |
| | | } else { |
| | | detail.setProResult(null); |
| | | } |
| | | detail.setIsSampling(String.valueOf(project.getIsSampling())); |
| | |
| | | } |
| | | |
| | | //添加remark表数据 |
| | | orderRemarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | orderRemarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | |
| | | //判断是否交钱 |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | } |
| | | if (tjFlowingWater.getPayStasus() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | |
| | | // List<TjOrderDetail> list = tjOrderDetailService.getTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId())); |
| | |
| | | @Async("async") |
| | | public void collectFees(TjOrder order, List<TjConsumables> list2, List<TbTransition> tbTransitionList, SysUser sysUser, String discount) { |
| | | orderRemarkService.deletedOrderRemarkByTjNum(order.getTjNumber()); |
| | | redisCache.deleteObject("getOrderDetailByProParentId"+order.getTjNumber()); |
| | | redisCache.deleteObject("getOrderDetailByProParentId" + order.getTjNumber()); |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(discount)).divide(BigDecimal.valueOf(10)))); |
| | | transitionService.updateById(transition); |
| | |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(parentProId); |
| | | tjOrderRemark.setProName(parentProject.getProName()); |
| | | tjOrderRemark.setDeptId(parentProject.getDeptId()); |
| | |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | Map<String, Object> map = getOrderDetailByProParentId(String.valueOf(parentProId), order.getTjNumber()); |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId"+order.getTjNumber(),String.valueOf(parentProId),map); |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + order.getTjNumber(), String.valueOf(parentProId), map); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | wq.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | wq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq.eq(TjOrderDetail::getIsSampling,0); |
| | | wq.eq(TjOrderDetail::getIsSampling, 0); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | if(null !=detailList && detailList.size()>0){ |
| | | if (null != detailList && detailList.size() > 0) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | TjSampling sampling=new TjSampling(); |
| | | if(null==projectService.getById(detail.getProId())) continue; |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | Long proParentId = projectService.getById(detail.getProId()).getProParentId(); |
| | | if(null !=proParentId && proParentId ==0){ |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setSpecimenType(projectService.getById(detail.getProId()).getSpecimenType()); |
| | | }else { |
| | | } else { |
| | | sampling.setSpecimenType(projectService.getById(projectService.getById(detail.getProId()).getProParentId()).getSpecimenType()); |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId()))!=null) { |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void abandonCheck(String tjNumber, TjOrder tjOrder, List<TjOrderDetail> list, SysUser sysUser) { |
| | | public void abandonCheck(String tjNumber, TjOrder tjOrder, List<TjOrderDetail> list, SysUser sysUser) { |
| | | for (TjOrderDetail tjOrderDetail : list) { |
| | | LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProId, tjOrderDetail.getProId()); |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | String[] tjProIds = tjFlowingWater.getTjProIds(); |
| | | for (String tjProId : tjProIds) { |
| | | TjProject project = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | | tjOrderRemark.setProName(project.getProName()); |
| | | tjOrderRemark.setDeptId(project.getDeptId()); |
| | |
| | | public void dockerSetCustomerLisByRedis(List<Long> ksproList, String ksId) { |
| | | List<TjCustomer> yjAjaxResult = getYjAjaxResult(ksproList); |
| | | List<TjCustomer> wjAjaxResult = getWjAjaxResult(ksproList); |
| | | redisCache.setCacheMapValue(ksId + "ks", "wj",wjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "yj",yjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "wj", wjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "yj", yjAjaxResult); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void checkSetCustomerLisByRedis(String config) { |
| | | List<TjCustomer> wsResult = getWsResult(config); |
| | | List<TjCustomer> ysResult = getYsResult(config); |
| | | redisCache.setCacheMapValue("check", "ws",wsResult); |
| | | redisCache.setCacheMapValue("check", "ys",ysResult); |
| | | redisCache.setCacheMapValue("check", "ws", wsResult); |
| | | redisCache.setCacheMapValue("check", "ys", ysResult); |
| | | //查询 |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void wCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | public void wCScheckSetCustomerLisByRedis(List<TjOrder> orderList) { |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | redisCache.setCacheMapValue("cScheck", "ws",customerList); |
| | | redisCache.setCacheMapValue("cScheck", "ws", customerList); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void yCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | public void yCScheckSetCustomerLisByRedis(List<TjOrder> orderList) { |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | redisCache.setCacheMapValue("cScheck", "ys",customerList); |
| | | redisCache.setCacheMapValue("cScheck", "ys", customerList); |
| | | } |
| | | |
| | | |
| | |
| | | LambdaQueryWrapper<TjProject> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjProject::getProParentId, refundPro.getProId()); |
| | | List<Long> collect = projectService.list(wq0).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjSampling>wq1=new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum,tjNum); |
| | | wq1.in(TjSampling::getProId,collect); |
| | | LambdaQueryWrapper<TjSampling> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum, tjNum); |
| | | wq1.in(TjSampling::getProId, collect); |
| | | List<TjSampling> list = samplingService.list(wq1); |
| | | if(null !=list && list.size()>0) samplingService.removeByIds(list.stream().map(TjSampling::getId).collect(Collectors.toList())); |
| | | LambdaQueryWrapper<TjSampling>wq2=new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjSampling::getTjNum,tjNum); |
| | | wq2.eq(TjSampling::getProId,refundPro.getProId()); |
| | | if (null != list && list.size() > 0) |
| | | samplingService.removeByIds(list.stream().map(TjSampling::getId).collect(Collectors.toList())); |
| | | LambdaQueryWrapper<TjSampling> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjSampling::getTjNum, tjNum); |
| | | wq2.eq(TjSampling::getProId, refundPro.getProId()); |
| | | samplingService.remove(wq2); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId"+tjNum, String.valueOf(refundPro.getProId())); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId" + tjNum, String.valueOf(refundPro.getProId())); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveSampling() { |
| | | redisCache.setCacheMapValue("sampling", "yqs",getYWqsResult(0)); |
| | | redisCache.setCacheMapValue("sampling", "wqs",getYWqsResult(1)); |
| | | redisCache.setCacheMapValue("sampling", "yqs", getYWqsResult(0)); |
| | | redisCache.setCacheMapValue("sampling", "wqs", getYWqsResult(1)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | TjOrderRemark remark = orderRemarkService.getById(domainVo.getRemarkId()); |
| | | TjOrder order = orderService.getOrderByTjNum(domainVo.getTjNumber()); |
| | | //给弃检表添加记录 |
| | | if(domainVo.getType().equals(2)){ |
| | | if (domainVo.getType().equals(2)) { |
| | | TjDiscardInspection td = new TjDiscardInspection(); |
| | | td.setProId(String.valueOf(remark.getProId())); |
| | | td.setProName(projectService.selectTjProjectByProId(remark.getProId()).getProName()); |
| | |
| | | td.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | td.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | discardInspectionService.save(td); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId"+domainVo.getTjNumber(),String.valueOf(remark.getProId())); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId" + domainVo.getTjNumber(), String.valueOf(remark.getProId())); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjProject>wq1=new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProParentId,remark.getProId()); |
| | | LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProParentId, remark.getProId()); |
| | | List<TjProject> projectList = projectService.list(wq1); |
| | | if(null !=projectList && projectList.size()>0){ |
| | | if (null != projectList && projectList.size() > 0) { |
| | | List<Long> collect = projectList.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjOrderDetail>wq2=new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | wq2.in(TjOrderDetail::getProId,collect); |
| | | LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | wq2.in(TjOrderDetail::getProId, collect); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq2); |
| | | if(null !=detailList && detailList.size()>0){ |
| | | if (null != detailList && detailList.size() > 0) { |
| | | for (TjOrderDetail detail : detailList) { |
| | | detail.setTjStatus(Long.valueOf(remark.getType())); |
| | | if(null !=remark.getRemark()) detail.setRemark(domainVo.getRemark()); |
| | | if(null !=remark.getYqDeadline()) detail.setYqDeadline(remark.getYqDeadline()); |
| | | if (null != remark.getRemark()) detail.setRemark(domainVo.getRemark()); |
| | | if (null != remark.getYqDeadline()) detail.setYqDeadline(remark.getYqDeadline()); |
| | | tjOrderDetailService.updateById(detail); |
| | | } |
| | | } |
| | |
| | | tjOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderService.updateById(tjOrder); |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | TjYqOrder yqOrder=new TjYqOrder(); |
| | | TjYqOrder yqOrder = new TjYqOrder(); |
| | | yqOrder.setTjNum(s); |
| | | yqOrder.setCusName(customer.getCusName()); |
| | | yqOrder.setSex(String.valueOf(customer.getCusSex())); |
| | |
| | | for (TjPackageProject tjPackageProject : ppList) { |
| | | TjProject project = projectService.getById(tjPackageProject.getProId()); |
| | | if (null != project) { |
| | | BigDecimal divide = tjPackageProject.getPriceNow().divide(project.getProPrice(),5, RoundingMode.DOWN); |
| | | BigDecimal divide = tjPackageProject.getPriceNow().divide(project.getProPrice(), 5, RoundingMode.DOWN); |
| | | LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjProject::getProParentId, project.getProId()); |
| | | List<TjProject> tjProSonList = projectService.list(wq2); |
| | |
| | | tbTransition.setPacId(pacId); |
| | | |
| | | if (null != tjPackageProject.getPriceNow() && divide.compareTo(BigDecimal.valueOf(0)) > 0) { |
| | | tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2, RoundingMode.HALF_DOWN)); |
| | | tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2, RoundingMode.HALF_DOWN)); |
| | | } else { |
| | | tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveRedisTransitionByPacId(String cusId, Long pacId,List<Long> proIds) { |
| | | if(null != pacId){ |
| | | transitionService.saveRedisTransitionByPacId(cusId,pacId); |
| | | public void saveRedisTransitionByPacId(String cusId, Long pacId, List<Long> proIds) { |
| | | if (null != pacId) { |
| | | transitionService.saveRedisTransitionByPacId(cusId, pacId); |
| | | } |
| | | if(null != proIds && proIds.size() > 0){ |
| | | saveRedisTransitionByProId(cusId,proIds); |
| | | if (null != proIds && proIds.size() > 0) { |
| | | saveRedisTransitionByProId(cusId, proIds); |
| | | } |
| | | } |
| | | |
| | |
| | | getTjPackageListByWoMan(tjPackageService.getTjPackageListByWoMan()); |
| | | |
| | | //未知 |
| | | getTjPackageListByManAndWoMan(tjPackageService.list(new LambdaQueryWrapper<TjPackage>().eq(TjPackage::getPacStatus,0))); |
| | | getTjPackageListByManAndWoMan(tjPackageService.list(new LambdaQueryWrapper<TjPackage>().eq(TjPackage::getPacStatus, 0))); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void addNewReservationConfirm(List<TjReservation> rightList ) { |
| | | if(null !=rightList && rightList.size()>0){ |
| | | public void addNewReservationConfirm(List<TjReservation> rightList) { |
| | | if (null != rightList && rightList.size() > 0) { |
| | | for (TjReservation reservation : rightList) { |
| | | transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | List<AddNewReservationConfirm> confirmList = groupingProService.getAddNewReservationConfirm(reservation.getGroupingId()); |
| | | if (null !=confirmList && confirmList.size()>0){ |
| | | if (null != confirmList && confirmList.size() > 0) { |
| | | for (AddNewReservationConfirm confirm : confirmList) { |
| | | List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(reservation.getIdCard(),confirm.getPid()); |
| | | List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(reservation.getIdCard(), confirm.getPid()); |
| | | if (null != transitionss && transitionss.size() > 0) { |
| | | continue; |
| | | } |
| | |
| | | @Override |
| | | @Async("async") |
| | | public void saveNewReservationConfirm(List<TjReservation> rightList) { |
| | | if(null !=rightList && rightList.size()>0){ |
| | | if (null != rightList && rightList.size() > 0) { |
| | | //创建线程池 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(rightList.size()); |
| | | for (TjReservation reservation : rightList) { |
| | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(),reservation.getGroupingId()); |
| | | transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(), reservation.getGroupingId()); |
| | | |
| | | threadPool.shutdown(); |
| | | } catch (Exception e) { |
| | |
| | | @Override |
| | | @Async("async") |
| | | public void updateCheckType(String tjNum) { |
| | | redisCache.setCacheMapValue("updateCheckType"+tjNum,tjNum,getAjaxResult(tjNum)); |
| | | redisCache.setHashKeyExpireTime("updateCheckType"+tjNum,7L, TimeUnit.DAYS); |
| | | redisCache.setCacheMapValue("updateCheckType" + tjNum, tjNum, getAjaxResult(tjNum)); |
| | | redisCache.setHashKeyExpireTime("updateCheckType" + tjNum, 7L, TimeUnit.DAYS); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getPrintOrderList(List<TjOrder> list) { |
| | | |
| | | redisCache.setCacheMapValue("getPrintOrderList","0",extracted(0, list)); |
| | | redisCache.setCacheMapValue("getPrintOrderList","1",extracted(1, list)); |
| | | redisCache.setCacheMapValue("getPrintOrderList", "0", extracted(0, list)); |
| | | redisCache.setCacheMapValue("getPrintOrderList", "1", extracted(1, list)); |
| | | |
| | | } |
| | | |
| | |
| | | @Async("async") |
| | | public void getDictSfxms() { |
| | | List<DictSfxm> dictSfxm = getDictSfxm(); |
| | | redisCache.setCacheObject("getDictSfxms",dictSfxm); |
| | | redisCache.setCacheObject("getDictSfxms", dictSfxm); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getOrderDetailByProParentId(String tjNumber,Map<String, Object> map,String proParentId) { |
| | | if(null !=map && !map.isEmpty()){ |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId"+tjNumber,proParentId,map); |
| | | }else { |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId"+tjNumber,proParentId,getOrderDetailByProParentId(proParentId,tjNumber)); |
| | | public void getOrderDetailByProParentId(String tjNumber, Map<String, Object> map, String proParentId) { |
| | | if (null != map && !map.isEmpty()) { |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + tjNumber, proParentId, map); |
| | | } else { |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + tjNumber, proParentId, getOrderDetailByProParentId(proParentId, tjNumber)); |
| | | } |
| | | redisCache.setHashKeyExpireTime("getOrderDetailByProParentId"+tjNumber,7L,TimeUnit.DAYS); |
| | | redisCache.setHashKeyExpireTime("getOrderDetailByProParentId" + tjNumber, 7L, TimeUnit.DAYS); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getLineChart() { |
| | | redisCache.setCacheObject("getLineChart",getLineCharts()); |
| | | redisCache.setCacheObject("getLineChart", getLineCharts()); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getPieChart() { |
| | | redisCache.setCacheObject("getPieChart",getPieCharts()); |
| | | redisCache.setCacheObject("getPieChart", getPieCharts()); |
| | | } |
| | | |
| | | //首页饼状图登记人数接口 |
| | |
| | | } |
| | | return dictSfxms; |
| | | } |
| | | |
| | | private List<TjOrder> extracted(Integer type, List<TjOrder> list) { |
| | | List<TjOrder> list1=new ArrayList<>(); |
| | | List<TjOrder> list1 = new ArrayList<>(); |
| | | for (TjOrder order : list) { |
| | | TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setGrMoBanId(reportService.getGrMoBanIds()); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | if (null != tjCustomer.getCusPhone()) |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if (null != tjCustomer.getCusIdcard()) |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != compService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { |
| | |
| | | } |
| | | return list1; |
| | | } |
| | | |
| | | private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByMan"); |
| | | if (redisCache.hasKey("getTjPackageListBySex")) { |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex", "getTjPackageListByMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByMan",tjPackageList); |
| | | redisCache.setCacheMapValue("getTjPackageListBySex", "getTjPackageListByMan", tjPackageList); |
| | | } |
| | | } |
| | | |
| | | private void getTjPackageListByWoMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan"); |
| | | if (redisCache.hasKey("getTjPackageListBySex")) { |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex", "getTjPackageListByWoMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan",tjPackageList); |
| | | redisCache.setCacheMapValue("getTjPackageListBySex", "getTjPackageListByWoMan", tjPackageList); |
| | | } |
| | | } |
| | | |
| | | private void getTjPackageListByManAndWoMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan"); |
| | | if (redisCache.hasKey("getTjPackageListBySex")) { |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex", "getTjPackageListByManAndWoMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan",tjPackageList); |
| | | redisCache.setCacheMapValue("getTjPackageListBySex", "getTjPackageListByManAndWoMan", tjPackageList); |
| | | } |
| | | } |
| | | |
| | | //已检 |
| | | public List<TjCustomer> getYjAjaxResult(List<Long> ksproList) { |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | |
| | | for (Long orderId : orderIds) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | if (null == order) { |
| | | continue; |
| | | } |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | qww.eq(TjOrderDetail::getTjStatus, 0); |
| | | qww.eq(TjOrderDetail::getTjStatus,0); |
| | | qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | if (null != lists && lists.size() > 0) { |
| | | if (null != lists&&lists.size()>0) { |
| | | continue; |
| | | } |
| | | |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : lists) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive()==1){ |
| | | break; |
| | | } |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | |
| | | customer.setIsHz(order.getIsHz()); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0,3); |
| | | wq.in(TjOrderRemark::getType, 0, 3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | customerLis.add(customer); |
| | | } |
| | |
| | | } |
| | | return customerLis; |
| | | } |
| | | |
| | | //未检 |
| | | public List<TjCustomer> getWjAjaxResult(List<Long> ksproList) { |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | |
| | | for (Long orderId : orderIds) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | if (null == order) { |
| | | continue; |
| | | } |
| | | |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | |
| | | if (null != customer) { |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | if (null != lists) { |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : lists) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive()==1){ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | |
| | | customer.setTjStatus(0L); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0,3); |
| | | wq.in(TjOrderRemark::getType, 0, 3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | customerLis.add(customer); |
| | | } |
| | |
| | | } |
| | | return customerLis; |
| | | } |
| | | |
| | | //已审 |
| | | private List<TjCustomer> getYsResult(String config) { |
| | | List<TjOrder> orderList = null; |
| | | if("Y".equals(config)){ |
| | | orderList = orderService.getCsTjOrderList1(null,1,null,null,null); |
| | | }else { |
| | | orderList = orderService.getTjOrderList(null,1,null,null,null); |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(null, 1, null, null, null); |
| | | } else { |
| | | orderList = orderService.getTjOrderList(null, 1, null, null, null); |
| | | } |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | |
| | | } |
| | | return customerList; |
| | | } |
| | | |
| | | //未审 |
| | | private List<TjCustomer> getWsResult(String config) { |
| | | List<TjOrder> orderList = null; |
| | | if("Y".equals(config)){ |
| | | orderList = orderService.getCsTjOrderList1(null,0,null,null,null); |
| | | }else { |
| | | orderList = orderService.getTjOrderList(null,0,null,null,null); |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(null, 0, null, null, null); |
| | | } else { |
| | | orderList = orderService.getTjOrderList(null, 0, null, null, null); |
| | | } |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0) { |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | |
| | | } |
| | | return customerList; |
| | | } |
| | | |
| | | //总检点击体检信息详情 |
| | | private List<Map<String, Object>> getAjaxResult(String tjNumber) { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | final TjProject byId = projectService.selectTjProjectByProId(tjOrderDetail.getProId()); |
| | | if(null==byId){ |
| | | tjOrderDetailService.removeById(tjOrderDetail.getOrderDetailId()); |
| | | }else { |
| | | tjOrderDetail.setProject(byId); |
| | | if (null == byId) { |
| | | tjOrderDetailService.removeById(tjOrderDetail.getOrderDetailId()); |
| | | } else { |
| | | tjOrderDetail.setProject(byId); |
| | | } |
| | | List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId())); |
| | | if (list2.size() == 0) { |
| | |
| | | tjOrderDetail.setStandard(list2.get(0)); |
| | | } else { |
| | | final int ageType = StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday())); |
| | | TjStandard tjStandard1=tjStandardService.getListBySexAndType(customer.getCusSex(),ageType, String.valueOf(tjOrderDetail.getProId())); |
| | | TjStandard tjStandard1 = tjStandardService.getListBySexAndType(customer.getCusSex(), ageType, String.valueOf(tjOrderDetail.getProId())); |
| | | tjOrderDetail.setStandard(tjStandard1); |
| | | } |
| | | } |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | //已签收/未签收 |
| | | private List<Map<String, Object>> getYWqsResult(int a) { |
| | | LambdaQueryWrapper<TjSampling>wq=new LambdaQueryWrapper<>(); |
| | | List<Map<String,Object>> arrayList=new ArrayList<>(); |
| | | private List<Map<String, Object>> getYWqsResult(int a) { |
| | | LambdaQueryWrapper<TjSampling> wq = new LambdaQueryWrapper<>(); |
| | | List<Map<String, Object>> arrayList = new ArrayList<>(); |
| | | wq.orderByDesc(TjSampling::getApplicationTime); |
| | | wq.eq(TjSampling::getIsSignFor,a); |
| | | wq.eq(TjSampling::getIsSignFor, a); |
| | | List<TjSampling> list = tjSamplingService.list(wq); |
| | | if(null != list && list.size()>0 ){ |
| | | if (null != list && list.size() > 0) { |
| | | Map<String, List<TjSampling>> stringListMap = list.stream().collect(Collectors.groupingBy(TjSampling::getCusId)); |
| | | for (Map.Entry<String, List<TjSampling>> entry : stringListMap.entrySet()) { |
| | | Map<String,Object>map=new HashMap<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | TjCustomer customer = tjCustomerService.getById(entry.getKey()); |
| | | if (customer==null){ |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | |
| | | customer.setTjNumber(entry.getValue().get(0).getTjNum()); |
| | | customer.setApplicationTime(entry.getValue().get(0).getApplicationTime()); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if(null !=samplings && samplings.size()>0){ |
| | | List<TjSampling> projectList=new ArrayList<>(); |
| | | if (null != samplings && samplings.size() > 0) { |
| | | List<TjSampling> projectList = new ArrayList<>(); |
| | | for (TjSampling sampling : samplings) { |
| | | TjProject project = projectService.getById(sampling.getProId()); |
| | | if(null !=project && project.getProParentId()==0){ |
| | | if (null != project && project.getProParentId() == 0) { |
| | | projectList.add(sampling); |
| | | } |
| | | } |
| | | map.put("list",projectList); |
| | | map.put("list", projectList); |
| | | } |
| | | map.put("customer",customer); |
| | | map.put("customer", customer); |
| | | arrayList.add(map); |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | /** |
| | | * 隐藏手机号 |
| | | * |
| | | * @param phoneNum |
| | | * @return |
| | | */ |
| | | public static String hidePhoneNum(String phoneNum){ |
| | | if(null==phoneNum){ |
| | | public static String hidePhoneNum(String phoneNum) { |
| | | if (null == phoneNum) { |
| | | return ""; |
| | | } |
| | | if(phoneNum.contains("*")){ |
| | | if (phoneNum.contains("*")) { |
| | | return phoneNum; |
| | | } |
| | | Pattern pattern = Pattern.compile("((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}"); |
| | | Matcher matcher = pattern.matcher(phoneNum); |
| | | StringBuffer sb = new StringBuffer(); |
| | | try { |
| | | while(matcher.find()) { |
| | | while (matcher.find()) { |
| | | String phoneStr = matcher.group(); |
| | | phoneStr = phoneStr.substring(0, 3) + "****" + phoneStr.substring(7, phoneStr.length()); |
| | | matcher.appendReplacement(sb,phoneStr); |
| | | matcher.appendReplacement(sb, phoneStr); |
| | | } |
| | | matcher.appendTail(sb); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 隐藏身份证号码 |
| | | * |
| | | * @param idCardNum |
| | | * @return |
| | | */ |
| | | public static String hideIdCardNum(String idCardNum){ |
| | | if(null==idCardNum){ |
| | | public static String hideIdCardNum(String idCardNum) { |
| | | if (null == idCardNum) { |
| | | return ""; |
| | | } |
| | | if(idCardNum.contains("*")){ |
| | | if (idCardNum.contains("*")) { |
| | | return idCardNum; |
| | | } |
| | | Pattern pattern = Pattern.compile("(\\d{6})(19|20)(\\d{2})(1[0-2]|0[1-9])(0[1-9]|[1-2][0-9]|3[0-1])(\\d{3})(\\d|X|x)"); |
| | | Matcher matcher = pattern.matcher(idCardNum); |
| | | StringBuffer sb = new StringBuffer(); |
| | | try { |
| | | while(matcher.find()) { |
| | | while (matcher.find()) { |
| | | String idCardStr = matcher.group(); |
| | | int len=idCardStr.length(); |
| | | if(len>=9){ |
| | | idCardStr = idCardStr.replaceAll("(.{"+(len<12?3:6)+"})(.*)(.{4})", "$1" + "****" + "$3"); |
| | | int len = idCardStr.length(); |
| | | if (len >= 9) { |
| | | idCardStr = idCardStr.replaceAll("(.{" + (len < 12 ? 3 : 6) + "})(.*)(.{4})", "$1" + "****" + "$3"); |
| | | } |
| | | matcher.appendReplacement(sb,idCardStr); |
| | | matcher.appendReplacement(sb, idCardStr); |
| | | } |
| | | matcher.appendTail(sb); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 隐藏用户姓名 |
| | | * |
| | | * @param cusName |
| | | * @return |
| | | */ |
| | | public static String hideCusName(String cusName){ |
| | | if(null==cusName){ |
| | | public static String hideCusName(String cusName) { |
| | | if (null == cusName) { |
| | | return ""; |
| | | } |
| | | if(!cusName.contains("*")){ |
| | | String realname=null; |
| | | char[] r = cusName.toCharArray(); |
| | | if(r.length ==1){ |
| | | realname = cusName; |
| | | if (!cusName.contains("*")) { |
| | | String realname = null; |
| | | char[] r = cusName.toCharArray(); |
| | | if (r.length == 1) { |
| | | realname = cusName; |
| | | } |
| | | if(r.length == 2){ |
| | | realname = cusName.replaceFirst(cusName.substring(1),"*"); |
| | | if (r.length == 2) { |
| | | realname = cusName.replaceFirst(cusName.substring(1), "*"); |
| | | } |
| | | if (r.length > 2) { |
| | | realname = cusName.replaceFirst(cusName.substring(1,r.length-1) ,"*"); |
| | | realname = cusName.replaceFirst(cusName.substring(1, r.length - 1), "*"); |
| | | } |
| | | return realname; |
| | | } |
| | | return cusName; |
| | | } |
| | | |
| | | //临时表添加单项 |
| | | public void saveRedisTransitionByProId(String cusId, List<Long> proIds) { |
| | | for (Long proId : proIds) { |
| | |
| | | if (null != transitionList && transitionList.size() > 0) { |
| | | continue; |
| | | } |
| | | transitionService.saveRedisTransitionByProId(cusId,proId); |
| | | transitionService.saveRedisTransitionByProId(cusId, proId); |
| | | } |
| | | } |
| | | |
| | | //向缓存中添加 父项目的子项目详情 |
| | | private Map<String, Object> getOrderDetailByProParentId(String proParentId, String tjNumber) { |
| | | TjOrderRemark remark = orderRemarkService.getTjOrderRemarkByTjNumAndProParentId(tjNumber, proParentId); |
| | |
| | | List<TjAdvice> adviceList = new ArrayList<>(); |
| | | if (null != remark) { |
| | | String[] strings = StringUtils.split(remark.getSummary(), ";"); |
| | | if(null !=strings && strings.length>0){ |
| | | if (null != strings && strings.length > 0) { |
| | | List<TjAdvice> list = tjAdviceService.getAdviceStringByIds(strings); |
| | | adviceList.addAll(list); |
| | | } |