| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.crypto.symmetric.DES; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | if (tjCustomer.getCusIdcard()!=null){ |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | } |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { |
| | |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setGrMoBanId(reportService.getGrMoBanIds()); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | 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 != iDictCompService.getById(String.valueOf(order.getFirmId()))) { |
| | |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setGrMoBanId(reportService.getGrMoBanIds()); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | 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 != iDictCompService.getById(String.valueOf(order.getFirmId()))) { |
| | |
| | | |
| | | List<TjOrder> list = Optional.ofNullable(tjOrderService.list(wq)).get(); |
| | | if (list.size() > 0) { |
| | | List<TjOrder> list1 = new ArrayList<>(); |
| | | for (TjOrder order : list) { |
| | | TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setGrMoBanId(reportService.getGrMoBanIds()); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | asyncService.getPrintOrderList(list); |
| | | if(redisCache.hasKey("getPrintOrderList")){ |
| | | if(null !=type && type==0){ |
| | | List<TjOrder> list1 = redisCache.getCacheMapValue("getPrintOrderList", "0"); |
| | | collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { |
| | | order.setDictCompName(iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId())).getCnName()); |
| | | if(null !=type && type==1){ |
| | | List<TjOrder> list1 = redisCache.getCacheMapValue("getPrintOrderList","1"); |
| | | collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | if (null != order.getPacId()) { |
| | | if (null != tjPackageService.getById(order.getPacId())) { |
| | | order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(order.getPacId())) { |
| | | order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); |
| | | } |
| | | } |
| | | //从打印记录查出最新打印时间 |
| | | TjPrintOrder one = printOrderService.getTjPrintOrderByTjNum(order.getTjNumber()); |
| | | if (null != type && type == 1 && one != null) { |
| | | order.setPrintTime(one.getCreateTime()); |
| | | order.setPrintName(one.getCreateBy()); |
| | | order.setType(1); |
| | | list1.add(order); |
| | | } |
| | | if (null != type && type == 0 && one == null) { |
| | | order.setType(0); |
| | | list1.add(order); |
| | | } |
| | | }else { |
| | | List<TjOrder> list1 = new ArrayList<>(); |
| | | extracted(type, list, list1); |
| | | collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | if (null != collect) { |
| | | map.put("total", collect.size()); |
| | |
| | | } |
| | | map.put("list", collect); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | private void extracted(Integer type, List<TjOrder> list, List<TjOrder> list1) { |
| | | for (TjOrder order : list) { |
| | | TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | 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())); |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { |
| | | order.setDictCompName(iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId())).getCnName()); |
| | | } |
| | | if (null != order.getPacId()) { |
| | | if (null != tjPackageService.getById(order.getPacId())) { |
| | | order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(order.getPacId())) { |
| | | order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); |
| | | } |
| | | } |
| | | //从打印记录查出最新打印时间 |
| | | TjPrintOrder one = printOrderService.getTjPrintOrderByTjNum(order.getTjNumber()); |
| | | if (null != type && type == 1 && one != null) { |
| | | order.setPrintTime(one.getCreateTime()); |
| | | order.setPrintName(one.getCreateBy()); |
| | | order.setType(1); |
| | | list1.add(order); |
| | | } |
| | | if (null != type && type == 0 && one == null) { |
| | | order.setType(0); |
| | | list1.add(order); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | tjFlowingWater.setOrderId(tjOrder.getOrderId()); |
| | | Date date1 = new Date(System.currentTimeMillis()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmssSSS"); |
| | | String userId1 = SecurityUtils.getUsername(); |
| | | String s1 = userId1 + sdf.format(date1); |
| | | tjFlowingWater.setWaterId(s1); |
| | | String s1 = SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmssSSS").format(date1); |
| | | tjFlowingWater.setWaterId(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),"")+s1); |
| | | if (null != mallOrder) { |
| | | if (mallOrder.getOrderStatus().equals(201L)) { |
| | | tjFlowingWater.setCopeWith(mallOrder.getActualPrice()); |