| | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @GetMapping("/dataSynchronization") |
| | | @ApiOperation(value = "同步sql server数据到本地数据库数据接口") |
| | | @RepeatSubmit |
| | | @Transactional |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber) { |
| | | //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 |
| | | final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | |
| | | |
| | | List<String> baoGaoDans = ltkjHybgdService.getJianYanBaoGaoDan(order.getCardId()); |
| | | if(null !=baoGaoDans && baoGaoDans.size()>0){ |
| | | |
| | | // List<LtkjHysqd> one = testMapper.getHysqdByTmh(order.getCardId()); |
| | | // if (one != null && one.size() > 0) { |
| | | // for (LtkjHysqd ltkjHysqd : one) { |
| | | // ltkjHysqdService.deletedLtkjHysqdByTjhAndTmh(ltkjHysqd.getTjh(), ltkjHysqd.getTmh()); |
| | | // ltkjHybgdService.deletedLtkjHybgdByTjhAndTmh(ltkjHysqd.getTmh()); |
| | | // } |
| | | // } |
| | | // for (String baoGaoDan : baoGaoDans) { |
| | | Date dates = new Date(); |
| | | // Date dates = new Date(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("his_registration_id",order.getCardId()); |
| | | map.put("ksbm",""); |
| | | map.put("pationid",""); |
| | | map.put("ksrq",DateUtil.format(DateUtil.beginOfDay(dates), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("jsrq",DateUtil.format(DateUtil.endOfDay(dates), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("ksrq",DateUtil.format(DateUtil.beginOfDay(order.getCreateTime()), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("jsrq",DateUtil.format(DateUtil.endOfDay(order.getCreateTime()), "yyyy-MM-dd HH:mm:ss")); |
| | | map.put("pagecount",10); |
| | | map.put("page",1); |
| | | AjaxResult result = controller.Getlabreportinfo(map); |
| | |
| | | JSONObject jsonObject = (JSONObject)datum; |
| | | LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(order.getCardId(), jsonObject.getStr("JYBGID")); |
| | | if(null !=jybgid){ |
| | | continue; |
| | | ltkjHysqdService.deletedLtkjHysqdByTjhAndTmh(order.getCardId(),jsonObject.getStr("JYBGID")); |
| | | ltkjHybgdService.deletedLtkjHybgdByTjhAndTmh(jybgid.getTmh()); |
| | | } |
| | | LtkjHysqd hysqd=new LtkjHysqd(); |
| | | hysqd.setTjh(order.getCardId()); |
| | |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | if(remark.getProId().equals(tjOrderDetail.getProId())){ |
| | | String ckfw = tjOrderDetail.getStanId(); |
| | | if (StrUtil.isNotBlank(ckfw)) { |
| | | try { |
| | | Integer.parseInt(tjOrderDetail.getYcbz()); |
| | | String[] split = ckfw.split("-"); |
| | | BigDecimal min = new BigDecimal(split[0]); |
| | | BigDecimal max = new BigDecimal(split[1]); |
| | | String proResult = tjOrderDetail.getProResult(); |
| | | BigDecimal jyjgval = new BigDecimal(proResult); |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | tjOrderDetail.setYcbz("↓"); |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | tjOrderDetail.setYcbz("↑"); |
| | | }else { |
| | | tjOrderDetail.setYcbz(""); |
| | | } |
| | | } catch (NumberFormatException ignored) { } |
| | | } |
| | | if(null !=tjOrderDetail.getYcbz() && !tjOrderDetail.getYcbz().equals("")){ |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult()+" ["+tjOrderDetail.getYcbz()+"]"); |
| | | } |