| | |
| | | import com.ltkj.common.core.domain.entity.SysDept; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.enums.DataSourceType; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.mapper.TestMapper; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail; |
| | | import com.ltkj.hosp.sqlDomain.LtkjMiddleHead; |
| | | import com.ltkj.hosp.vodomain.BingZhongVO; |
| | | import com.ltkj.hosp.vodomain.HistoryTjOrder; |
| | | import com.ltkj.hosp.vodomain.QjDomainVo; |
| | |
| | | |
| | | @Autowired |
| | | private ITjReportGetAddressService tjReportGetAddressService; |
| | | |
| | | @Resource |
| | | private TestMapper testMapper; |
| | | |
| | | @Resource |
| | | private LtkjMiddleDetailService middleDetailService; |
| | | |
| | | @Resource |
| | | private LtkjMiddleHeadService headService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping |
| | | @ApiOperation(value = "体检签到登记接口") |
| | | @Transactional |
| | | //@Transactional (切换数据库出错,所以注释) |
| | | public AjaxResult addOrderAndDetail(@RequestBody TjOrder tjOrder) throws Exception { |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | SysUser sysUser = userService.getById(userId); |
| | |
| | | |
| | | // asyncService.newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | } |
| | | |
| | | //调用SQL server拿取收费情况 |
| | | List<LtkjMiddleHead> one = testMapper.saveMiddleHeadByPatId(tjCustomer.getCusIdcard()); |
| | | if (one!=null){ |
| | | for (LtkjMiddleHead ltkjMiddleHead : one) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | headService.save(ltkjMiddleHead); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | List<LtkjMiddleDetail> detailList = testMapper.getMiddleDetailByHeadId(ltkjMiddleHead.getFeadId()); |
| | | if (detailList!=null){ |
| | | for (LtkjMiddleDetail ltkjMiddleDetail : detailList) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | middleDetailService.save(ltkjMiddleDetail); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return AjaxResult.success(tjNumber); |
| | | } |
| | |
| | | TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard); |
| | | if(null !=tjCustomer){ |
| | | TjOrder order= tjOrderService.getLastTjOrderListByCusId(tjCustomer.getCusId()); |
| | | |
| | | return AjaxResult.success(order); |
| | | if(null !=order){ |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | 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("parentName", projectService.getById(aLong).getProName()); |
| | | 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()); |
| | | 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("parentName", projectService.getById(aLong).getProName()); |
| | | 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())); |
| | | list.add(map); |
| | | } |
| | | |
| | | 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("parentName", projectService.getById(aLong).getProName()); |
| | | 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); |
| | | } |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | | return AjaxResult.success("暂无历史记录"); |
| | | } |