| | |
| | | } |
| | | List<TjOrder> collect = null; |
| | | if (list.size() > 0) { |
| | | for (TjOrder order : list) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(list.get(i).getUserId()); |
| | | if (null == tjCustomer) { |
| | | list.remove(list.get(i)); |
| | | continue; |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { |
| | | order.setDictCompName(iDictCompService.getById(String.valueOf(order.getFirmId())).getCnName()); |
| | | list.get(i).setTjCustomerSex(tjCustomer.getCusSex()); |
| | | list.get(i).setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | list.get(i).setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | list.get(i).setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | list.get(i).setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | |
| | | String firmId = list.get(i).getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(list.get(i).getFirmId()))) { |
| | | list.get(i).setDictCompName(iDictCompService.getById(String.valueOf(list.get(i).getFirmId())).getCnName()); |
| | | } |
| | | if (null != order.getPacId()) { |
| | | if (null != tjPackageService.getById(order.getPacId())) { |
| | | order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); |
| | | if (null != list.get(i).getPacId()) { |
| | | if (null != tjPackageService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(tjPackageService.getById(list.get(i).getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(order.getPacId())) { |
| | | order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); |
| | | if (null != dwDeptService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(dwDeptService.getById(list.get(i).getPacId()).getDwDeptName()); |
| | | } |
| | | } |
| | | //从打印记录查出最新打印时间 |
| | | LambdaQueryWrapper<TjReportPrint> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjReportPrint::getTjNumber, order.getTjNumber()); |
| | | wqqq.eq(TjReportPrint::getTjNumber, list.get(i).getTjNumber()); |
| | | wqqq.orderByDesc(TjReportPrint::getPrintTime); |
| | | wqqq.last("limit 1"); |
| | | TjReportPrint one = tjReportPrintService.getOne(wqqq); |
| | | if (one != null) { |
| | | order.setPrintLastTime(one.getPrintTime()); |
| | | list.get(i).setPrintLastTime(one.getPrintTime()); |
| | | } |
| | | |
| | | } |
| | |
| | | Page<TjOrder> page2 = tjOrderService.page(page1, wq); |
| | | List<TjOrder> list = page2.getRecords(); |
| | | if (list != null) { |
| | | for (TjOrder order : list) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if (tjCustomer.getCusIdcard() != null) { |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | } |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(list.get(i).getUserId()); |
| | | if (null == tjCustomer) { |
| | | list.remove(list.get(i)); |
| | | continue; |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { |
| | | order.setDictCompName(iDictCompService.getById(String.valueOf(order.getFirmId())).getCnName()); |
| | | list.get(i).setTjCustomerSex(tjCustomer.getCusSex()); |
| | | list.get(i).setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | list.get(i).setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | list.get(i).setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if (tjCustomer.getCusIdcard() != null) { |
| | | list.get(i).setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | } |
| | | if (null != order.getPacId()) { |
| | | if (null != tjPackageService.getById(order.getPacId())) { |
| | | order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); |
| | | |
| | | String firmId = list.get(i).getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(list.get(i).getFirmId()))) { |
| | | list.get(i).setDictCompName(iDictCompService.getById(String.valueOf(list.get(i).getFirmId())).getCnName()); |
| | | } |
| | | if (null != list.get(i).getPacId()) { |
| | | if (null != tjPackageService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(tjPackageService.getById(list.get(i).getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(order.getPacId())) { |
| | | order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); |
| | | if (null != dwDeptService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(dwDeptService.getById(list.get(i).getPacId()).getDwDeptName()); |
| | | } |
| | | } |
| | | //从打印记录查出最新打印时间 |
| | | LambdaQueryWrapper<TjReportPrint> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjReportPrint::getTjNumber, order.getTjNumber()); |
| | | wqqq.eq(TjReportPrint::getTjNumber, list.get(i).getTjNumber()); |
| | | wqqq.orderByDesc(TjReportPrint::getPrintTime); |
| | | wqqq.last("limit 1"); |
| | | TjReportPrint one = tjReportPrintService.getOne(wqqq); |
| | | if (one != null) { |
| | | order.setPrintLastTime(one.getPrintTime()); |
| | | list.get(i).setPrintLastTime(one.getPrintTime()); |
| | | } |
| | | } |
| | | } |
| | |
| | | wqq.eq(TjOrder::getUserId, tjOrder.getUserId()); |
| | | wqq.eq(TjOrder::getCheckStatus, 0); |
| | | wqq.isNull(TjOrder::getFinishTime); |
| | | if(!tjCustomer.getCardId().equals("0")){ |
| | | wqq.eq(TjOrder::getCardId,tjCustomer.getCardId()); |
| | | if (!tjCustomer.getCardId().equals("0")) { |
| | | wqq.eq(TjOrder::getCardId, tjCustomer.getCardId()); |
| | | } |
| | | TjOrder order = tjOrderService.getOne(wqq); |
| | | if (null != order) { |
| | | transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(),tjCustomer.getCardId()); |
| | | transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjCustomer.getCardId()); |
| | | return AjaxResult.error("不可重复登记"); |
| | | } |
| | | LambdaQueryWrapper<TjReservation> wq1 = new LambdaQueryWrapper<>(); |
| | |
| | | if (null != tjReservation.getJobNo()) tjOrder.setFirmWorkId(tjReservation.getJobNo()); |
| | | if (null != tjReservation.getPacId()) tjOrder.setPacId(tjReservation.getPacId()); |
| | | if (null != tjReservation.getTjCategory()) tjOrder.setTjCategory(tjReservation.getTjCategory()); |
| | | if (null != tjReservation.getGroupingId()){ |
| | | if (null != tjReservation.getGroupingId()) { |
| | | tjOrder.setGroupId(tjReservation.getGroupingId()); |
| | | tjOrder.setFirmDeptId(tjReservation.getPacId()); |
| | | } |
| | |
| | | tjOrder.setCardId(tjCustomer.getCardId()); |
| | | if (tjOrderService.save(tjOrder)) { |
| | | //保存收货地址 |
| | | if ("2".equals(tjOrder.getGetType())){ |
| | | if ("2".equals(tjOrder.getGetType())) { |
| | | final TjReportGetAddress address = tjOrder.getAddAddress(); |
| | | if (address!=null){ |
| | | if (address != null) { |
| | | address.setTjNumber(tjNumber); |
| | | tjReportGetAddressService.save(address); |
| | | } |
| | |
| | | //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 |
| | | final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | | final String isPay = configService.selectConfigByKey("isPay"); |
| | | if ("Y".equals(getInfoFromSqlData)){ |
| | | if ("Y".equals(getInfoFromSqlData)) { |
| | | LtkjMiddleHead middleHead = headService.getMiddleHeadByPartId(tjCustomer.getCardId()); |
| | | if(null !=middleHead){ |
| | | if (null != middleHead) { |
| | | tjFlowingWater.setPayStasus(1L); |
| | | } |
| | | } |
| | |
| | | Date date1 = new Date(System.currentTimeMillis()); |
| | | String s1 = SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmssSSS").format(date1); |
| | | tjFlowingWater.setWaterId(PinyinUtil.getFirstLetter(tjCustomer.getCusName(), "").toUpperCase() + s1); |
| | | if(isPay.equals("true")){ |
| | | if (isPay.equals("true")) { |
| | | if (null != mallOrder) { |
| | | if (mallOrder.getOrderStatus().equals(201L)) { |
| | | tjFlowingWater.setCopeWith(mallOrder.getActualPrice()); |
| | |
| | | proIds = JSON.parseArray(proIds1.toString(), Long.class); |
| | | } |
| | | TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusId); |
| | | String cardId ="0"; |
| | | if(null !=tjCustomer){ |
| | | cardId = tjCustomer.getCardId(); |
| | | String cardId = "0"; |
| | | if (null != tjCustomer) { |
| | | cardId = tjCustomer.getCardId(); |
| | | } |
| | | if ((null == proIds || proIds.size() == 0) && (null == packId || packId.equals(""))) { |
| | | transitionService.deletedTbTransitionByCusId(cusId); |
| | | if (redisCache.hasKey(cusId)) redisCache.deleteObject(cusId); |
| | | if (redisCache.hasKey(cardId+cusId + "cusId")) redisCache.deleteCacheMapValue(cardId+cusId + "cusId", cardId+cusId); |
| | | |
| | | if (redisCache.hasKey(cardId + cusId)) { |
| | | redisCache.deleteObject(cardId + cusId); |
| | | } |
| | | if (redisCache.hasKey(cardId + cusId + "cusId")) { |
| | | redisCache.deleteCacheMapValue(cardId + cusId + "cusId", cardId + cusId); |
| | | } |
| | | } |
| | | List<TbTransition> tbTransitionList = null; |
| | | if (!redisCache.hasKey(cardId+cusId)) { |
| | | if (!redisCache.hasKey(cardId + cusId)) { |
| | | tbTransitionList = new ArrayList<>(); |
| | | } else { |
| | | tbTransitionList = redisCache.getCacheList(cardId+cusId); |
| | | tbTransitionList = redisCache.getCacheList(cardId + cusId); |
| | | } |
| | | //套餐 |
| | | if (null != packId && !packId.equals("")) { |
| | | Long pacId = Long.valueOf(packId.toString()); |
| | | List<TbTransition> list = transitionService.getTbTransitionListByCusIdAndPac(cusId, String.valueOf(pacId)); |
| | | if (null == list || list.size() == 0) { |
| | | transitionService.deletedTbTransitionListByCusIdAndPac(cusId,cardId); |
| | | if (redisCache.hasKey(cardId+cusId + "cusId")) redisCache.deleteCacheMapValue(cardId+cusId + "cusId", cardId+cusId); |
| | | if (redisCache.hasKey(cardId+cusId)) { |
| | | transitionService.deletedTbTransitionListByCusIdAndPac(cusId, cardId); |
| | | if (redisCache.hasKey(cardId + cusId + "cusId")) |
| | | redisCache.deleteCacheMapValue(cardId + cusId + "cusId", cardId + cusId); |
| | | if (redisCache.hasKey(cardId + cusId)) { |
| | | tbTransitionList = new ArrayList<>(); |
| | | redisCache.deleteObject(cardId+cusId); |
| | | redisCache.deleteObject(cardId + cusId); |
| | | } |
| | | List<TjPackageProject> ppList = tjPackageProjectService.getTjPackageProjectListByPacId(String.valueOf(pacId)); |
| | | if (null != ppList && ppList.size() > 0) { |
| | |
| | | tbTransition.setParentProId(tjProject.getProParentId()); |
| | | if (tjProject.getProParentId() != null) { |
| | | TjProject byId = projectService.getById(tjProject.getProParentId()); |
| | | if(null !=byId){ |
| | | if (null != byId) { |
| | | tbTransition.setParentProName(byId.getProName()); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | if (redisCache.hasKey(cardId+cusId)) { |
| | | redisCache.deleteObject(cardId+cusId); |
| | | redisCache.setCacheList(cardId+cusId, tbTransitionList); |
| | | redisCache.setCacheMapValue(cardId+cusId + "cusId", cardId+cusId, getMaps(cusId,cardId)); |
| | | if (redisCache.hasKey(cardId + cusId)) { |
| | | redisCache.deleteObject(cardId + cusId); |
| | | redisCache.setCacheList(cardId + cusId, tbTransitionList); |
| | | redisCache.setCacheMapValue(cardId + cusId + "cusId", cardId + cusId, getMaps(cusId, cardId)); |
| | | } else { |
| | | redisCache.setCacheList(cardId+cusId, tbTransitionList); |
| | | redisCache.setCacheMapValue(cardId+cusId + "cusId", cardId+cusId, getMaps(cusId,cardId)); |
| | | redisCache.setCacheList(cardId + cusId, tbTransitionList); |
| | | redisCache.setCacheMapValue(cardId + cusId + "cusId", cardId + cusId, getMaps(cusId, cardId)); |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | |
| | | return AjaxResult.success(list); |
| | | } |
| | | TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusId); |
| | | String cardId ="0"; |
| | | if(null !=tjCustomer){ |
| | | String cardId = "0"; |
| | | if (null != tjCustomer) { |
| | | cardId = tjCustomer.getCardId(); |
| | | } |
| | | List<Map<String, Object>> list = getMaps(cusId,cardId); |
| | | List<Map<String, Object>> list = getMaps(cusId, cardId); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | |
| | | for (TjOrderRemark remark : remarkList) { |
| | | TjProject project = projectService.getTjProjectById(String.valueOf(remark.getProId())); |
| | | if (null != project) { |
| | | if ("N".equals(project.getNeedReport())){ |
| | | if ("N".equals(project.getNeedReport())) { |
| | | continue; |
| | | } |
| | | remark.setProCheckType(project.getProCheckType()); |
| | |
| | | } |
| | | |
| | | |
| | | private List<Map<String, Object>> getMaps(String cusId,String cardId) { |
| | | private List<Map<String, Object>> getMaps(String cusId, String cardId) { |
| | | |
| | | List<TbTransition> transitionList = null; |
| | | if (redisCache.hasKey(cardId+cusId)) { |
| | | transitionList = redisCache.getCacheList(cardId+cusId); |
| | | if (redisCache.hasKey(cardId + cusId)) { |
| | | transitionList = redisCache.getCacheList(cardId + cusId); |
| | | } else { |
| | | transitionList = transitionService.getTbTransitionListByCusId(cusId,cardId); |
| | | transitionList = transitionService.getTbTransitionListByCusId(cusId, cardId); |
| | | } |
| | | if (null == transitionList) return null; |
| | | Map<Long, List<TbTransition>> collect = transitionList.stream().collect(Collectors.groupingBy(TbTransition::getParentProId)); |
| | |
| | | if (null != pacId) { |
| | | TjPackage aPackage = tjPackageService.getById(entry.getValue().get(0).getPacId()); |
| | | map.put("pacName", aPackage.getPacName()); |
| | | TjProject tjProject = projectService.getById(entry.getKey()); |
| | | TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId) |
| | | .eq(TjPackageProject::getProId, entry.getKey())); |
| | | map.put("ordPrice", tjProject.getProPrice()); |
| | | if (null != project) { |
| | | map.put("nowPrice", project.getPriceNow()); |
| | | } else { |
| | | map.put("nowPrice", tjProject.getProPrice()); |
| | | } |
| | | } else { |
| | | map.put("pacName", "单项"); |
| | | List<TbTransition> tbTransitionList = entry.getValue(); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | BigDecimal money1 = new BigDecimal("0.00"); |
| | | BigDecimal money2 = new BigDecimal("0.00"); |
| | | for (TbTransition tbTransition : tbTransitionList) { |
| | | money1 = money1.add(tbTransition.getOrdPrice()); |
| | | money2 = money2.add(tbTransition.getNowPrice()); |
| | | } |
| | | map.put("ordPrice", money1); |
| | | map.put("nowPrice", money2); |
| | | } |
| | | } |
| | | map.put("parentName", projectService.getById(entry.getKey()).getProName()); |
| | | map.put("list", entry.getValue()); |
| | | List<TbTransition> tbTransitionList = entry.getValue(); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | BigDecimal money1 = new BigDecimal("0.00"); |
| | | BigDecimal money2 = new BigDecimal("0.00"); |
| | | for (TbTransition tbTransition : tbTransitionList) { |
| | | money1 = money1.add(tbTransition.getOrdPrice()); |
| | | money2 = money2.add(tbTransition.getNowPrice()); |
| | | // if (tbTransition.getOrdPrice().compareTo(BigDecimal.valueOf(0)) == 0 || tbTransition.getNowPrice().compareTo(BigDecimal.valueOf(0)) == 0) { |
| | | // tbTransition.setDiscount("0"); |
| | | // } else { |
| | | // tbTransition.setDiscount((tbTransition.getNowPrice()).divide(tbTransition.getOrdPrice(), BigDecimal.ROUND_CEILING).toString()); |
| | | // } |
| | | // if (null != tbTransition.getPacId()) { |
| | | // tbTransition.setPacPrice(tjPackageService.getById(tbTransition.getPacId()).getPrice()); |
| | | // } |
| | | // if (null != tbTransition.getParentProId()) { |
| | | // tbTransition.setPacPrice(projectService.getTjProjectById(String.valueOf(tbTransition.getParentProId())).getProPrice()); |
| | | // } |
| | | } |
| | | // map.put("ordPrice", money1.setScale(Integer.parseInt(configService.selectConfigByKey("sys.price.save")), Integer.parseInt(configService.selectConfigByKey("sys.price")))); |
| | | // map.put("nowPrice", money2.setScale(Integer.parseInt(configService.selectConfigByKey("sys.price.save")), Integer.parseInt(configService.selectConfigByKey("sys.price")))); |
| | | map.put("ordPrice", money1); |
| | | map.put("nowPrice", money2); |
| | | } |
| | | |
| | | |
| | | list.add(map); |
| | | } |
| | | return list; |
| | |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.saveTjPureToneTesByCusId(tjCustomer.getCusIdcard(),tjOrder.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.saveTjPureToneTesByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | //修改每项的原价现价 //修改临时表体检号 |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), discount,tjOrder.getTjNumber()); |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), discount, tjOrder.getTjNumber()); |
| | | //添加remark表数据 |
| | | remarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | //判断是否交钱 |
| | |
| | | byId.setHeshouDoctor(UserHoder.getLoginUser().getUserId()); |
| | | byId.setHeshouTime(new DateTime()); |
| | | final boolean b = tjOrderService.updateById(byId); |
| | | if (!b){ |
| | | if (!b) { |
| | | return AjaxResult.error("核收失败"); |
| | | } |
| | | } |
| | |
| | | @Transactional |
| | | public AjaxResult getHistryTjOrderByCusIdCard(@RequestParam String cusIdCard) { |
| | | TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard); |
| | | List<HistoryTjOrder> list=new ArrayList<>(); |
| | | if(null !=tjCustomer){ |
| | | List<HistoryTjOrder> list = new ArrayList<>(); |
| | | if (null != tjCustomer) { |
| | | List<TjOrder> orderList = tjOrderService.getTjOrderListByCusId(tjCustomer.getCusId()); |
| | | for (TjOrder order : orderList) { |
| | | HistoryTjOrder historyTjOrder=new HistoryTjOrder(); |
| | | HistoryTjOrder historyTjOrder = new HistoryTjOrder(); |
| | | historyTjOrder.setUserName(tjCustomer.getCusName()); |
| | | historyTjOrder.setTjNum(order.getTjNumber()); |
| | | historyTjOrder.setTjTime(order.getCreateTime()); |
| | |
| | | @Transactional |
| | | public AjaxResult getHistryTjOrderProByCusIdCard(@RequestParam String cusIdCard) { |
| | | TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard); |
| | | if(null !=tjCustomer){ |
| | | TjOrder order= tjOrderService.getLastTjOrderListByCusId(tjCustomer.getCusId()); |
| | | if(null !=order){ |
| | | if (null != tjCustomer) { |
| | | TjOrder order = tjOrderService.getLastTjOrderListByCusId(tjCustomer.getCusId()); |
| | | if (null != order) { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | if(order.getPacId().equals("o")){ |
| | | if (order.getPacId().equals("o")) { |
| | | List<Long> longList = remarkService.getTjProIdsByTjNum(order.getTjNumber()); |
| | | for (Long aLong : longList) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("pacName", "单项"); |
| | | map.put("proId",aLong); |
| | | map.put("pacId",null); |
| | | map.put("proId", aLong); |
| | | map.put("pacId", null); |
| | | map.put("parentName", projectService.getById(aLong).getProName()); |
| | | map.put("list",projectService.getTjProjectListBySoneId(String.valueOf(aLong))); |
| | | map.put("list", projectService.getTjProjectListBySoneId(String.valueOf(aLong))); |
| | | BigDecimal proPrice = projectService.getById(aLong).getProPrice(); |
| | | map.put("ordPrice", proPrice); |
| | | map.put("nowPrice", proPrice); |
| | | list.add(map); |
| | | } |
| | | } |
| | | if(!order.getPacId().equals("o")){ |
| | | List<Long> longList = remarkService.getTjProIdsByTjNumAndPacIc(order.getTjNumber(),order.getPacId()); |
| | | if (!order.getPacId().equals("o")) { |
| | | List<Long> longList = remarkService.getTjProIdsByTjNumAndPacIc(order.getTjNumber(), order.getPacId()); |
| | | TjPackage aPackage = tjPackageService.getById(order.getPacId()); |
| | | for (Long aLong : longList) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("pacName",aPackage.getPacName()); |
| | | map.put("pacId",String.valueOf(aPackage.getPacId())); |
| | | map.put("pacName", aPackage.getPacName()); |
| | | map.put("pacId", String.valueOf(aPackage.getPacId())); |
| | | map.put("parentName", projectService.getById(aLong).getProName()); |
| | | map.put("list",projectService.getTjProjectListBySoneId(String.valueOf(aLong))); |
| | | map.put("list", projectService.getTjProjectListBySoneId(String.valueOf(aLong))); |
| | | BigDecimal proPrice = projectService.getById(aLong).getProPrice(); |
| | | map.put("ordPrice", proPrice); |
| | | map.put("nowPrice",tjPackageProjectService.getPacProPriceByPacIdAndPro(aLong,order.getPacId())); |
| | | map.put("nowPrice", tjPackageProjectService.getPacProPriceByPacIdAndPro(aLong, order.getPacId())); |
| | | list.add(map); |
| | | } |
| | | |
| | | List<Long> longList1 = remarkService.getTjProIdsByTjNumAndPacIc(order.getTjNumber(),order.getPacId()); |
| | | List<Long> longList1 = remarkService.getTjProIdsByTjNumAndPacIc(order.getTjNumber(), order.getPacId()); |
| | | for (Long aLong : longList1) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("pacName", "单项"); |
| | | map.put("proId",aLong); |
| | | map.put("pacId",null); |
| | | map.put("proId", aLong); |
| | | map.put("pacId", null); |
| | | map.put("parentName", projectService.getById(aLong).getProName()); |
| | | map.put("list",projectService.getTjProjectListBySoneId(String.valueOf(aLong))); |
| | | map.put("list", projectService.getTjProjectListBySoneId(String.valueOf(aLong))); |
| | | BigDecimal proPrice = projectService.getById(aLong).getProPrice(); |
| | | map.put("ordPrice", proPrice); |
| | | map.put("nowPrice", proPrice); |