| | |
| | | import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; |
| | | import com.ltkj.hosp.domain.TjReservation; |
| | | import com.ltkj.hosp.mapper.TestMapper; |
| | | import com.ltkj.hosp.service.ITjReservationService; |
| | | import com.ltkj.hosp.service.TjvLtkjvtjpatService; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail; |
| | | import com.ltkj.hosp.sqlDomain.LtkjMiddleHead; |
| | | import com.ltkj.hosp.sqlDomain.LtkjTjPat; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.enums.BusinessType; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.service.ITjCustomerService; |
| | | import com.ltkj.common.utils.poi.ExcelUtil; |
| | | import com.ltkj.common.core.page.TableDataInfo; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | private TestMapper testMapper; |
| | | @Resource |
| | | private TjvLtkjvtjpatService tjvLtkjvtjpatService; |
| | | @Resource |
| | | private LtkjMiddleHeadService headService; |
| | | @Resource |
| | | private LtkjMiddleDetailService middleDetailService; |
| | | |
| | | @GetMapping("/newGetTjPat") |
| | | @ApiOperation(value = "查询his数据库返回新的数据") |
| | | public AjaxResult newGetTjPat() { |
| | | List<Map<String, Object>> maps = testMapper.newGetTjPat(); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | return AjaxResult.success(maps); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | qw.eq(TjCustomer::getCusIdcard, cusIdcard); |
| | | TjCustomer customer = tjCustomerService.getOne(qw); |
| | | customer.setReservationId(customer.getCardId()); |
| | | extracted(customer); |
| | | return success(customer); |
| | | }else { |
| | | tjCustomer.setReservationId(tjCustomer.getCardId()); |
| | | extracted(tjCustomer); |
| | | return success(tjCustomer); |
| | | } |
| | | |
| | |
| | | return error("身份证号不存在"); |
| | | } |
| | | |
| | | private void extracted(TjCustomer customer) { |
| | | LtkjMiddleHead pat = testMapper.getMiddleHeadByPartId(customer.getCardId()); |
| | | if (null != pat) { |
| | | List<LtkjMiddleDetail> list = testMapper.getMiddleDetailByFeadId(pat.getFeadId()); |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | LtkjMiddleHead o = headService.getMiddleHeadByPartId(customer.getCardId()); |
| | | if(o==null){ |
| | | headService.save(pat); |
| | | for (LtkjMiddleDetail ltkjMiddleDetail : list) { |
| | | middleDetailService.save(ltkjMiddleDetail); |
| | | } |
| | | testMapper.saveTjProByCusId(customer.getCardId(), customer.getCusIdcard()); |
| | | } |
| | | testMapper.saveTjProByCusId(customer.getCardId(), customer.getCusIdcard()); |
| | | } |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询客户信息列表 |