| | |
| | | package com.ltkj.web.controller.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | |
| | | 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.utils.IdUtils; |
| | | import com.ltkj.hosp.idutil.IdUtils; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.hisDto.*; |
| | | import com.ltkj.hosp.mapper.TjOrderDetailMapper; |
| | | import com.ltkj.hosp.mapper.TjOrderRemarkMapper; |
| | | import com.ltkj.hosp.mapper.TjSamplingMapper; |
| | | import com.ltkj.hosp.pacsDto.SavePacsApply; |
| | | import com.ltkj.hosp.service.*; |
| | |
| | | private ITjRulesService rulesService; |
| | | @Autowired |
| | | private ITjProAdvicerulesService tjProAdvicerulesService; |
| | | |
| | | @Autowired |
| | | private TjOrderDetailMapper detailMapper; |
| | | |
| | | @Autowired |
| | | private TjOrderRemarkMapper remarkMapper; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser,String jxbz) { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | Boolean lisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if (null != detailList && detailList1) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | // if (jyxmzd != null) { |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project.getProId())); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project1.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project1.getProId())); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project1); |
| | | // if (jyxmzd != null) { |
| | | // sampling.setSpecimenTypeCode(jyxmzd.getJybbdm()); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | try { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | Boolean lisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if (null != detailList && detailList1) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | int i = samplingService.isExistProId(order.getTjNumber(), String.valueOf(detail.getProId())); |
| | | if(i>0) continue; |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | // if (jyxmzd != null) { |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project.getProId())); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project1.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project1.getProId())); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project1); |
| | | // if (jyxmzd != null) { |
| | | // sampling.setSpecimenTypeCode(jyxmzd.getJybbdm()); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(new Date()); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(new Date()); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(new Date()); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(new Date()); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | } |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | }else { |
| | | deptname=dept.getDeptName(); |
| | | } |
| | | |
| | | String xb= tjCustomerService.getSexByTjh(order.getTjNumber()); |
| | | |
| | | for (TjOrderDetail detail : tjOrderDetailList) { |
| | | detail.setTjStatus(1L); |
| | |
| | | for (String s : split) { |
| | | s = s.replaceAll("\n", ""); |
| | | // Map<String,Object> maps= rulesService.getyichangxiangmujianyiguizeJianCha(s); |
| | | Map<String,Object> mapss= tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname,s,"0"); |
| | | Map<String,Object> mapss= tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname,s,"0",xb); |
| | | if(null !=mapss && !mapss.isEmpty()){ |
| | | Object bt = mapss.get("bt"); |
| | | Object nr = mapss.get("nr"); |
| | |
| | | //如果该项目存在 则 不保存 |
| | | |
| | | TjOrderDetail orderDetail = tjOrderDetailService.getTjOrderDetailByOrderId(String.valueOf(tjFlowingWater.getOrderId()), tjProId); |
| | | if(null !=orderDetail) continue; |
| | | // if(null !=orderDetail) continue; |
| | | if(null !=orderDetail) { |
| | | detailMapper.updateTjOrderDetailDel(orderDetail.getOrderDetailId().toString()); |
| | | } |
| | | |
| | | TjProject projects = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | if (null != projects) { |
| | |
| | | if(!projectList.isEmpty()){ |
| | | List<TjProject> list = projectList.stream().distinct().collect(Collectors.toList()); |
| | | for (TjProject project : list) { |
| | | |
| | | TjOrderRemark orderRemark = orderRemarkService.getTjOrderRemarkByTjNumAndProParentId(order.getTjNumber(), String.valueOf(project.getProId())); |
| | | if(null !=orderRemark){ |
| | | remarkMapper.updateTjOrderRemarkdel(orderRemark.getRemarkId().toString()); |
| | | } |
| | | |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(project.getProId()); |
| | | tjOrderRemark.setProName(project.getProName()); |
| | |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setJxbz(jxbz); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | |
| | | |
| | | TjOrderDetail orderDetail = tjOrderDetailService.getTjOrderDetailByOrderId(String.valueOf(tjFlowingWater.getOrderId()), project.getProId().toString()); |
| | | if(null !=orderDetail) { |
| | | detailMapper.updateTjOrderDetailDel(orderDetail.getOrderDetailId().toString()); |
| | | } |
| | | |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | |
| | | } |
| | | |
| | | public void addCaiYangDengJiByDiaoYongShiTu(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser,String jxbz) { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | if (null != detailList && detailList1) { |
| | | Date date = new Date(); |
| | | String format = DateUtil.format(date, "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | try { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | if (null != detailList && detailList1) { |
| | | Date date = new Date(); |
| | | String format = DateUtil.format(date, "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | int i = samplingService.isExistProId(order.getTjNumber(), String.valueOf(detail.getProId())); |
| | | if(i>0) continue; |
| | | |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(date); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(date); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(date); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(date); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(date); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(date); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | } |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | List<String> mapJinchuan=null; |
| | | private static List<String> mapJinchuan=null; |
| | | public AjaxResult tijianbulushenqingJinchuanNew(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | mapJinchuan=new ArrayList<>(); |
| | | tijianbulushenqingOld( customer,date, cardId, jxbz, jianChaProjects, isTuanTiPiao); |
| | |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | mapJinchuan.add(project.getProId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | { |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | |
| | | // mapJinchuan.add(project.getProParentId().toString()); |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDto.setProjg(project.getProPrice()); |
| | | // detailDtos.add(detailsDto); |
| | | } |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | detilsDto.setCflx(i.getCflx()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //药品申请 |
| | | //药品申请 原版 |
| | | // if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | // OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | // dto1.setHisRegistrationId(cardId); |
| | | // dto1.setSfzh(customer.getCusIdcard()); |
| | | // dto1.setSqysbm(ysbm); |
| | | // dto1.setMzksbm(dept); |
| | | // dto1.setSjrq(date); |
| | | // String yfbm = configService.selectConfigByKey("chufang_yfbm"); |
| | | // String mzzd = configService.selectConfigByKey("chufang_mzzd"); |
| | | // String czybm = configService.selectConfigByKey("chufang_czybm"); |
| | | // String czyksbm = configService.selectConfigByKey("chufang_czyksbm"); |
| | | // String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | // if (czybm.equalsIgnoreCase("N")) |
| | | // dto1.setCzybm(ysbm); |
| | | // else dto1.setCzybm(czybm); |
| | | // if (czyksbm.equalsIgnoreCase("N")) |
| | | // dto1.setCzyksbm(dept); |
| | | // else dto1.setCzyksbm(dept); |
| | | // dto1.setCflxbm(cflxbm); |
| | | // if (yfbm.equalsIgnoreCase("N")) |
| | | // dto1.setYfbm("1"); |
| | | // else dto1.setYfbm(yfbm); |
| | | // dto1.setFyts("1"); |
| | | // if (mzzd.equalsIgnoreCase("N")) |
| | | // dto1.setMzzd(""); |
| | | // else dto1.setMzzd(mzzd); |
| | | // dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | // AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | // String result1 = getAjaxResult(result); |
| | | // JSONObject object = getJSONObject(result1); |
| | | // String code = object.getStr("ResultCode"); |
| | | // if(null !=code && code.equals("0")){ |
| | | // JSONObject resultData = object.getJSONObject("ResultData"); |
| | | //// Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | // String cfh = resultData.getStr("cfh"); |
| | | // log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | // for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | // TjCf cf=new TjCf(); |
| | | // cf.setJxbz(jxbz); |
| | | // cf.setCardId(cardId); |
| | | // cf.setSfzh(customer.getCusIdcard()); |
| | | // cf.setCfh(cfh); |
| | | // cf.setSqysbm(ysbm); |
| | | // cf.setSqysxm(ysmc); |
| | | // cf.setMzksbn(dept); |
| | | // cf.setSqrq(date); |
| | | // cf.setCzybm(ysbm); |
| | | // cf.setYpbm(detilsDto.getYpbm()); |
| | | // cf.setYpmc(detilsDto.getYpmc()); |
| | | // cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | // cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | // cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | // cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | // cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | // cf.setCreateTime(new Date()); |
| | | // cfService.save(cf); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 药品申请 处方类型维护在药品表 |
| | | */ |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | String yfbm = configService.selectConfigByKey("chufang_yfbm"); |
| | | String mzzd = configService.selectConfigByKey("chufang_mzzd"); |
| | | String czybm = configService.selectConfigByKey("chufang_czybm"); |
| | | String czyksbm = configService.selectConfigByKey("chufang_czyksbm"); |
| | | String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | if (czybm.equalsIgnoreCase("N")) |
| | | dto1.setCzybm(ysbm); |
| | | else dto1.setCzybm(czybm); |
| | | if (czyksbm.equalsIgnoreCase("N")) |
| | | dto1.setCzyksbm(dept); |
| | | else dto1.setCzyksbm(dept); |
| | | dto1.setCflxbm(cflxbm); |
| | | if (yfbm.equalsIgnoreCase("N")) |
| | | dto1.setYfbm("1"); |
| | | else dto1.setYfbm(yfbm); |
| | | dto1.setFyts("1"); |
| | | if (mzzd.equalsIgnoreCase("N")) |
| | | dto1.setMzzd(""); |
| | | else dto1.setMzzd(mzzd); |
| | | dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null !=code && code.equals("0")){ |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | // Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | String cfh = resultData.getStr("cfh"); |
| | | log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf=new TjCf(); |
| | | cf.setJxbz(jxbz); |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc(detilsDto.getYpmc()); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cfService.save(cf); |
| | | // String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | Map<String, List<OutpinmedicapplyDetilsDto>> listMap = outpinmedicapplyDetilsDtos.stream().collect(Collectors.groupingBy(OutpinmedicapplyDetilsDto::getCflx)); |
| | | listMap.forEach((cflx, details) -> { |
| | | OutpinmedicapplyDto dto1 = new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | if (czybm.equalsIgnoreCase("N")) |
| | | dto1.setCzybm(ysbm); |
| | | else dto1.setCzybm(czybm); |
| | | if (czyksbm.equalsIgnoreCase("N")) |
| | | dto1.setCzyksbm(dept); |
| | | else dto1.setCzyksbm(czyksbm); |
| | | dto1.setCflxbm(cflx); |
| | | if (yfbm.equalsIgnoreCase("N")) |
| | | dto1.setYfbm("1"); |
| | | else dto1.setYfbm(yfbm); |
| | | dto1.setFyts("1"); |
| | | if (mzzd.equalsIgnoreCase("N")) |
| | | dto1.setMzzd(""); |
| | | else dto1.setMzzd(mzzd); |
| | | dto1.setDetails(details); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if (null != code && code.equals("0")) { |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | String cfh = resultData.getStr("cfh"); |
| | | log.info("药品申请后的处方号是: " + cfh + " outpinmedicapplyDetilsDtos 里面的值为: " + outpinmedicapplyDetilsDtos.toString()); |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf = new TjCf(); |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc(detilsDto.getYpmc()); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cfService.save(cf); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |