| | |
| | | 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.JSONArray; |
| | | 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; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.IdUtils; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | 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.pacsDto.SavePacsApply; |
| | | 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.ISysDeptService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.config.IdcardUtil.IdcardUtil; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethodService; |
| | | import com.ltkj.web.controller.lis.LisApiMethod; |
| | | import com.ltkj.web.controller.pacs.PacsApiMethodService; |
| | | import com.ltkj.web.controller.system.TjOrderController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @Date: 2023/9/15 15:57 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @Transactional |
| | | public class TjSysAsyncServiceImpl implements TjAsyncService { |
| | | public class TjSysAsyncServiceImpl implements TjAsyncService { |
| | | @Resource |
| | | private ITjProjectService projectService; |
| | | @Resource |
| | |
| | | private IDictSfxmService dictSfxmService; |
| | | @Autowired |
| | | private ITjRulesService tjRulesService; |
| | | @Autowired |
| | | private HisApiMethodService controller; |
| | | @Autowired |
| | | private HisApiConfigService hisApiConfigService; |
| | | @Autowired |
| | | private HisApiGetMethodService hisApiGetMethodService; |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private LtkjJfzhglmxjfxmzdService ltkjJfzhglmxjfxmzdService; |
| | | @Autowired |
| | | private LtkjMxjfxmzdService ltkjMxjfxmzdService; |
| | | @Autowired |
| | | private LtkjEjjfxmzdService ltkjEjjfxmzdService; |
| | | @Autowired |
| | | private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService; |
| | | @Autowired |
| | | private TjProBlService blService; |
| | | @Resource |
| | | private ITjFlowingWaterService tjFlowingWaterService; |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | | @Autowired |
| | | private TjCfService cfService; |
| | | @Resource |
| | | private LtkjHysqdService hysqdService; |
| | | @Autowired |
| | | private PacsApiMethodService pacsApiMethodService; |
| | | @Autowired |
| | | private LisApiMethod lisApiMethod; |
| | | @Autowired |
| | | private IdUtils idUtils; |
| | | @Autowired |
| | | private LtkjJybbzdService jybbzdService; |
| | | |
| | | |
| | | @Override |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | long l = System.currentTimeMillis(); |
| | | |
| | | LambdaQueryWrapper<TjAskMedicalHistory> wq=new LambdaQueryWrapper<>(); |
| | | wq.eq(TjAskMedicalHistory::getCusId,tjCustomer.getCusId()); |
| | | LambdaQueryWrapper<TjAskMedicalHistory> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjAskMedicalHistory::getCusId, tjCustomer.getCusId()); |
| | | wq.isNull(TjAskMedicalHistory::getTjNum); |
| | | TjAskMedicalHistory history = tjAskMedicalHistoryService.getOne(wq); |
| | | if(null !=history){ |
| | | if (null != history) { |
| | | history.setTjNum(tjOrder.getTjNumber()); |
| | | tjAskMedicalHistoryService.updateById(history); |
| | | } |
| | | |
| | | List<TbTransition> tbTransitionList =null; |
| | | List<TbTransition> tbTransitionList = null; |
| | | if (redisCache.hasKey(tjCustomer.getCusIdcard())) { |
| | | tbTransitionList = redisCache.getCacheList(tjCustomer.getCusIdcard()); |
| | | redisCache.deleteObject(tjCustomer.getCusIdcard()); |
| | | }else { |
| | | } else { |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, tjCustomer.getCusIdcard()); |
| | | tbTransitionList = transitionService.list(wqq); |
| | |
| | | redisCache.deleteObject(tjCustomer.getCusIdcard() + "cusId"); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(),String.valueOf(tjOrder.getOrderId()),sysUser.getNickName(),String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId()); |
| | | |
| | | //修改每项的原价现价 |
| | | for (TbTransition transition : tbTransitionList) { |
| | |
| | | LambdaQueryWrapper<TjOrderDetail> wrapper1 = new LambdaQueryWrapper<>(); |
| | | wrapper1.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | List<TjOrderDetail> list = tjOrderDetailService.list(wrapper1); |
| | | if (list != null && list.size()>0) { |
| | | if (list != null && list.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : list) { |
| | | TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); |
| | | if(tjProject==null){ |
| | | if (tjProject == null) { |
| | | continue; |
| | | } |
| | | tjOrderDetail.setProject(tjProject); |
| | |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | } |
| | | if(tjFlowingWater.getPayStasus()==1){ |
| | | if (tjFlowingWater.getPayStasus() == 1) { |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } |
| | | } |
| | | System.out.println("这段代码时间"+(l-System.currentTimeMillis())); |
| | | System.out.println("这段代码时间" + (l - System.currentTimeMillis())); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void ttextracted(TjOrder tjOrder, TjCustomer tjCustomer,SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | public void ttextracted(TjOrder tjOrder, TjCustomer tjCustomer, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | |
| | | boolean b = tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | if (!b){ |
| | | List<TjGroupingPro> proList = groupingProService.list(new LambdaQueryWrapper<TjGroupingPro>().eq(TjGroupingPro::getGroupingId,tjOrder.getGroupId())); |
| | | if(null !=proList && proList.size()>0){ |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | boolean b = tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), |
| | | String.valueOf(sysUser.getUserId()),tjOrder.getCardId()); |
| | | if (!b) { |
| | | List<TjGroupingPro> proList = groupingProService.list(new LambdaQueryWrapper<TjGroupingPro>().eq(TjGroupingPro::getGroupingId, tjOrder.getGroupId())); |
| | | if (null != proList && proList.size() > 0) { |
| | | for (TjGroupingPro groupingPro : proList) { |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | // if (null != transition.getPacId()) { |
| | |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | //获取该项目的默认值赋值给结果 |
| | | if(null !=project.getProDefault()){ |
| | | if (null != project.getProDefault()) { |
| | | detail.setProResult(project.getProDefault()); |
| | | }else { |
| | | } else { |
| | | detail.setProResult(null); |
| | | } |
| | | detail.setIsSampling(String.valueOf(project.getIsSampling())); |
| | |
| | | } |
| | | |
| | | //添加remark表数据 |
| | | orderRemarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | orderRemarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | |
| | | //判断是否交钱 |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | } |
| | | if (tjFlowingWater.getPayStasus() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | if (tjFlowingWater.getDiscount() == null) { |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), new BigDecimal(10), tjOrder.getTjNumber()); |
| | | } else { |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), BigDecimal.valueOf(Long.parseLong(tjFlowingWater.getDiscount())), tjOrder.getTjNumber()); |
| | | } |
| | | |
| | | tjOrderDetailService.saveTjPureToneTesByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId()); |
| | | // List<TjOrderDetail> list = tjOrderDetailService.getTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId())); |
| | | // if (list != null) { |
| | | // for (TjOrderDetail tjOrderDetail : list) { |
| | |
| | | @Async("async") |
| | | public void collectFees(TjOrder order, List<TjConsumables> list2, List<TbTransition> tbTransitionList, SysUser sysUser, String discount) { |
| | | orderRemarkService.deletedOrderRemarkByTjNum(order.getTjNumber()); |
| | | redisCache.deleteObject("getOrderDetailByProParentId"+order.getTjNumber()); |
| | | redisCache.deleteObject("getOrderDetailByProParentId" + order.getTjNumber()); |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(discount)).divide(BigDecimal.valueOf(10)))); |
| | | transitionService.updateById(transition); |
| | | // transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(discount)).divide(BigDecimal.valueOf(10)))); |
| | | // transitionService.updateById(transition); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(parentProId); |
| | | tjOrderRemark.setProName(parentProject.getProName()); |
| | | tjOrderRemark.setDeptId(parentProject.getDeptId()); |
| | |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | Map<String, Object> map = getOrderDetailByProParentId(String.valueOf(parentProId), order.getTjNumber()); |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId"+order.getTjNumber(),String.valueOf(parentProId),map); |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + order.getTjNumber(), String.valueOf(parentProId), map); |
| | | } |
| | | } |
| | | } |
| | |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | wq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq.eq(TjOrderDetail::getIsSampling,0); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | if(null !=detailList && detailList.size()>0){ |
| | | // LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | // wq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | // wq.eq(TjOrderDetail::getIsSampling, 0); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser); |
| | | } |
| | | |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser) { |
| | | 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; |
| | | Long proParentId = projectService.getById(detail.getProId()).getProParentId(); |
| | | if(null !=proParentId && proParentId ==0){ |
| | | sampling.setSpecimenType(projectService.getById(detail.getProId()).getSpecimenType()); |
| | | }else { |
| | | sampling.setSpecimenType(projectService.getById(projectService.getById(detail.getProId()).getProParentId()).getSpecimenType()); |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID()); |
| | | LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | 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()); |
| | | } |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID()); |
| | | 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.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId()))!=null) { |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void abandonCheck(String tjNumber, TjOrder tjOrder, List<TjOrderDetail> list, SysUser sysUser) { |
| | | public void abandonCheck(String tjNumber, TjOrder tjOrder, List<TjOrderDetail> list, SysUser sysUser) { |
| | | for (TjOrderDetail tjOrderDetail : list) { |
| | | LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProId, tjOrderDetail.getProId()); |
| | | TjProject one = projectService.getOne(wq1); |
| | | if (one != null) { |
| | | if (one.getProParentId() != 0) { |
| | | tjOrderDetail.setTjStatus(2L); |
| | | tjOrderDetail.setProResult("弃检"); |
| | | tjOrderDetail.setUpdateTime(new DateTime()); |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } else { |
| | | tjOrderDetail.setTjStatus(1L); |
| | | tjOrderDetail.setUpdateTime(new DateTime()); |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } |
| | | // if (one.getProParentId() != 0) { |
| | | tjOrderDetail.setTjStatus(2L); |
| | | tjOrderDetail.setProResult("弃检"); |
| | | tjOrderDetail.setUpdateTime(new DateTime()); |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | // } else { |
| | | // tjOrderDetail.setTjStatus(1L); |
| | | // tjOrderDetail.setUpdateTime(new DateTime()); |
| | | // tjOrderDetailService.updateById(tjOrderDetail); |
| | | // } |
| | | // LambdaQueryWrapper<TjOrderRemark> wq=new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderRemark::getTjNumber,tjNumber); |
| | | // wq.eq(TjOrderRemark::getProId,tjOrderDetail.getProId()); |
| | | orderRemarkService.updateTjOrderRemark(tjNumber, String.valueOf(tjOrderDetail.getProId())); |
| | | //给弃检表添加记录 |
| | | TjDiscardInspection td = new TjDiscardInspection(); |
| | | td.setProId(String.valueOf(one.getProId())); |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | public void updateOrdeltile2(TjOrderDetail detail, SysUser sysUser) { |
| | | // for (TjOrderDetail detail : tjOrderDetailList) { |
| | | detail.setTjStatus(1L); |
| | | LambdaQueryWrapper<TjStandard> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjStandard::getProId, detail.getProId()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.updateById(detail); |
| | | // } |
| | | } |
| | | |
| | | @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"); |
| | | |
| | | String jxbz = DateUtil.format(dates, "yyyyMMddHHmmss")+order.getOrderId(); |
| | | |
| | | tjFlowingWater.setJxbz(jxbz); |
| | | tjFlowingWaterService.updateById(tjFlowingWater); |
| | | |
| | | TjProBl proBl=new TjProBl(); |
| | | proBl.setTjh(order.getTjNumber()); |
| | | proBl.setBldh(jxbz); |
| | | proBl.setBlsj(date); |
| | | proBl.setBlrdm(sysUser.getUserName()); |
| | | proBl.setBlrmc(sysUser.getNickName()); |
| | | proBl.setBlje(String.valueOf(tjFlowingWater.getPaidIn())); |
| | | blService.save(proBl); |
| | | |
| | | 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<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | |
| | | List<TjProject> projectList=new ArrayList<>(); |
| | | |
| | | for (String tjProId : tjProIds) { |
| | | TjProject project = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | | tjOrderRemark.setProName(project.getProName()); |
| | | tjOrderRemark.setDeptId(project.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); |
| | | 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.setProId(Long.valueOf(tjProId)); |
| | | detail.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(detail); |
| | | for (Long proId : proIds) { |
| | | // LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | // wqq.isNull(TbTransition::getTjNum); |
| | | TjProject project = projectService.getById(Long.valueOf(tjProId)); |
| | | if (null != project && project.getProParentId() == 0) { |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | | 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())); |
| | | tjOrderRemark.setJxbz(jxbz); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | |
| | | 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.setProId(Long.valueOf(tjProId)); |
| | | detail.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(dates); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(dates); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setJxbz(jxbz); |
| | | 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(proId); |
| | | 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())); |
| | | detail1.setJxbz(jxbz); |
| | | 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | 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(project.getSl()); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | } |
| | | } |
| | | |
| | | //检查 |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | 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(project.getSl()); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | } |
| | | } |
| | | |
| | | //处置 |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | 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(project.getSl()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } else { |
| | | // wqq.in(TbTransition::getProId, Arrays.asList(tjProIds)); |
| | | TjProject projects = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | if (null != projects) { |
| | | TjProject projectss = projectService.getById(projects.getProParentId()); |
| | | if (null != projectss && projectss.getProParentId()==0L) { |
| | | projectList.add(projectss); |
| | | } |
| | | } |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setTjStatus(0L); |
| | | detail.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail.setProId(Long.valueOf(tjProId)); |
| | | detail.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(dates); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(dates); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail); |
| | | |
| | | } |
| | | |
| | | // List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | List<TbTransition> tbTransitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(customer.getCusIdcard(),tjProId); |
| | | if (null != tbTransitionList && !tbTransitionList.isEmpty()) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | // transition.setJxbz(jxbz); |
| | | // transition.setTjNum(order.getTjNumber()); |
| | | // transition.setCardId(order.getCardId()); |
| | | // transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | // transitionService.updateById(transition); |
| | | transitionService.updateTbTransitionById(transition.getId().toString(),jxbz,order.getTjNumber(),order.getCardId(), |
| | | transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ArrayList<TjProject> jianChaProjects = new ArrayList<>(); |
| | | ArrayList<TjProject> jianYanProjects = new ArrayList<>(); |
| | | |
| | | if(!projectList.isEmpty()){ |
| | | 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())); |
| | | tjOrderRemark.setJxbz(jxbz); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | | detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail1.setProId(proId); |
| | | detail1.setProId(project.getProId()); |
| | | 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())); |
| | | 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())); |
| | | detail1.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail1); |
| | | } |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | wqq.in(TbTransition::getProId, proIds); |
| | | List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | transitionService.updateById(transition); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setProId(transition.getProId()); |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | //父项 |
| | | TjProject parentProject = projectService.getById(tjProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | if (null != project.getHisXmbm()) { |
| | | jianYanProjects.add(project); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | } |
| | | } |
| | | |
| | | //检查 |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | if (null != project.getHisXmbm()) { |
| | | jianChaProjects.add(project); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | } |
| | | } |
| | | |
| | | //处置 |
| | | // 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 (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | 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(project.getSl()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(null !=config && config.equals("Y")){ |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order)) { |
| | | List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser); |
| | | |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | }else { |
| | | //检验申请 |
| | | if(!detailsDtos.isEmpty()){ |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(order.getCardId()); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm("00029"); |
| | | dto.setMzksbm("0101"); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm("00029"); |
| | | dto.setCzyksbm("0101"); |
| | | dto.setSfjz("0"); |
| | | 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")) { |
| | | List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setSfjx("Y"); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dto.getHisRegistrationId()); |
| | | LambdaQueryWrapper<TjCustomer> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(TjCustomer::getCardId, tree.getCardId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wrapper4); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jysqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检验"); |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getHisXmbm, mxfyxmbm); |
| | | wrapper.eq(TjProject::getProParentId,0); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | String tj_price = ""; |
| | | for (TjProject project : list) { |
| | | tj_price += project.getProPrice() + "、"; |
| | | } |
| | | tree.setTjPrice(tj_price.substring(0, tj_price.length() - 1)); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | if(!detailsDtoss.isEmpty()){ |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(order.getCardId()); |
| | | outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | outpinexamapplyDto.setSqysbm("00029"); |
| | | outpinexamapplyDto.setMzksbm("0101"); |
| | | outpinexamapplyDto.setCzybm("00029"); |
| | | outpinexamapplyDto.setCzyksbm("0101"); |
| | | outpinexamapplyDto.setSfjz("0"); |
| | | 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")) { |
| | | List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setSfjx("Y"); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | LambdaQueryWrapper<TjCustomer> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(TjCustomer::getCardId, tree.getCardId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wrapper4); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检查"); |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getHisXmbm, mxfyxmbm); |
| | | wrapper.eq(TjProject::getProParentId,0); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | String tj_price = ""; |
| | | for (TjProject project : list) { |
| | | tj_price += project.getProPrice() + "、"; |
| | | } |
| | | tree.setTjPrice(tj_price.substring(0, tj_price.length() - 1)); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //药品申请 |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(order.getCardId()); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm("00029"); |
| | | dto1.setMzksbm("0101"); |
| | | dto1.setSjrq(date); |
| | | dto1.setCzybm("00029"); |
| | | dto1.setCzyksbm("0101"); |
| | | dto1.setCflxbm("A"); |
| | | dto1.setYfbm("1"); |
| | | dto1.setFyts("1"); |
| | | dto1.setMzzd(""); |
| | | 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"); |
| | | |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf=new TjCf(); |
| | | cf.setCardId(order.getCardId()); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm("00029"); |
| | | cf.setSqysxm("王健萍"); |
| | | cf.setMzksbn("0101"); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm("00029"); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | 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()); |
| | | cf.setJxbz(jxbz); |
| | | cfService.save(cf); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊治疗处置申请 |
| | | if(!detailDtos.isEmpty()){ |
| | | OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | dao.setHisRegistrationId(order.getCardId()); |
| | | dao.setSfzh(customer.getCusIdcard()); |
| | | dao.setSqysbm("00029"); |
| | | dao.setMzksbm("0101"); |
| | | dao.setSjrq(date); |
| | | dao.setCzybm("00029"); |
| | | dao.setCzyksbm("0101"); |
| | | dao.setSfjz("0"); |
| | | 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")) { |
| | | List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details1) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setSfjx("Y"); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dao.getHisRegistrationId()); |
| | | LambdaQueryWrapper<TjCustomer> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(TjCustomer::getCardId, tree.getCardId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wrapper4); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("zlczh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("处置"); |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getHisXmbm, mxfyxmbm); |
| | | wrapper.eq(TjProject::getProParentId,0); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | String tj_price = ""; |
| | | for (TjProject project : list) { |
| | | tj_price += project.getProPrice() + "、"; |
| | | } |
| | | tree.setTjPrice(tj_price.substring(0, tj_price.length() - 1)); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //父项耗材 |
| | | ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | for (TjConsumables tjConsumables : collect) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | // ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | // for (TjConsumables tjConsumables : collect) { |
| | | // TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | // tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | // tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | // tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | // tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | // tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setCreateTime(dates); |
| | | // tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setUpdateTime(dates); |
| | | // tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // chargingStandardService.save(tjChargingStandard); |
| | | // } |
| | | } |
| | | |
| | | private void pacsReg(TjOrder order, TjCustomer customer, ArrayList<TjProject> jianChaProjects) { |
| | | List<TjProject> projectList1 = jianChaProjects.stream().distinct().collect(Collectors.toList()); |
| | | JSONArray array = JSONUtil.createArray(); |
| | | ArrayList<SavePacsApply> successPacsList = new ArrayList<>(); |
| | | ArrayList<SavePacsApply> errorPacsList = new ArrayList<>(); |
| | | int allTotal = 0; |
| | | try { |
| | | allTotal = pacsApiMethodService.saveProjects(order, customer, projectList1, array, successPacsList, errorPacsList); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | for (Object object : array) { |
| | | JSONObject jsonObject = (JSONObject) object; |
| | | pacsApiMethodService.updatePacsApply(jsonObject.getStr("regNo"), jsonObject.getStr("cardId"), jsonObject.getStr("name")); |
| | | } |
| | | } |
| | | log.info("检查总计 ->{}个", allTotal); |
| | | if (!errorPacsList.isEmpty()) { |
| | | log.info("成功 ->{}", successPacsList); |
| | | log.error("失败 ->{}", errorPacsList); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void dockerSetCustomerLisByRedis(List<Long> ksproList, String ksId) { |
| | | |
| | | List<TjCustomer> yjAjaxResult = getYjAjaxResult(ksproList); |
| | | List<TjCustomer> wjAjaxResult = getWjAjaxResult(ksproList); |
| | | redisCache.setCacheMapValue(ksId + "ks", "wj",wjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "yj",yjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "wj", wjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "yj", yjAjaxResult); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void dockerSetYjCustomerByRedis(Long orderId, Long ksId) { |
| | | //已检(单个存入)0未检,1已检 |
| | | getDgYjAjaxResult(orderId, ksId); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void dockerSetWjCustomerByRedis(Long orderId, Long ksId) { |
| | | |
| | | //未检(单个存入)0未检,1已检 |
| | | getDgWjAjaxResult(orderId, ksId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void checkSetCustomerLisByRedis(String config) { |
| | | List<TjCustomer> wsResult = getWsResult(config); |
| | | List<TjCustomer> ysResult = getYsResult(config); |
| | | redisCache.setCacheMapValue("check", "ws",wsResult); |
| | | redisCache.setCacheMapValue("check", "ys",ysResult); |
| | | redisCache.setCacheMapValue("check", "ws", wsResult); |
| | | redisCache.setCacheMapValue("check", "ys", ysResult); |
| | | //查询 |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void wCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | public void wCScheckSetCustomerLisByRedis(List<TjOrder> orderList) { |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | redisCache.setCacheMapValue("cScheck", "ws",customerList); |
| | | redisCache.setCacheMapValue("cScheck", "ws", customerList); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void yCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | public void yCScheckSetCustomerLisByRedis(List<TjOrder> orderList) { |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | redisCache.setCacheMapValue("cScheck", "ys",customerList); |
| | | redisCache.setCacheMapValue("cScheck", "ys", customerList); |
| | | } |
| | | |
| | | |
| | |
| | | LambdaQueryWrapper<TjProject> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjProject::getProParentId, refundPro.getProId()); |
| | | List<Long> collect = projectService.list(wq0).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjSampling>wq1=new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum,tjNum); |
| | | wq1.in(TjSampling::getProId,collect); |
| | | LambdaQueryWrapper<TjSampling> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum, tjNum); |
| | | wq1.in(TjSampling::getProId, collect); |
| | | List<TjSampling> list = samplingService.list(wq1); |
| | | if(null !=list && list.size()>0) samplingService.removeByIds(list.stream().map(TjSampling::getId).collect(Collectors.toList())); |
| | | LambdaQueryWrapper<TjSampling>wq2=new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjSampling::getTjNum,tjNum); |
| | | wq2.eq(TjSampling::getProId,refundPro.getProId()); |
| | | if (null != list && list.size() > 0) |
| | | samplingService.removeByIds(list.stream().map(TjSampling::getId).collect(Collectors.toList())); |
| | | LambdaQueryWrapper<TjSampling> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjSampling::getTjNum, tjNum); |
| | | wq2.eq(TjSampling::getProId, refundPro.getProId()); |
| | | samplingService.remove(wq2); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId"+tjNum, String.valueOf(refundPro.getProId())); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId" + tjNum, String.valueOf(refundPro.getProId())); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveSampling() { |
| | | redisCache.setCacheMapValue("sampling", "yqs",getYWqsResult(0)); |
| | | redisCache.setCacheMapValue("sampling", "wqs",getYWqsResult(1)); |
| | | redisCache.setCacheMapValue("sampling", "yqs", getYWqsResult(0)); |
| | | redisCache.setCacheMapValue("sampling", "wqs", getYWqsResult(1)); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void tjGoutAsync(List<QjDomainVo> domainVos, SysUser sysUser, Set<String> list) { |
| | | Integer day = 0; |
| | | for (QjDomainVo domainVo : domainVos) { |
| | | day = domainVo.getDay(); |
| | | TjOrderRemark remark = orderRemarkService.getById(domainVo.getRemarkId()); |
| | | TjOrder order = orderService.getOrderByTjNum(domainVo.getTjNumber()); |
| | | //给弃检表添加记录 |
| | | if(domainVo.getType().equals(2)){ |
| | | if (domainVo.getType().equals(2)) { |
| | | TjDiscardInspection td = new TjDiscardInspection(); |
| | | td.setProId(String.valueOf(remark.getProId())); |
| | | td.setProName(projectService.selectTjProjectByProId(remark.getProId()).getProName()); |
| | |
| | | td.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | td.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | discardInspectionService.save(td); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId"+domainVo.getTjNumber(),String.valueOf(remark.getProId())); |
| | | redisCache.deleteCacheMapValue("getOrderDetailByProParentId" + domainVo.getTjNumber(), String.valueOf(remark.getProId())); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjProject>wq1=new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProParentId,remark.getProId()); |
| | | LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProParentId, remark.getProId()); |
| | | wq1.eq(TjProject::getNeedReport, "Y"); |
| | | List<TjProject> projectList = projectService.list(wq1); |
| | | if(null !=projectList && projectList.size()>0){ |
| | | if (null != projectList && projectList.size() > 0) { |
| | | List<Long> collect = projectList.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjOrderDetail>wq2=new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | wq2.in(TjOrderDetail::getProId,collect); |
| | | LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | wq2.in(TjOrderDetail::getProId, collect); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq2); |
| | | if(null !=detailList && detailList.size()>0){ |
| | | if (null != detailList && detailList.size() > 0) { |
| | | for (TjOrderDetail detail : detailList) { |
| | | detail.setTjStatus(Long.valueOf(remark.getType())); |
| | | if(null !=remark.getRemark()) detail.setRemark(domainVo.getRemark()); |
| | | if(null !=remark.getYqDeadline()) detail.setYqDeadline(remark.getYqDeadline()); |
| | | if (null != remark.getRemark()) detail.setRemark(domainVo.getRemark()); |
| | | if (null != remark.getYqDeadline()) detail.setYqDeadline(remark.getYqDeadline()); |
| | | tjOrderDetailService.updateById(detail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (list.size() > 0) { |
| | | Date date = new Date(); |
| | | for (String s : list) { |
| | | TjOrder tjOrder = orderService.getOrderByTjNum(s); |
| | | if (null != tjOrder) { |
| | | tjOrder.setStatus(TjConstants.TJ_DELAY); |
| | | tjOrder.setFinishTime(null); |
| | | tjOrder.setUpdateBy(sysUser.getNickName()); |
| | | tjOrder.setUpdateTime(new DateTime()); |
| | | tjOrder.setUpdateTime(date); |
| | | tjOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderService.updateById(tjOrder); |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | TjYqOrder yqOrder=new TjYqOrder(); |
| | | TjYqOrder yqOrder = new TjYqOrder(); |
| | | yqOrder.setTjNum(s); |
| | | yqOrder.setCusName(customer.getCusName()); |
| | | yqOrder.setSex(String.valueOf(customer.getCusSex())); |
| | | yqOrder.setAge(customer.getAge()); |
| | | yqOrder.setPhone(customer.getCusPhone()); |
| | | yqOrder.setYqTime(new Date()); |
| | | yqOrder.setYqTime(DateUtil.offsetDay(date, day)); |
| | | yqOrder.setOrderTime(tjOrder.getCreateTime()); |
| | | yqOrder.setProIds(orderRemarkService.getTjOrderRemarkProIdList(s)); |
| | | yqOrder.setEmilSend("0"); |
| | | yqOrder.setMsgSend("0"); |
| | | yqOrder.setCreateBy(sysUser.getNickName()); |
| | | yqOrder.setCreateTime(new DateTime()); |
| | | yqOrder.setCreateTime(date); |
| | | yqOrder.setUpdateBy(sysUser.getNickName()); |
| | | yqOrder.setUpdateTime(new DateTime()); |
| | | yqOrder.setUpdateTime(date); |
| | | yqOrder.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | yqOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | yqOrderService.save(yqOrder); |
| | |
| | | for (TjPackageProject tjPackageProject : ppList) { |
| | | TjProject project = projectService.getById(tjPackageProject.getProId()); |
| | | if (null != project) { |
| | | BigDecimal divide = tjPackageProject.getPriceNow().divide(project.getProPrice(),5, RoundingMode.DOWN); |
| | | BigDecimal divide = tjPackageProject.getPriceNow().divide(project.getProPrice(), 5, RoundingMode.DOWN); |
| | | LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjProject::getProParentId, project.getProId()); |
| | | List<TjProject> tjProSonList = projectService.list(wq2); |
| | |
| | | tbTransition.setPacId(pacId); |
| | | |
| | | if (null != tjPackageProject.getPriceNow() && divide.compareTo(BigDecimal.valueOf(0)) > 0) { |
| | | tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2, RoundingMode.HALF_DOWN)); |
| | | tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2, RoundingMode.HALF_DOWN)); |
| | | } else { |
| | | tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveRedisTransitionByPacId(String cusId, Long pacId,List<Long> proIds) { |
| | | if(null != pacId){ |
| | | transitionService.saveRedisTransitionByPacId(cusId,pacId); |
| | | public void saveRedisTransitionByPacId(String cusId,String cardId, Long pacId, List<Long> proIds) { |
| | | if (null != pacId) { |
| | | transitionService.saveRedisTransitionByPacId(cusId,cardId ,pacId); |
| | | } |
| | | if(null != proIds && proIds.size() > 0){ |
| | | saveRedisTransitionByProId(cusId,proIds); |
| | | if (null != proIds && proIds.size() > 0) { |
| | | saveRedisTransitionByProId(cusId,cardId, proIds); |
| | | } |
| | | } |
| | | |
| | |
| | | getTjPackageListByWoMan(tjPackageService.getTjPackageListByWoMan()); |
| | | |
| | | //未知 |
| | | getTjPackageListByManAndWoMan(tjPackageService.list(new LambdaQueryWrapper<TjPackage>().eq(TjPackage::getPacStatus,0))); |
| | | getTjPackageListByManAndWoMan(tjPackageService.list(new LambdaQueryWrapper<TjPackage>().eq(TjPackage::getPacStatus, 0))); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void addNewReservationConfirm(List<TjReservation> rightList ) { |
| | | if(null !=rightList && rightList.size()>0){ |
| | | public void addNewReservationConfirm(List<TjReservation> rightList) { |
| | | if (null != rightList && rightList.size() > 0) { |
| | | for (TjReservation reservation : rightList) { |
| | | transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | List<AddNewReservationConfirm> confirmList = groupingProService.getAddNewReservationConfirm(reservation.getGroupingId()); |
| | | if (null !=confirmList && confirmList.size()>0){ |
| | | if (null != confirmList && confirmList.size() > 0) { |
| | | for (AddNewReservationConfirm confirm : confirmList) { |
| | | List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(reservation.getIdCard(),confirm.getPid()); |
| | | List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(reservation.getIdCard(), confirm.getPid()); |
| | | if (null != transitionss && transitionss.size() > 0) { |
| | | continue; |
| | | } |
| | |
| | | @Override |
| | | @Async("async") |
| | | public void saveNewReservationConfirm(List<TjReservation> rightList) { |
| | | if(null !=rightList && rightList.size()>0){ |
| | | if (null != rightList && rightList.size() > 0) { |
| | | //创建线程池 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(rightList.size()); |
| | | for (TjReservation reservation : rightList) { |
| | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(),reservation.getGroupingId()); |
| | | transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(), reservation.getGroupingId()); |
| | | |
| | | threadPool.shutdown(); |
| | | } catch (Exception e) { |
| | |
| | | @Override |
| | | @Async("async") |
| | | public void updateCheckType(String tjNum) { |
| | | redisCache.setCacheMapValue("updateCheckType"+tjNum,tjNum,getAjaxResult(tjNum)); |
| | | redisCache.setHashKeyExpireTime("updateCheckType"+tjNum,7L, TimeUnit.DAYS); |
| | | redisCache.setCacheMapValue("updateCheckType" + tjNum, tjNum, getAjaxResult(tjNum)); |
| | | redisCache.setHashKeyExpireTime("updateCheckType" + tjNum, 7L, TimeUnit.DAYS); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getPrintOrderList(List<TjOrder> list) { |
| | | |
| | | redisCache.setCacheMapValue("getPrintOrderList","0",extracted(0, list)); |
| | | redisCache.setCacheMapValue("getPrintOrderList","1",extracted(1, list)); |
| | | redisCache.setCacheMapValue("getPrintOrderList", "0", extracted(0, list)); |
| | | redisCache.setCacheMapValue("getPrintOrderList", "1", extracted(1, list)); |
| | | |
| | | } |
| | | |
| | |
| | | @Async("async") |
| | | public void getDictSfxms() { |
| | | List<DictSfxm> dictSfxm = getDictSfxm(); |
| | | redisCache.setCacheObject("getDictSfxms",dictSfxm); |
| | | redisCache.setCacheObject("getDictSfxms", dictSfxm); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getOrderDetailByProParentId(String tjNumber,Map<String, Object> map,String proParentId) { |
| | | if(null !=map && !map.isEmpty()){ |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId"+tjNumber,proParentId,map); |
| | | }else { |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId"+tjNumber,proParentId,getOrderDetailByProParentId(proParentId,tjNumber)); |
| | | public void getOrderDetailByProParentId(String tjNumber, Map<String, Object> map, String proParentId) { |
| | | if (null != map && !map.isEmpty()) { |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + tjNumber, proParentId, map); |
| | | } else { |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + tjNumber, proParentId, getOrderDetailByProParentId(proParentId, tjNumber)); |
| | | } |
| | | redisCache.setHashKeyExpireTime("getOrderDetailByProParentId"+tjNumber,7L,TimeUnit.DAYS); |
| | | redisCache.setHashKeyExpireTime("getOrderDetailByProParentId" + tjNumber, 7L, TimeUnit.DAYS); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getLineChart() { |
| | | redisCache.setCacheObject("getLineChart", getLineCharts()); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getPieChart() { |
| | | redisCache.setCacheObject("getPieChart", getPieCharts()); |
| | | } |
| | | |
| | | @Override |
| | | public void addTjChargingStandard(TjOrder order, List<TbTransition> tbTransitionList, SysUser sysUser) { |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | for (TbTransition transition : tbTransitionList) { |
| | | |
| | | if (transition.getNowPrice().compareTo(BigDecimal.valueOf(0)) == 0) { |
| | | continue; |
| | | } |
| | | |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setProId(transition.getProId()); |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | |
| | | //父项 |
| | | ArrayList<TbTransition> collect1 = tbTransitionList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TbTransition::getParentProId))), ArrayList::new)); |
| | | List<Long> parentProIds = collect1.stream().map(TbTransition::getParentProId).collect(Collectors.toList()); |
| | | if (parentProIds.size() > 0) { |
| | | for (Long parentProId : parentProIds) { |
| | | TjProject parentProject = projectService.selectTjProjectByProId(parentProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | for (TjConsumables tjConsumables : collect) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, detailList.size() > 0, order, sysUser); |
| | | } |
| | | |
| | | //首页饼状图登记人数接口 |
| | | private AjaxResult getPieCharts() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | Date date=new Date(); |
| | | |
| | | //获取体检登记数 |
| | | LambdaQueryWrapper<TjOrder> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.between(TjOrder::getCreateTime,DateUtil.offsetMonth(date,-1),date); |
| | | List<TjOrder> orderCountList = orderService.list(wq0); |
| | | if (null != orderCountList && !orderCountList.isEmpty()) { |
| | | List<PieChartVo> pieChartVoList = getTjorderCountMap(orderCountList); |
| | | map.put("tjdj", pieChartVoList); |
| | | } else { |
| | | map.put("tjdj", 0); |
| | | } |
| | | //获取体检异常数 |
| | | LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.between(TjOrder::getCreateTime,DateUtil.offsetMonth(date,-1),date); |
| | | // wq1.isNotNull(TjOrder::getFinishTime); |
| | | // wq1.eq(TjOrder::getCheckStatus, 1); |
| | | List<TjOrder> orderList = orderService.list(wq1); |
| | | if (null !=orderList && !orderList.isEmpty()) { |
| | | // List<TjOrder> orderList = orderAbnormalCountList.stream().distinct().collect(Collectors.toList()); |
| | | List<PieChartVo> pieChartVoList = getTjorderAbnormalCountMap(orderList); |
| | | map.put("tjyc", pieChartVoList); |
| | | } else { |
| | | map.put("tjyc", 0); |
| | | } |
| | | |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | //首页折线图数据 |
| | | private AjaxResult getLineCharts() { |
| | | // List<Map<Object, Object>> line = orderService.getLine(); |
| | | List<LineChartsVo> line = orderService.getLine(); |
| | | Collections.reverse(line); |
| | | return AjaxResult.success("折线图数据", line); |
| | | } |
| | | |
| | | |
| | | //获取体检登记数 |
| | | private List<PieChartVo> getTjorderCountMap(List<TjOrder> orderList) { |
| | | int a = 0; |
| | | int b = 0; |
| | | int c = 0; |
| | | int d = 0; |
| | | int e = 0; |
| | | Map<String, Object> map = null; |
| | | for (TjOrder tjOrder : orderList) { |
| | | map = new HashMap<>(); |
| | | TjCustomer customer = tjCustomerService.getById(tjOrder.getUserId()); |
| | | if (null != customer) { |
| | | int age = DateUtil.ageOfNow(customer.getCusBrithday()); |
| | | if (age >= 0 && age <= 3) { |
| | | a += 1; |
| | | } else if (age > 3 && age <= 16) { |
| | | b += 1; |
| | | } else if (age > 16 && age <= 40) { |
| | | c += 1; |
| | | } else if (age > 40 && age <= 60) { |
| | | d += 1; |
| | | } else { |
| | | e += 1; |
| | | } |
| | | } |
| | | map.put("0-3岁", a); |
| | | map.put("3-16岁", b); |
| | | map.put("16-40岁", c); |
| | | map.put("40-60岁", d); |
| | | map.put("60岁以上", e); |
| | | } |
| | | List<PieChartVo> pieChartVoList = new ArrayList<>(); |
| | | assert map != null; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | PieChartVo pieChartVo = new PieChartVo(); |
| | | pieChartVo.setName(entry.getKey()); |
| | | pieChartVo.setCount((Integer) entry.getValue()); |
| | | pieChartVoList.add(pieChartVo); |
| | | } |
| | | return pieChartVoList; |
| | | } |
| | | |
| | | //获取体检异常数 |
| | | private List<PieChartVo> getTjorderAbnormalCountMap(List<TjOrder> orderList) { |
| | | int a = 0; |
| | | int b = 0; |
| | | int c = 0; |
| | | int d = 0; |
| | | int e = 0; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | for (TjOrder tjOrder : orderList) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | wq.eq(TjOrderDetail::getExceptionDesc, 1); |
| | | List<TjOrderDetail> list = tjOrderDetailService.list(wq); |
| | | int count = hysqdService.getHyYcXmCount(tjOrder.getCardId()); |
| | | if ((null != list && !list.isEmpty()) || (count>0)) { |
| | | TjCustomer customer = tjCustomerService.getById(tjOrder.getUserId()); |
| | | if (null != customer) { |
| | | int age = DateUtil.ageOfNow(customer.getCusBrithday()); |
| | | if (age >= 0 && age <= 3) { |
| | | a += 1; |
| | | } else if (age > 3 && age <= 16) { |
| | | b += 1; |
| | | } else if (age > 16 && age <= 40) { |
| | | c += 1; |
| | | } else if (age > 40 && age <= 60) { |
| | | d += 1; |
| | | } else { |
| | | e += 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | map.put("0-3岁", a); |
| | | map.put("3-16岁", b); |
| | | map.put("16-40岁", c); |
| | | map.put("40-60岁", d); |
| | | map.put("60岁以上", e); |
| | | List<PieChartVo> pieChartVoList = new ArrayList<>(); |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | PieChartVo pieChartVo = new PieChartVo(); |
| | | pieChartVo.setName(entry.getKey()); |
| | | pieChartVo.setCount((Integer) entry.getValue()); |
| | | pieChartVoList.add(pieChartVo); |
| | | } |
| | | return pieChartVoList; |
| | | } |
| | | |
| | | private List<DictSfxm> getDictSfxm() { |
| | |
| | | } |
| | | return dictSfxms; |
| | | } |
| | | |
| | | private List<TjOrder> extracted(Integer type, List<TjOrder> list) { |
| | | List<TjOrder> list1=new ArrayList<>(); |
| | | List<TjOrder> list1 = new ArrayList<>(); |
| | | for (TjOrder order : list) { |
| | | TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setGrMoBanId(reportService.getGrMoBanIds()); |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | if (null != tjCustomer.getCusPhone()) |
| | | order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if (null != tjCustomer.getCusIdcard()) |
| | | order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | } |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != compService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { |
| | |
| | | } |
| | | return list1; |
| | | } |
| | | |
| | | private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByMan"); |
| | | if (redisCache.hasKey("getTjPackageListBySex")) { |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex", "getTjPackageListByMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByMan",tjPackageList); |
| | | redisCache.setCacheMapValue("getTjPackageListBySex", "getTjPackageListByMan", tjPackageList); |
| | | } |
| | | } |
| | | |
| | | private void getTjPackageListByWoMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan"); |
| | | if (redisCache.hasKey("getTjPackageListBySex")) { |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex", "getTjPackageListByWoMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan",tjPackageList); |
| | | redisCache.setCacheMapValue("getTjPackageListBySex", "getTjPackageListByWoMan", tjPackageList); |
| | | } |
| | | } |
| | | |
| | | private void getTjPackageListByManAndWoMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan"); |
| | | if (redisCache.hasKey("getTjPackageListBySex")) { |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex", "getTjPackageListByManAndWoMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan",tjPackageList); |
| | | redisCache.setCacheMapValue("getTjPackageListBySex", "getTjPackageListByManAndWoMan", tjPackageList); |
| | | } |
| | | } |
| | | //已检 |
| | | |
| | | //已检(整体存入) |
| | | public List<TjCustomer> getYjAjaxResult(List<Long> ksproList) { |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | | LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | |
| | | () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | for (Long orderId : orderIds) { |
| | | |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | if (null == order) { |
| | | continue; |
| | | } |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | |
| | | |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : lists) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive() == 1) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setTjStatus(1L); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customer.setTjCategory(order.getTjCategory()); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0,3); |
| | | wq.in(TjOrderRemark::getType, 0, 3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | customerLis.add(customer); |
| | | } |
| | |
| | | } |
| | | return customerLis; |
| | | } |
| | | //未检 |
| | | |
| | | //未检(整体存入) |
| | | public List<TjCustomer> getWjAjaxResult(List<Long> ksproList) { |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | | LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | |
| | | () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | for (Long orderId : orderIds) { |
| | | // for (Long aLong : ksproList) { |
| | | // getDgWjAjaxResult(orderId,aLong); |
| | | // } |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | if (null == order) { |
| | | continue; |
| | | } |
| | | |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | |
| | | if (null != customer) { |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | if (null != lists) { |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : lists) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive() == 1) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customer.setTjCategory(order.getTjCategory()); |
| | | customer.setTjStatus(0L); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0,3); |
| | | wq.in(TjOrderRemark::getType, 0, 3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | if (null != byId) { |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | |
| | | customerLis.add(customer); |
| | | } |
| | | } |
| | |
| | | } |
| | | return customerLis; |
| | | } |
| | | |
| | | //已检(单个存入)0未检,1已检 |
| | | public void getDgYjAjaxResult(Long orderId, Long ksId) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if (null != order) { |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | qww.eq(TjOrderDetail::getTjStatus, 0); |
| | | qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | if (null == lists || lists.size() == 0) { |
| | | redisCache.deleteCacheMapValue("ks" + ksId + customer.getCusId(), "1"); |
| | | redisCache.setCacheMapValue("ks:" + ksId + ":" + customer.getCusId(), "0", customer); |
| | | } |
| | | if (null != customer) { |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : lists) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive() == 1) { |
| | | break; |
| | | } |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setTjStatus(1L); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customer.setTjCategory(order.getTjCategory()); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0, 3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | redisCache.setCacheMapValue("ks:" + ksId + ":" + customer.getCusId(), "1", customer); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //未检(单个存入)0未检,1已检 |
| | | public void getDgWjAjaxResult(Long orderId, Long ksId) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if (null == order) { |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | if (null != lists) { |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : lists) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive() == 1) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customer.setTjCategory(order.getTjCategory()); |
| | | customer.setTjStatus(0L); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0, 3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | // redisCache.setCacheMapValue("ks"+ksId+":"+customer.getCusId(),"1",customer); |
| | | redisCache.setCacheMapValue("ks" + ksId + ":" + customer.getCusId(), "0", customer); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //已审 |
| | | private List<TjCustomer> getYsResult(String config) { |
| | | List<TjOrder> orderList = null; |
| | | if("Y".equals(config)){ |
| | | orderList = orderService.getCsTjOrderList1(null,1,null,null,null); |
| | | }else { |
| | | orderList = orderService.getTjOrderList(null,1,null,null,null); |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(null, 1, null, null, null); |
| | | } else { |
| | | orderList = orderService.getTjOrderList(null, 1, null, null, null); |
| | | } |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | customer.setTjCategory(tjOrder.getTjCategory()); |
| | | if (tjOrder.getFirmId() == null) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | |
| | | } |
| | | return customerList; |
| | | } |
| | | |
| | | //未审 |
| | | private List<TjCustomer> getWsResult(String config) { |
| | | List<TjOrder> orderList = null; |
| | | if("Y".equals(config)){ |
| | | orderList = orderService.getCsTjOrderList1(null,0,null,null,null); |
| | | }else { |
| | | orderList = orderService.getTjOrderList(null,0,null,null,null); |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(null, 0, null, null, null); |
| | | } else { |
| | | orderList = orderService.getTjOrderList(null, 0, null, null, null); |
| | | } |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0) { |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | customer.setTjCategory(tjOrder.getTjCategory()); |
| | | if (tjOrder.getFirmId() == null) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | |
| | | } |
| | | 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<>(); |
| | |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | final TjProject byId = projectService.selectTjProjectByProId(tjOrderDetail.getProId()); |
| | | if(null==byId){ |
| | | tjOrderDetailService.removeById(tjOrderDetail.getOrderDetailId()); |
| | | }else { |
| | | tjOrderDetail.setProject(byId); |
| | | if (null == byId) { |
| | | tjOrderDetailService.removeById(tjOrderDetail.getOrderDetailId()); |
| | | } else { |
| | | tjOrderDetail.setProject(byId); |
| | | } |
| | | List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId())); |
| | | if (list2.size() == 0) { |
| | |
| | | tjOrderDetail.setStandard(list2.get(0)); |
| | | } else { |
| | | final int ageType = StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday())); |
| | | TjStandard tjStandard1=tjStandardService.getListBySexAndType(customer.getCusSex(),ageType, String.valueOf(tjOrderDetail.getProId())); |
| | | TjStandard tjStandard1 = tjStandardService.getListBySexAndType(customer.getCusSex(), ageType, String.valueOf(tjOrderDetail.getProId())); |
| | | tjOrderDetail.setStandard(tjStandard1); |
| | | } |
| | | } |
| | | String summary = remark.getSummary(); |
| | | if (null != summary) { |
| | | String[] split = summary.split(";"); |
| | | parent.put("parentAdvice", tjAdviceService.getAdviceStringByIds(Arrays.asList(split))); |
| | | |
| | | // List<Long> longList = new ArrayList<>(); |
| | | // for (String str : split) { |
| | | // if(!"".equals(str)){ |
| | | // longList.add(Long.valueOf(str)); |
| | | // } |
| | | // } |
| | | parent.put("parentAdvice", tjAdviceService.getAdviceStringByIds(split)); |
| | | } else { |
| | | parent.put("parentAdvice", null); |
| | | } |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | //已签收/未签收 |
| | | private List<Map<String, Object>> getYWqsResult(int a) { |
| | | LambdaQueryWrapper<TjSampling>wq=new LambdaQueryWrapper<>(); |
| | | List<Map<String,Object>> arrayList=new ArrayList<>(); |
| | | private List<Map<String, Object>> getYWqsResult(int a) { |
| | | LambdaQueryWrapper<TjSampling> wq = new LambdaQueryWrapper<>(); |
| | | List<Map<String, Object>> arrayList = new ArrayList<>(); |
| | | wq.orderByDesc(TjSampling::getApplicationTime); |
| | | wq.eq(TjSampling::getIsSignFor,a); |
| | | wq.eq(TjSampling::getIsSignFor, a); |
| | | List<TjSampling> list = tjSamplingService.list(wq); |
| | | if(null != list && list.size()>0 ){ |
| | | if (null != list && list.size() > 0) { |
| | | Map<String, List<TjSampling>> stringListMap = list.stream().collect(Collectors.groupingBy(TjSampling::getCusId)); |
| | | for (Map.Entry<String, List<TjSampling>> entry : stringListMap.entrySet()) { |
| | | Map<String,Object>map=new HashMap<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | TjCustomer customer = tjCustomerService.getById(entry.getKey()); |
| | | if (customer==null){ |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(entry.getValue().get(0).getTjNum()); |
| | | customer.setApplicationTime(entry.getValue().get(0).getApplicationTime()); |
| | | |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if(null !=samplings && samplings.size()>0){ |
| | | List<TjSampling> projectList=new ArrayList<>(); |
| | | if (null != samplings && samplings.size() > 0) { |
| | | List<TjSampling> projectList = new ArrayList<>(); |
| | | for (TjSampling sampling : samplings) { |
| | | TjProject project = projectService.getById(sampling.getProId()); |
| | | if(null !=project && project.getProParentId()==0){ |
| | | if (null != project && project.getProParentId() == 0) { |
| | | projectList.add(sampling); |
| | | } |
| | | } |
| | | map.put("list",projectList); |
| | | map.put("list", projectList); |
| | | } |
| | | map.put("customer",customer); |
| | | map.put("customer", customer); |
| | | arrayList.add(map); |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | /** |
| | | * 隐藏手机号 |
| | | * |
| | | * @param phoneNum |
| | | * @return |
| | | */ |
| | | public static String hidePhoneNum(String phoneNum){ |
| | | if(null==phoneNum){ |
| | | public static String hidePhoneNum(String phoneNum) { |
| | | if (null == phoneNum) { |
| | | return ""; |
| | | } |
| | | if(phoneNum.contains("*")){ |
| | | if (phoneNum.contains("*")) { |
| | | return phoneNum; |
| | | } |
| | | Pattern pattern = Pattern.compile("((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}"); |
| | | Matcher matcher = pattern.matcher(phoneNum); |
| | | StringBuffer sb = new StringBuffer(); |
| | | try { |
| | | while(matcher.find()) { |
| | | while (matcher.find()) { |
| | | String phoneStr = matcher.group(); |
| | | phoneStr = phoneStr.substring(0, 3) + "****" + phoneStr.substring(7, phoneStr.length()); |
| | | matcher.appendReplacement(sb,phoneStr); |
| | | matcher.appendReplacement(sb, phoneStr); |
| | | } |
| | | matcher.appendTail(sb); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 隐藏身份证号码 |
| | | * |
| | | * @param idCardNum |
| | | * @return |
| | | */ |
| | | public static String hideIdCardNum(String idCardNum){ |
| | | if(null==idCardNum){ |
| | | public static String hideIdCardNum(String idCardNum) { |
| | | if (null == idCardNum) { |
| | | return ""; |
| | | } |
| | | if(idCardNum.contains("*")){ |
| | | if (idCardNum.contains("*")) { |
| | | return idCardNum; |
| | | } |
| | | Pattern pattern = Pattern.compile("(\\d{6})(19|20)(\\d{2})(1[0-2]|0[1-9])(0[1-9]|[1-2][0-9]|3[0-1])(\\d{3})(\\d|X|x)"); |
| | | Matcher matcher = pattern.matcher(idCardNum); |
| | | StringBuffer sb = new StringBuffer(); |
| | | try { |
| | | while(matcher.find()) { |
| | | while (matcher.find()) { |
| | | String idCardStr = matcher.group(); |
| | | int len=idCardStr.length(); |
| | | if(len>=9){ |
| | | idCardStr = idCardStr.replaceAll("(.{"+(len<12?3:6)+"})(.*)(.{4})", "$1" + "****" + "$3"); |
| | | int len = idCardStr.length(); |
| | | if (len >= 9) { |
| | | idCardStr = idCardStr.replaceAll("(.{" + (len < 12 ? 3 : 6) + "})(.*)(.{4})", "$1" + "****" + "$3"); |
| | | } |
| | | matcher.appendReplacement(sb,idCardStr); |
| | | matcher.appendReplacement(sb, idCardStr); |
| | | } |
| | | matcher.appendTail(sb); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 隐藏用户姓名 |
| | | * |
| | | * @param cusName |
| | | * @return |
| | | */ |
| | | public static String hideCusName(String cusName){ |
| | | if(null==cusName){ |
| | | public static String hideCusName(String cusName) { |
| | | if (null == cusName) { |
| | | return ""; |
| | | } |
| | | if(!cusName.contains("*")){ |
| | | String realname=null; |
| | | char[] r = cusName.toCharArray(); |
| | | if(r.length ==1){ |
| | | realname = cusName; |
| | | if (!cusName.contains("*")) { |
| | | String realname = null; |
| | | char[] r = cusName.toCharArray(); |
| | | if (r.length == 1) { |
| | | realname = cusName; |
| | | } |
| | | if(r.length == 2){ |
| | | realname = cusName.replaceFirst(cusName.substring(1),"*"); |
| | | if (r.length == 2) { |
| | | realname = cusName.replaceFirst(cusName.substring(1), "*"); |
| | | } |
| | | if (r.length > 2) { |
| | | realname = cusName.replaceFirst(cusName.substring(1,r.length-1) ,"*"); |
| | | realname = cusName.replaceFirst(cusName.substring(1, r.length - 1), "*"); |
| | | } |
| | | return realname; |
| | | } |
| | | return cusName; |
| | | } |
| | | |
| | | //临时表添加单项 |
| | | public void saveRedisTransitionByProId(String cusId, List<Long> proIds) { |
| | | public void saveRedisTransitionByProId(String cusId,String cardId, List<Long> proIds) { |
| | | for (Long proId : proIds) { |
| | | List<TbTransition> transitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)); |
| | | if (null != transitionList && transitionList.size() > 0) { |
| | | continue; |
| | | TjProject project = projectService.selectTjProjectByProId(proId); |
| | | if(null !=project){ //&& (!project.getProName().contains("静脉采血")|| !project.getProName().contains("费")) |
| | | List<TbTransition> transitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)); |
| | | if (null == transitionList || transitionList.size() == 0) { |
| | | transitionService.saveRedisTransitionByProId(cusId,cardId, proId); |
| | | } |
| | | } |
| | | transitionService.saveRedisTransitionByProId(cusId,proId); |
| | | // if(null !=project) transitionService.saveRedisTransitionByProId(cusId,cardId, proId); |
| | | } |
| | | } |
| | | |
| | | //向缓存中添加 父项目的子项目详情 |
| | | private Map<String, Object> getOrderDetailByProParentId(String proParentId, String tjNumber) { |
| | | TjOrderRemark remark = orderRemarkService.getTjOrderRemarkByTjNumAndProParentId(tjNumber, proParentId); |
| | |
| | | List<TjAdvice> adviceList = new ArrayList<>(); |
| | | if (null != remark) { |
| | | String[] strings = StringUtils.split(remark.getSummary(), ";"); |
| | | if(null !=strings && strings.length>0){ |
| | | if (null != strings && strings.length > 0) { |
| | | List<TjAdvice> list = tjAdviceService.getAdviceStringByIds(strings); |
| | | adviceList.addAll(list); |
| | | } |