ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -79,32 +79,6 @@ if (null != pationid) { customer.setPationId(pationid); customerService.updateById(customer); /* String key = configService.selectConfigByKey("getInfoFromSqlData"); if (null != key && key.equals("Y")) { OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); outpinregapplyDto.setPationid(pationid); outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); outpinregapplyDto.setMzksbm("0101"); outpinregapplyDto.setCzybm("00029"); outpinregapplyDto.setSfjz("0"); outpinregapplyDto.setGhzlbm("01"); outpinregapplyDto.setYwckbm("0001"); outpinregapplyDto.setSflstd("0"); outpinregapplyDto.setGhrq(date); //门诊挂号 AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); String result2 = getAjaxResult(ajaxResult); JSONObject object1 = getJSONObject(result2); String code1 = object1.getStr("ResultCode"); if (code1.equals("0")) { JSONArray resultDatas = object1.getJSONArray("ResultData"); if (null != resultDatas && resultDatas.size() > 0) { //门诊医生接诊 controller.Outpinconapply(customer.getCardId(), date, SecurityUtils.getUsername()); } } } */ //检验申请 OutpintestapplyDto dto = new OutpintestapplyDto(); @@ -142,30 +116,26 @@ } } } if (detailsDtos.size()==0) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(""); detailsDto.setSfzhfy(""); detailsDto.setSl(0); detailsDtos.add(detailsDto); } dto.setDetails(detailsDtos); AjaxResult ajaxResult1 = controller.Outpintestapply(dto); String result5 = getAjaxResult(ajaxResult1); JSONObject object3 = getJSONObject(result5); String code3 = object3.getStr("ResultCode"); if (code3.equals("0")) { Map<String, Object> datas = object3.getJSONObject("ResultData"); datas.put("cardId", customer.getCardId()); JSONObject object4 = JSONUtil.parseObj(datas); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto))); if (detailsDtos.size()>0) { dto.setDetails(detailsDtos); AjaxResult ajaxResult1 = controller.Outpintestapply(dto); String result5 = getAjaxResult(ajaxResult1); JSONObject object3 = getJSONObject(result5); String code3 = object3.getStr("ResultCode"); if (code3.equals("0")) { Map<String, Object> datas = object3.getJSONObject("ResultData"); datas.put("cardId", customer.getCardId()); JSONObject object4 = JSONUtil.parseObj(datas); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto))); }else { return AjaxResult.success(); }else { return AjaxResult.error(); } } //门诊检查申请 OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); outpinexamapplyDto.setHisRegistrationId(customer.getCardId()); @@ -201,30 +171,26 @@ } } } if (detailsDtoss.size()==0) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(""); detailsDto.setSfzhfy(""); detailsDto.setSl(0); detailsDtoss.add(detailsDto); } outpinexamapplyDto.setDetails(detailsDtoss); AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); String result6 = getAjaxResult(ajaxResult2); JSONObject object5 = getJSONObject(result6); String code4 = object5.getStr("ResultCode"); if (code4.equals("0")) { Map<String, Object> map = object5.getJSONObject("ResultData"); map.put("cardId", customer.getCardId()); JSONObject jsonObject = JSONUtil.parseObj(map); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto))); if (detailsDtoss.size()>0) { outpinexamapplyDto.setDetails(detailsDtoss); AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); String result6 = getAjaxResult(ajaxResult2); JSONObject object5 = getJSONObject(result6); String code4 = object5.getStr("ResultCode"); if (code4.equals("0")) { Map<String, Object> map = object5.getJSONObject("ResultData"); map.put("cardId", customer.getCardId()); JSONObject jsonObject = JSONUtil.parseObj(map); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto))); }else { return AjaxResult.success(); }else { return AjaxResult.error(); } } //门诊治疗处置申请 OutpintreatapplyDto dao = new OutpintreatapplyDto(); @@ -261,28 +227,23 @@ } } } if (detailDtos.size()==0) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(""); detailsDto.setSfzhfy(""); detailsDto.setSl(0); detailDtos.add(detailsDto); } dao.setDetails(detailDtos); AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); String mzylyzsq2 = getAjaxResult(mzylyzsq1); JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); String code5 = mzylyzsq3.getStr("ResultCode"); if (code5.equals("0")) { Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData"); map.put("cardId", customer.getCardId()); JSONObject jsonObject = JSONUtil.parseObj(map); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao))); }else { return AjaxResult.error(); if (detailDtos.size()>0) { dao.setDetails(detailDtos); AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); String mzylyzsq2 = getAjaxResult(mzylyzsq1); JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); String code5 = mzylyzsq3.getStr("ResultCode"); if (code5.equals("0")) { Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData"); map.put("cardId", customer.getCardId()); JSONObject jsonObject = JSONUtil.parseObj(map); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao))); }else { return AjaxResult.error(); } } return AjaxResult.success(); } ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethodService.java
@@ -59,7 +59,14 @@ map.put ("Pationid", null); } map.put ("brxm", customer.getCusName ()); map.put ("brxb", customer.getCusSex ()); Long cusSex = customer.getCusSex(); if(cusSex==0L){ map.put ("brxb",1); }else if(cusSex==1L){ map.put ("brxb",2); }else { map.put ("brxb",9); } map.put ("csrq", DateUtil.format(customer.getCusBrithday(),"yyyy-MM-dd")); map.put ("brnl", customer.getAge ()); map.put ("brnldw", customer.getAgeUnit ()); ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
@@ -1,7 +1,10 @@ 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.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.core.domain.entity.SysUser; @@ -10,13 +13,20 @@ import com.ltkj.common.utils.StringUtils; import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.*; import com.ltkj.hosp.hisDto.OutpinexamapplyDto; import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto; import com.ltkj.hosp.hisDto.OutpintestapplyDto; import com.ltkj.hosp.hisDto.OutpintreatapplyDto; import com.ltkj.hosp.service.*; import com.ltkj.hosp.vodomain.AddNewReservationConfirm; import com.ltkj.hosp.vodomain.LineChartsVo; import com.ltkj.hosp.vodomain.PieChartVo; import com.ltkj.hosp.vodomain.QjDomainVo; import com.ltkj.mall.mallOrderUtils.TjConstants; import com.ltkj.system.service.ISysConfigService; import com.ltkj.system.service.ISysUserService; import com.ltkj.web.controller.his.HisApiGetMethodService; import com.ltkj.web.controller.his.HisApiMethodService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -96,7 +106,14 @@ private IDictSfxmService dictSfxmService; @Autowired private ITjRulesService tjRulesService; @Autowired private HisApiMethodService controller; @Autowired private HisApiConfigService hisApiConfigService; @Autowired private HisApiGetMethodService hisApiGetMethodService; @Resource private ISysConfigService configService; @Override public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { @@ -468,9 +485,28 @@ @Override @Async("async") @Transactional public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { Date dates = new Date(); final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); List<TjConsumables> list2 = new ArrayList<>(); String[] tjProIds = tjFlowingWater.getTjProIds(); String config = configService.selectConfigByKey("sfkqdyhis"); //检验 List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); //检查 List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); //处置 List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); List<TjProject> projectList=new ArrayList<>(); for (String tjProId : tjProIds) { LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); @@ -482,9 +518,9 @@ tjOrderRemark.setDeptId(project.getDeptId()); tjOrderRemark.setTjNumber(order.getTjNumber()); tjOrderRemark.setCreateBy(sysUser.getNickName()); tjOrderRemark.setCreateTime(new Date()); tjOrderRemark.setCreateTime(dates); tjOrderRemark.setUpdateBy(sysUser.getNickName()); tjOrderRemark.setUpdateTime(new Date()); tjOrderRemark.setUpdateTime(dates); tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); orderRemarkService.save(tjOrderRemark); @@ -493,13 +529,13 @@ TjOrderDetail detail = new TjOrderDetail(); detail.setTjStatus(0L); detail.setOrderId(tjFlowingWater.getOrderId()); detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); // detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); detail.setProId(Long.valueOf(tjProId)); detail.setIsAddition("Y"); detail.setCreateBy(sysUser.getNickName()); detail.setCreateTime(new Date()); detail.setCreateTime(dates); detail.setUpdateBy(sysUser.getNickName()); detail.setUpdateTime(new Date()); detail.setUpdateTime(dates); detail.setCreateId(String.valueOf(sysUser.getUserId())); detail.setUpdateId(String.valueOf(sysUser.getUserId())); tjOrderDetailService.save(detail); @@ -507,69 +543,102 @@ TjOrderDetail detail1 = new TjOrderDetail(); detail1.setTjStatus(0L); detail1.setOrderId(tjFlowingWater.getOrderId()); detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); // detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); detail1.setProId(proId); detail1.setIsAddition("Y"); detail.setCreateBy(sysUser.getNickName()); detail.setCreateTime(new Date()); detail.setCreateTime(dates); detail.setUpdateBy(sysUser.getNickName()); detail.setUpdateTime(new Date()); detail.setUpdateTime(dates); detail.setCreateId(String.valueOf(sysUser.getUserId())); detail.setUpdateId(String.valueOf(sysUser.getUserId())); tjOrderDetailService.save(detail1); } wqq.in(TbTransition::getProId, proIds); if(null !=config && config.equals("Y")){ //检验 if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); } else { detailsDto.setSfzhfy("0"); } detailsDto.setSl(1); detailsDtos.add(detailsDto); } } //检查 if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 247 || project.getDeptId() == 248 || project.getDeptId() == 249 || project.getDeptId() == 250 || project.getDeptId() == 251 || project.getDeptId() == 252 || project.getDeptId() == 271 || project.getDeptId() == 273 || project.getDeptId() == 274 || project.getDeptId() == 275 || project.getDeptId() == 298)) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); } else { detailsDto.setSfzhfy("0"); } detailsDto.setSl(1); detailsDtoss.add(detailsDto); } } //处置 if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 100 || project.getDeptId() == 240 || project.getDeptId() == 253 || project.getDeptId() == 254 || project.getDeptId() == 255 || project.getDeptId() == 257 || project.getDeptId() == 258 || project.getDeptId() == 259 || project.getDeptId() == 269 || project.getDeptId() == 270)) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); } else { detailsDto.setSfzhfy("0"); } detailsDto.setSl(1); detailDtos.add(detailsDto); } } } } else { wqq.in(TbTransition::getProId, Arrays.asList(tjProIds)); TjProject projects = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); if (null != projects) { TjProject projectss = projectService.selectTjProjectByProId(projects.getProParentId()); if (null != projectss) { TjOrderRemark tjOrderRemark = new TjOrderRemark(); tjOrderRemark.setProId(Long.valueOf(tjProId)); tjOrderRemark.setProName(projectss.getProName()); tjOrderRemark.setDeptId(projectss.getDeptId()); tjOrderRemark.setTjNumber(order.getTjNumber()); tjOrderRemark.setCreateBy(sysUser.getNickName()); tjOrderRemark.setCreateTime(new Date()); tjOrderRemark.setUpdateBy(sysUser.getNickName()); tjOrderRemark.setUpdateTime(new Date()); tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); orderRemarkService.save(tjOrderRemark); if (null != projectss && projectss.getProParentId()==0L) { projectList.add(projectss); } } // List<Long> proIds = projectService.getTjProjectListBySoneId(tjProId).stream().map(TjProject::getProId).collect(Collectors.toList()); TjOrderDetail detail = new TjOrderDetail(); detail.setTjStatus(0L); detail.setOrderId(tjFlowingWater.getOrderId()); detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); // detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); detail.setProId(Long.valueOf(tjProId)); detail.setIsAddition("Y"); detail.setCreateBy(sysUser.getNickName()); detail.setCreateTime(new Date()); detail.setCreateTime(dates); detail.setUpdateBy(sysUser.getNickName()); detail.setUpdateTime(new Date()); detail.setUpdateTime(dates); detail.setCreateId(String.valueOf(sysUser.getUserId())); detail.setUpdateId(String.valueOf(sysUser.getUserId())); tjOrderDetailService.save(detail); // for (Long proId : proIds) { TjOrderDetail detail1 = new TjOrderDetail(); detail1.setTjStatus(0L); detail1.setOrderId(tjFlowingWater.getOrderId()); detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); detail1.setProId(Long.valueOf(tjProId)); detail1.setIsAddition("Y"); detail.setCreateBy(sysUser.getNickName()); detail.setCreateTime(new Date()); detail.setUpdateBy(sysUser.getNickName()); detail.setUpdateTime(new Date()); detail.setCreateId(String.valueOf(sysUser.getUserId())); detail.setUpdateId(String.valueOf(sysUser.getUserId())); tjOrderDetailService.save(detail1); // } } List<TbTransition> tbTransitionList = transitionService.list(wqq); @@ -586,9 +655,9 @@ tjChargingStandard.setPrice(transition.getNowPrice()); tjChargingStandard.setProName(tjProject.getProName()); tjChargingStandard.setCreateBy(sysUser.getNickName()); tjChargingStandard.setCreateTime(new Date()); tjChargingStandard.setCreateTime(dates); tjChargingStandard.setUpdateBy(sysUser.getNickName()); tjChargingStandard.setUpdateTime(new Date()); tjChargingStandard.setUpdateTime(dates); tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); chargingStandardService.save(tjChargingStandard); @@ -624,6 +693,183 @@ } } } if(projectList.size()>0){ List<TjProject> list = projectList.stream().distinct().collect(Collectors.toList()); for (TjProject project : list) { TjOrderRemark tjOrderRemark = new TjOrderRemark(); tjOrderRemark.setProId(project.getProId()); tjOrderRemark.setProName(project.getProName()); tjOrderRemark.setDeptId(project.getDeptId()); tjOrderRemark.setTjNumber(order.getTjNumber()); tjOrderRemark.setCreateBy(sysUser.getNickName()); tjOrderRemark.setCreateTime(dates); tjOrderRemark.setUpdateBy(sysUser.getNickName()); tjOrderRemark.setUpdateTime(dates); tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); orderRemarkService.save(tjOrderRemark); TjOrderDetail detail1 = new TjOrderDetail(); detail1.setTjStatus(0L); detail1.setOrderId(tjFlowingWater.getOrderId()); // detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); detail1.setProId(project.getProId()); detail1.setIsAddition("Y"); detail1.setCreateBy(sysUser.getNickName()); detail1.setCreateTime(dates); detail1.setUpdateBy(sysUser.getNickName()); detail1.setUpdateTime(dates); detail1.setCreateId(String.valueOf(sysUser.getUserId())); detail1.setUpdateId(String.valueOf(sysUser.getUserId())); tjOrderDetailService.save(detail1); if(null !=config && config.equals("Y")){ //检验 if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); } else { detailsDto.setSfzhfy("0"); } detailsDto.setSl(1); detailsDtos.add(detailsDto); } } //检查 if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 247L || project.getDeptId() == 248L || project.getDeptId() == 249L || project.getDeptId() == 250L || project.getDeptId() == 251L || project.getDeptId() == 252L || project.getDeptId() == 271L || project.getDeptId() == 273L || project.getDeptId() == 274L || project.getDeptId() == 275L || project.getDeptId() == 298L)) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); } else { detailsDto.setSfzhfy("0"); } detailsDto.setSl(1); detailsDtoss.add(detailsDto); } } //处置 if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 100L || project.getDeptId() == 240L || project.getDeptId() == 253L || project.getDeptId() == 254L || project.getDeptId() == 255L || project.getDeptId() == 257L || project.getDeptId() == 258L || project.getDeptId() == 259L || project.getDeptId() == 269L || project.getDeptId() == 270L)) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); } else { detailsDto.setSfzhfy("0"); } detailsDto.setSl(1); detailDtos.add(detailsDto); } } } } } if(null !=config && config.equals("Y")){ //检验申请 if(detailsDtos.size()>0){ OutpintestapplyDto dto = new OutpintestapplyDto(); dto.setHisRegistrationId(order.getCardId()); dto.setSfjz(customer.getCusIdcard()); dto.setSqysbm(sysUser.getUserName()); dto.setMzksbm("0101"); dto.setSjrq(date); dto.setCzybm("00029"); dto.setCzyksbm("0101"); dto.setSfjz("1"); dto.setDetails(detailsDtos.stream().distinct().collect(Collectors.toList())); AjaxResult ajaxResult1 = controller.Outpintestapply(dto); String result5 = getAjaxResult(ajaxResult1); JSONObject object3 = getJSONObject(result5); String code3 = object3.getStr("ResultCode"); if (code3.equals("0")) { Map<String, Object> datas = object3.getJSONObject("ResultData"); datas.put("cardId", order.getCardId()); JSONObject object4 = JSONUtil.parseObj(datas); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto))); } } //门诊检查申请 if(detailsDtoss.size()>0){ OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); outpinexamapplyDto.setHisRegistrationId(order.getCardId()); outpinexamapplyDto.setSfzh(customer.getCusIdcard()); outpinexamapplyDto.setSqysbm(sysUser.getUserName()); outpinexamapplyDto.setMzksbm("0101"); outpinexamapplyDto.setCzybm("00029"); outpinexamapplyDto.setCzyksbm("0101"); outpinexamapplyDto.setDetails(detailsDtoss.stream().distinct().collect(Collectors.toList())); AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); String result6 = getAjaxResult(ajaxResult2); JSONObject object5 = getJSONObject(result6); String code4 = object5.getStr("ResultCode"); if (code4.equals("0")) { Map<String, Object> map = object5.getJSONObject("ResultData"); map.put("cardId", order.getCardId()); JSONObject jsonObject = JSONUtil.parseObj(map); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto))); } } //门诊治疗处置申请 if(detailDtos.size()>0){ OutpintreatapplyDto dao = new OutpintreatapplyDto(); dao.setHisRegistrationId(order.getCardId()); dao.setSfzh(customer.getCusIdcard()); dao.setSqysbm(sysUser.getUserName()); dao.setMzksbm("0101"); dao.setSjrq(date); dao.setCzybm("00029"); dao.setCzyksbm("0101"); dao.setDetails(detailDtos.stream().distinct().collect(Collectors.toList())); AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); String mzylyzsq2 = getAjaxResult(mzylyzsq1); JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); String code5 = mzylyzsq3.getStr("ResultCode"); if (code5.equals("0")) { Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData"); map.put("cardId", order.getCardId()); JSONObject jsonObject = JSONUtil.parseObj(map); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao))); } } } //父项耗材 ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); for (TjConsumables tjConsumables : collect) { @@ -635,9 +881,9 @@ tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); tjChargingStandard.setCompany(tjConsumables.getSpecifications()); tjChargingStandard.setCreateBy(sysUser.getNickName()); tjChargingStandard.setCreateTime(new Date()); tjChargingStandard.setCreateTime(dates); tjChargingStandard.setUpdateBy(sysUser.getNickName()); tjChargingStandard.setUpdateTime(new Date()); tjChargingStandard.setUpdateTime(dates); tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); chargingStandardService.save(tjChargingStandard); @@ -1840,6 +2086,17 @@ return customerList; } //将方法返回值解析成json格式 public JSONObject getJSONObject(String builder) { String Response = JSONUtil.parseObj(builder).getStr("Response"); return JSONUtil.parseObj(Response); } //获取方法返回值信息 public String getAjaxResult(AjaxResult result) { return result.get("data").toString(); } //总检点击体检信息详情 private List<Map<String, Object>> getAjaxResult(String tjNumber) { List<Map<String, Object>> list = new ArrayList<>(); ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -144,6 +144,12 @@ // } // } //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 LambdaQueryWrapper<TjCustomer> customerLambdaQueryWrapper = new LambdaQueryWrapper<>(); customerLambdaQueryWrapper.eq(TjCustomer::getCusIdcard, cusIdcard); TjCustomer tjCustomerServiceOne = tjCustomerService.getOne(customerLambdaQueryWrapper); if(null ==tjCustomerServiceOne){ return AjaxResult.error("该人员信息不存在请先进行登记!!!"); } final String getInfoFromSqlData = sysConfigService.selectConfigByKey("getInfoFromSqlData"); if ("Y".equals(getInfoFromSqlData)) { //根据身份证号从his查信息 @@ -192,6 +198,49 @@ } } String key = sysConfigService.selectConfigByKey("sfkqdyhis"); if (null != key && key.equals("Y")) { String cardId = tjCustomerServiceOne.getCardId(); if (null != cardId && !cardId.equals("0")) { int i = tjOrderService.selectTjOrderByCardId(cardId); if (i > 0) { return AjaxResult.error("不可重复签到"); } } // controller.Outpincreateapply(tjCustomer); Date dates = new Date(); final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); outpinregapplyDto.setPationid(tjCustomerServiceOne.getPationId()); outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); outpinregapplyDto.setMzksbm("0101"); outpinregapplyDto.setCzybm("00029"); outpinregapplyDto.setSfjz("0"); outpinregapplyDto.setGhzlbm("01"); outpinregapplyDto.setYwckbm("0001"); outpinregapplyDto.setSflstd("0"); outpinregapplyDto.setGhrq(date); //门诊挂号 AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); String result2 = getAjaxResult(ajaxResult); JSONObject object1 = getJSONObject(result2); String code1 = object1.getStr("ResultCode"); if (code1.equals("0")) { JSONArray resultDatas = object1.getJSONArray("ResultData"); if (null != resultDatas && resultDatas.size() > 0) { Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0); String hisRegistrationId = resultDatasss.get("his_registration_id").toString(); //门诊医生接诊 controller.Outpinconapply(hisRegistrationId, date, SecurityUtils.getUsername()); tjCustomerServiceOne.setCardId(hisRegistrationId); tjCustomerService.updateById(tjCustomerServiceOne); } } } //end====2023.12.12 LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>(); wq.eq(TjReservation::getIdCard, cusIdcard); @@ -206,10 +255,43 @@ tjReservationService.updateById(tjReservation); return AjaxResult.error("对不起您的预约已超时请重新预约"); } LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); qw.eq(TjCustomer::getCusIdcard, cusIdcard); TjCustomer tjCustomer1 = tjCustomerService.getOne(qw); if (tjCustomer1 != null) { /* String key = sysConfigService.selectConfigByKey("sfkqdyhis"); if (null != key && key.equals("Y")) { Date dates = new Date(); final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); outpinregapplyDto.setPationid(tjCustomer1.getPationId()); outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); outpinregapplyDto.setMzksbm("0101"); outpinregapplyDto.setCzybm("00029"); outpinregapplyDto.setSfjz("0"); outpinregapplyDto.setGhzlbm("01"); outpinregapplyDto.setYwckbm("0001"); outpinregapplyDto.setSflstd("0"); outpinregapplyDto.setGhrq(date); //门诊挂号 AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); String result2 = getAjaxResult(ajaxResult); JSONObject object1 = getJSONObject(result2); String code1 = object1.getStr("ResultCode"); if (code1.equals("0")) { JSONArray resultDatas = object1.getJSONArray("ResultData"); if (null != resultDatas && resultDatas.size() > 0) { Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0); String hisRegistrationId = resultDatasss.get("his_registration_id").toString(); //门诊医生接诊 controller.Outpinconapply(hisRegistrationId, date, SecurityUtils.getUsername()); tjCustomer1.setCardId(hisRegistrationId); } } }*/ tjCustomer1.setTjType(tjReservation.getTjType()); tjCustomer1.setCusName(tjReservation.getName()); tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex())); @@ -264,11 +346,9 @@ tjCustomer.setDiscount(tjReservation.getDiscount()); tjCustomer.setGroupingId(tjReservation.getGroupingId()); return success(tjCustomer); }else { return AjaxResult.success("暂无预约信息", tjCustomerServiceOne); } LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); qw.eq(TjCustomer::getCusIdcard, cusIdcard); TjCustomer tjCustomer = tjCustomerService.getOne(qw); return AjaxResult.success("暂无预约信息", tjCustomer); } return error("身份证号不存在"); } ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java
@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiParam; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.annotation.*; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; @@ -202,8 +203,8 @@ SysUser sysUser = userService.getById(userId); TjFlowingWater flowingWater = tjFlowingWaterService.getById(tjFlowingWater.getTjSerialNumber()); tjFlowingWater.setTollCollectorId(String.valueOf(SecurityUtils.getLoginUser().getUserId())); tjFlowingWater.setPayStasus(1L); // tjFlowingWater.setTollCollectorId(String.valueOf(SecurityUtils.getLoginUser().getUserId())); // tjFlowingWater.setPayStasus(1L); TjOrder order = orderService.getById(tjFlowingWater.getOrderId()); TjCustomer customer = customerService.getById(order.getUserId()); if (null != tjFlowingWater.getTjProIds() && tjFlowingWater.getTjProIds().length > 0) { @@ -212,6 +213,9 @@ if (tjFlowingWaterService.save(tjFlowingWater)) { //异步单项收费明细 asyncService.iundividualCharges(tjFlowingWater, order, customer, sysUser); // if(!b){ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // } //extracted(tjFlowingWater, order, customer); Map<String, Object> map = new HashMap<>(); map.put("waterId", tjFlowingWater.getWaterId()); ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -845,7 +845,7 @@ LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); wq.eq(TjCustomer::getCusId, tjOrder.getUserId()); TjCustomer tjCustomer = tjCustomerService.getOne(wq); if (tjCustomer == null) return AjaxResult.error("该客户未登记或不存在"); if (tjCustomer == null) return AjaxResult.error("该客户未登记"); LambdaQueryWrapper<TjOrder> wqq = new LambdaQueryWrapper<>(); wqq.eq(TjOrder::getUserId, tjOrder.getUserId()); @@ -856,7 +856,7 @@ } TjOrder order = tjOrderService.getOne(wqq); if (null != order) { transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjCustomer.getCardId()); transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(),tjCustomer.getCardId()); return AjaxResult.error("不可重复登记"); } LambdaQueryWrapper<TjReservation> wq1 = new LambdaQueryWrapper<>(); @@ -1035,8 +1035,8 @@ if(null !=config && config.equals("Y")){ hisApiMethod.HisApiMethods(tjCustomer,tjOrder.getOrderId()); } tjCustomer.setCardId("0"); tjCustomerService.updateById(tjCustomer); // tjCustomer.setCardId("0"); // tjCustomerService.updateById(tjCustomer); return AjaxResult.success(tjNumber); } @@ -1800,6 +1800,7 @@ */ @PostMapping("/tjGoOut") @ApiOperation(value = "体检签离") @Transactional public AjaxResult tjGoOut(@RequestBody Map<String, Object> map) { Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); SysUser sysUser = userService.getById(userId); @@ -1807,6 +1808,7 @@ String jsonString = com.alibaba.fastjson.JSON.toJSONString(domainVos1); List<QjDomainVo> domainVos = com.alibaba.fastjson.JSON.parseArray(jsonString, QjDomainVo.class); String tjNumber = map.get("tjNumber").toString(); TjOrder tjOrder = tjOrderService.getOrderByTjNum(tjNumber); if (null != domainVos && domainVos.size() > 0) { Set<String> list = new HashSet<>(); for (QjDomainVo domainVo : domainVos) { @@ -1820,7 +1822,6 @@ if (domainVo.getType() == 3) { list.add(String.valueOf(domainVo.getTjNumber())); } else { TjOrder tjOrder = tjOrderService.getOrderByTjNum(remark.getTjNumber()); if (null != tjOrder) { tjOrder.setFinishTime(new Date()); tjOrder.setStatus(TjConstants.TJ_CONFIRM); @@ -1830,6 +1831,11 @@ } } asyncService.tjGoutAsync(domainVos, sysUser, list); TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); customer.setCardId("0"); tjCustomerService.updateById(customer); return AjaxResult.success("签离成功!"); } else { return getAjaxResult(tjNumber); @@ -1842,6 +1848,7 @@ */ @GetMapping("/goOut") @ApiOperation(value = "签离") @Transactional public AjaxResult goOut(@RequestParam @ApiParam(value = "体检号") String tjNumber) { return getAjaxResult(tjNumber); } @@ -1938,13 +1945,17 @@ LambdaQueryWrapper<TjOrder> wq0 = new LambdaQueryWrapper<>(); wq0.eq(TjOrder::getTjNumber, tjNumber); TjOrder tjOrder = tjOrderService.getOne(wq0); if (null != tjOrder) { TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); customer.setCardId("0"); tjCustomerService.updateById(customer); LambdaQueryWrapper<TjOrderDetail> wq11 = new LambdaQueryWrapper<>(); wq11.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); wq11.eq(TjOrderDetail::getTjStatus, 0); wq11.isNotNull(TjOrderDetail::getFlowingWaterId); List<TjOrderDetail> list = tjOrderDetailService.list(wq11); if (list != null) { Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); SysUser sysUser = userService.getById(userId); ltkj-hosp/src/main/resources/mapper/TjProjectMapper.xml
@@ -59,7 +59,9 @@ specimen_type, check_bw, pro_sex, is_eat is_eat, his_xmbm, sfzhfy from tj_project </sql>