| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.text.Collator; |
| | | import java.util.*; |
| | |
| | | @ApiOperation (value = "同步sql server数据到本地数据库数据接口") |
| | | @RepeatSubmit |
| | | // @Transactional |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber) { |
| | | |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber, HttpServletRequest request) { |
| | | String hospId = request.getHeader("hospId"); |
| | | RLock lock = redissonClient.getLock("lock:check:dataSynchronization:" + tjNumber); |
| | | try { |
| | | boolean tryLock = lock.tryLock(3L, TimeUnit.SECONDS); |
| | |
| | | return AjaxResult.success("同步成功"); |
| | | } |
| | | else if(null !=sfkqdshitulianjie && sfkqdshitulianjie.equalsIgnoreCase("Y")){ |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(order.getTjNumber()); |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(order.getTjNumber(),hospId); |
| | | if(null != hysqdList && !hysqdList.isEmpty()){ |
| | | for (LtkjHysqd hysqd : hysqdList) { |
| | | LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(hysqd.getTjh(),hysqd.getTmh()); |
| | |
| | | } |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(order.getTjNumber()); |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(order.getTjNumber(),hospId); |
| | | if(null !=jcsqdList && !jcsqdList.isEmpty()){ |
| | | jcsqdService.deletedLtkjJcsqdByTjhAndTmh(order.getCardId()); |
| | | jcbgdService.deletedLtkjJcbgdByTjhAndTmh(order.getCardId()); |
| | | jcsqdService.saveBatch(jcsqdList); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(order.getCardId()); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(order.getCardId(),hospId); |
| | | if(null != jcbgdList && !jcbgdList.isEmpty())jcbgdService.saveBatch(jcbgdList); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |