| | |
| | | private TestMapper testMapper; |
| | | @Resource |
| | | private TjvLtkjvtjpatService tjvLtkjvtjpatService; |
| | | |
| | | @Resource |
| | | private LtkjMiddleDetailService middleDetailService; |
| | | |
| | | @Resource |
| | | private LtkjMiddleHeadService headService; |
| | | @Resource |
| | |
| | | @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime, |
| | | @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime) { |
| | | |
| | | DateTime beginTimes = null; |
| | | DateTime endTimes = null; |
| | | if (null != beginTime && null != endTime) { |
| | | beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime)); |
| | | endTimes = DateUtil.endOfDay(DateUtil.parse(endTime)); |
| | | } |
| | | //初始化体检订单表 |
| | | List<TjOrder> orderList = null; |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | if (checkStatus == 0) |
| | | asyncService.wCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes)); |
| | | if (checkStatus == 1) |
| | | asyncService.yCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes)); |
| | | |
| | | //根据姓名查询 |
| | | if (null != name && !"".equals(name)) { |
| | | List<TjCustomer> list = customerService.getTjCustomerList(name); |
| | | if (null != list && list.size() > 0) { |
| | | List<TjCustomer> lists = new ArrayList<>(); |
| | | for (TjCustomer customer : list) { |
| | | orderList = orderService.getCsTjOrderListByCusId(customer.getCusId()); |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | if (tjOrder.getFirmId().equals("0")) { |
| | | customer.setTjCompName(null); |
| | | } else { |
| | | customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName()); |
| | | } |
| | | lists.add(customer); |
| | | } |
| | | } |
| | | } |
| | | List<TjCustomer> customers = null; |
| | | if (lists.size() > 0) { |
| | | customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | map.put("customers", customers); |
| | | map.put("total", lists.size()); |
| | | return AjaxResult.success(map); |
| | | } |
| | | return AjaxResult.success("暂无数据"); |
| | | } |
| | | |
| | | //条件查询 |
| | | if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | return getResult(page, pageSize, orderList, customerList, map); |
| | | } |
| | | |
| | | List<TjCustomer> customers = null; |
| | | if (checkStatus == 0) { |
| | | customers = redisCache.getCacheMapValue("cScheck", "ws"); |
| | | } |
| | | if (checkStatus == 1) { |
| | | customers = redisCache.getCacheMapValue("cScheck", "ys"); |
| | | } |
| | | if (customers != null && customers.size() > 0) { |
| | | List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | map.put("customers", customerLists); |
| | | map.put("total", customers.size()); |
| | | return AjaxResult.success(map); |
| | | } else { |
| | | orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | return getResult(page, pageSize, orderList, customerList, map); |
| | | } |
| | | // DateTime beginTimes = null; |
| | | // DateTime endTimes = null; |
| | | // if (null != beginTime && null != endTime) { |
| | | // beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime)); |
| | | // endTimes = DateUtil.endOfDay(DateUtil.parse(endTime)); |
| | | // } |
| | | // //初始化体检订单表 |
| | | // List<TjOrder> orderList = null; |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // |
| | | // if (checkStatus == 0) |
| | | // asyncService.wCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes)); |
| | | // if (checkStatus == 1) |
| | | // asyncService.yCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes)); |
| | | // |
| | | // //根据姓名查询 |
| | | // if (null != name && !"".equals(name)) { |
| | | // List<TjCustomer> list = customerService.getTjCustomerList(name); |
| | | // if (null != list && list.size() > 0) { |
| | | // List<TjCustomer> lists = new ArrayList<>(); |
| | | // for (TjCustomer customer : list) { |
| | | // orderList = orderService.getCsTjOrderListByCusId(customer.getCusId()); |
| | | // if (null != orderList && orderList.size() > 0) { |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getCreateTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // if (tjOrder.getFirmId().equals("0")) { |
| | | // customer.setTjCompName(null); |
| | | // } else { |
| | | // customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName()); |
| | | // } |
| | | // lists.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // List<TjCustomer> customers = null; |
| | | // if (lists.size() > 0) { |
| | | // customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // } |
| | | // map.put("customers", customers); |
| | | // map.put("total", lists.size()); |
| | | // return AjaxResult.success(map); |
| | | // } |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // |
| | | // //条件查询 |
| | | // if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | // orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | // |
| | | // List<TjCustomer> customers = null; |
| | | // if (checkStatus == 0) { |
| | | // customers = redisCache.getCacheMapValue("cScheck", "ws"); |
| | | // } |
| | | // if (checkStatus == 1) { |
| | | // customers = redisCache.getCacheMapValue("cScheck", "ys"); |
| | | // } |
| | | // if (customers != null && customers.size() > 0) { |
| | | // List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // map.put("customers", customerLists); |
| | | // map.put("total", customers.size()); |
| | | // return AjaxResult.success(map); |
| | | // } else { |
| | | // orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | String value = String.valueOf(compId); |
| | | if(tjNumber==null)tjNumber=""; |
| | | if(compId==null)value=""; |
| | | if(name==null)name=""; |
| | | if(beginTime==null)beginTime=""; |
| | | if(endTime==null)endTime=""; |
| | | return AjaxResult.success(orderService.getCsCunChuGuoChengCustomerList(tjNumber,page,pageSize,checkStatus, value,beginTime,endTime,name)); |
| | | } |
| | | |
| | | |
| | |
| | | @GetMapping("/dataSynchronization") |
| | | @ApiOperation(value = "同步sql server数据到本地数据库数据接口") |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber) { |
| | | List<LtkjHysqd> one = testMapper.getHysqdByTmh(tjNumber); |
| | | if (one!=null){ |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjHysqdService.saveBatch(one); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | for (LtkjHysqd ltkjHysqd : one) { |
| | | List<LtkjHybgd> one1 = testMapper.getHybgdByTmh(ltkjHysqd.getTmh()); |
| | | if (one1!=null){ |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjHybgdService.saveBatch(one1); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 |
| | | final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | | if ("Y".equals(getInfoFromSqlData)) { |
| | | List<LtkjHysqd> one = testMapper.getHysqdByTmh(tjNumber); |
| | | if (one != null) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjHysqdService.saveBatch(one); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | for (LtkjHysqd ltkjHysqd : one) { |
| | | List<LtkjHybgd> one1 = testMapper.getHybgdByTmh(ltkjHysqd.getTmh()); |
| | | if (one1 != null) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjHybgdService.saveBatch(one1); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<LtkjExamJcsqd> one2 = testMapper.getExamJcsqdTmh(tjNumber); |
| | | if (one2 != null) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjExamJcsqdService.saveBatch(one2); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | for (LtkjExamJcsqd ltkjExamJcsqd : one2) { |
| | | List<LtkjExamJcbgd> one3 = testMapper.getExamJcbgdByTjh(ltkjExamJcsqd.getTmh()); |
| | | if (one3 != null) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjExamJcbgdService.saveBatch(one3); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<LtkjExamJcsqd> one2 = testMapper.getExamJcsqdTmh(tjNumber); |
| | | if (one2!=null){ |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjExamJcsqdService.saveBatch(one2); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | for (LtkjExamJcsqd ltkjExamJcsqd : one2) { |
| | | List<LtkjExamJcbgd> one3 = testMapper.getExamJcbgdByTjh(ltkjExamJcsqd.getTmh()); |
| | | if (one3!=null){ |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjExamJcbgdService.saveBatch(one3); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return AjaxResult.success("同步成功"); |
| | | } |
| | | |
| | |
| | | @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime, |
| | | @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime) { |
| | | |
| | | String config = configService.selectConfigByKey("tj_confirm"); |
| | | DateTime beginTimes = null; |
| | | DateTime endTimes = null; |
| | | if (null != beginTime && null != endTime) { |
| | | beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime)); |
| | | endTimes = DateUtil.endOfDay(DateUtil.parse(endTime)); |
| | | } |
| | | asyncService.checkSetCustomerLisByRedis(config); |
| | | //初始化体检订单表 |
| | | List<TjOrder> orderList = null; |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | //姓名查询 |
| | | if (null != name && !"".equals(name)) { |
| | | List<TjCustomer> list = customerService.getTjCustomerList(name); |
| | | if (null != list && list.size() > 0) { |
| | | List<TjCustomer> lists = new ArrayList<>(); |
| | | for (TjCustomer customer : list) { |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderListByCusId1(customer.getCusId()); |
| | | } else { |
| | | orderList = orderService.getTjOrderListByCusId(customer.getCusId()); |
| | | } |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getFinishTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | customer.setTjCategory(tjOrder.getTjCategory()); |
| | | if (tjOrder.getFirmId().equals("0")) { |
| | | customer.setTjCompName(null); |
| | | } else { |
| | | customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName()); |
| | | } |
| | | lists.add(customer); |
| | | } |
| | | } |
| | | } |
| | | List<TjCustomer> customers = null; |
| | | if (lists.size() > 0) { |
| | | customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | map.put("customers", customers); |
| | | map.put("total", lists.size()); |
| | | return AjaxResult.success(map); |
| | | } |
| | | return AjaxResult.success("暂无数据"); |
| | | } |
| | | |
| | | //条件查询 |
| | | if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | //判断是否开启初审 |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | } else { |
| | | orderList = orderService.getTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | } |
| | | return getResult(page, pageSize, orderList, customerList, map); |
| | | } |
| | | |
| | | List<TjCustomer> customers = null; |
| | | if (null != checkStatus && checkStatus == 0) { |
| | | customers = redisCache.getCacheMapValue("check", "ws"); |
| | | } |
| | | if (null != checkStatus && checkStatus == 1) { |
| | | customers = redisCache.getCacheMapValue("check", "ys"); |
| | | } |
| | | if (customers != null && customers.size() > 0) { |
| | | // asyncService.addRedis(customers); |
| | | List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | map.put("customers", customerLists); |
| | | map.put("total", customers.size()); |
| | | return AjaxResult.success(map); |
| | | } else { |
| | | //判断是否开启初审 |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | } else { |
| | | orderList = orderService.getTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | } |
| | | return getResult(page, pageSize, orderList, customerList, map); |
| | | } |
| | | // String config = configService.selectConfigByKey("tj_confirm"); |
| | | // DateTime beginTimes = null; |
| | | // DateTime endTimes = null; |
| | | // if (null != beginTime && null != endTime) { |
| | | // beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime)); |
| | | // endTimes = DateUtil.endOfDay(DateUtil.parse(endTime)); |
| | | // } |
| | | // asyncService.checkSetCustomerLisByRedis(config); |
| | | // //初始化体检订单表 |
| | | // List<TjOrder> orderList = null; |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // |
| | | // //姓名查询 |
| | | // if (null != name && !"".equals(name)) { |
| | | // List<TjCustomer> list = customerService.getTjCustomerList(name); |
| | | // if (null != list && list.size() > 0) { |
| | | // List<TjCustomer> lists = new ArrayList<>(); |
| | | // for (TjCustomer customer : list) { |
| | | // if ("Y".equals(config)) { |
| | | // orderList = orderService.getCsTjOrderListByCusId1(customer.getCusId()); |
| | | // } else { |
| | | // orderList = orderService.getTjOrderListByCusId(customer.getCusId()); |
| | | // } |
| | | // if (null != orderList && orderList.size() > 0) { |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getFinishTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // customer.setTjCategory(tjOrder.getTjCategory()); |
| | | // if (tjOrder.getFirmId().equals("0")) { |
| | | // customer.setTjCompName(null); |
| | | // } else { |
| | | // customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName()); |
| | | // } |
| | | // lists.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // List<TjCustomer> customers = null; |
| | | // if (lists.size() > 0) { |
| | | // customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // } |
| | | // map.put("customers", customers); |
| | | // map.put("total", lists.size()); |
| | | // return AjaxResult.success(map); |
| | | // } |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // |
| | | // //条件查询 |
| | | // if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | // //判断是否开启初审 |
| | | // if ("Y".equals(config)) { |
| | | // orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } else { |
| | | // orderList = orderService.getTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | // |
| | | // List<TjCustomer> customers = null; |
| | | // if (null != checkStatus && checkStatus == 0) { |
| | | // customers = redisCache.getCacheMapValue("check", "ws"); |
| | | // } |
| | | // if (null != checkStatus && checkStatus == 1) { |
| | | // customers = redisCache.getCacheMapValue("check", "ys"); |
| | | // } |
| | | // if (customers != null && customers.size() > 0) { |
| | | //// asyncService.addRedis(customers); |
| | | // List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // map.put("customers", customerLists); |
| | | // map.put("total", customers.size()); |
| | | // return AjaxResult.success(map); |
| | | // } else { |
| | | // //判断是否开启初审 |
| | | // if ("Y".equals(config)) { |
| | | // orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } else { |
| | | // orderList = orderService.getTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | String value = String.valueOf(compId); |
| | | if(tjNumber==null)tjNumber=""; |
| | | if(compId==null)value=""; |
| | | if(name==null)name=""; |
| | | if(beginTime==null)beginTime=""; |
| | | if(endTime==null)endTime=""; |
| | | return AjaxResult.success(orderService.getCunChuGuoChengCustomerList(tjNumber,page,pageSize,checkStatus, value,beginTime,endTime,name)); |
| | | } |
| | | |
| | | /** |