zjh
2024-07-29 ac1d836efbd5f5c8707ed0bf33b4631025d165c6
ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
@@ -3,6 +3,7 @@
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;
@@ -13,10 +14,7 @@
import com.ltkj.common.utils.StringUtils;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.hisDto.OutpinexamapplyDto;
import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto;
import com.ltkj.hosp.hisDto.OutpintestapplyDto;
import com.ltkj.hosp.hisDto.OutpintreatapplyDto;
import com.ltkj.hosp.hisDto.*;
import com.ltkj.hosp.service.*;
import com.ltkj.hosp.vodomain.AddNewReservationConfirm;
import com.ltkj.hosp.vodomain.LineChartsVo;
@@ -24,6 +22,7 @@
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.controller.his.HisApiGetMethodService;
import com.ltkj.web.controller.his.HisApiMethodService;
@@ -122,6 +121,14 @@
    private LtkjEjjfxmzdService ltkjEjjfxmzdService;
    @Autowired
    private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService;
    @Autowired
    private TjProBlService blService;
    @Resource
    private ITjFlowingWaterService tjFlowingWaterService;
    @Resource
    private ISysDeptService deptService;
    @Autowired
    private TjCfService cfService;
    @Override
    public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) {
@@ -497,6 +504,21 @@
    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);
        List<TjConsumables> list2 = new ArrayList<>();
        String[] tjProIds = tjFlowingWater.getTjProIds();
@@ -512,6 +534,7 @@
        //处置
        List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>();
        List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>();
        List<TjProject>  projectList=new ArrayList<>();
@@ -531,6 +554,7 @@
                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());
@@ -546,6 +570,7 @@
                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();
@@ -554,19 +579,21 @@
//                    detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber()));
                    detail1.setProId(proId);
                    detail1.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()));
                    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 && (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());
@@ -578,14 +605,40 @@
                        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 &&
//                        (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());
@@ -597,14 +650,40 @@
                        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 &&
//                        (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());
@@ -616,6 +695,31 @@
                        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);
                        }
                }
            }
@@ -643,6 +747,7 @@
                detail.setUpdateTime(dates);
                detail.setCreateId(String.valueOf(sysUser.getUserId()));
                detail.setUpdateId(String.valueOf(sysUser.getUserId()));
                detail.setJxbz(jxbz);
                tjOrderDetailService.save(detail);
            }
@@ -650,56 +755,58 @@
            List<TbTransition> tbTransitionList = transitionService.list(wqq);
            if (null != tbTransitionList && tbTransitionList.size() > 0) {
                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);
                    TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId());
//                    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(dates);
                        tjChargingStandard.setUpdateBy(sysUser.getNickName());
                        tjChargingStandard.setUpdateTime(dates);
                        tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId()));
                        tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId()));
                        chargingStandardService.save(tjChargingStandard);
                    }
//                    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(dates);
//                        tjChargingStandard.setUpdateBy(sysUser.getNickName());
//                        tjChargingStandard.setUpdateTime(dates);
//                        tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId()));
//                        tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId()));
//                        chargingStandardService.save(tjChargingStandard);
//                    }
                }
                //父项
                TjProject parentProject = projectService.selectTjProjectByProId(Long.valueOf(tjProId));
                if (null != parentProject && parentProject.getProParentId() == 0) {
                    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);
                        }
                    }
                } else {
                    TjProject parentProjects = projectService.getById(tjProId);
                    if (null != parentProjects) {
                        LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>();
                        wqqq.eq(TjProConsumables::getProId, parentProjects.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);
                            }
                        }
                    }
                }
//
//                TjProject parentProject = projectService.selectTjProjectByProId(Long.valueOf(tjProId));
//                if (null != parentProject && parentProject.getProParentId() == 0) {
//                    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);
//                        }
//                    }
//
//                } else {
//                    TjProject parentProjects = projectService.getById(tjProId);
//                    if (null != parentProjects) {
//                        LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>();
//                        wqqq.eq(TjProConsumables::getProId, parentProjects.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(projectList.size()>0){
@@ -716,6 +823,7 @@
                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();
@@ -730,10 +838,12 @@
                detail1.setUpdateTime(dates);
                detail1.setCreateId(String.valueOf(sysUser.getUserId()));
                detail1.setUpdateId(String.valueOf(sysUser.getUserId()));
                detail1.setJxbz(jxbz);
                tjOrderDetailService.save(detail1);
                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 && (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();
@@ -747,14 +857,40 @@
                            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 &&
//                            (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()) {
                            OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto();
                            detailsDto.setMxfyxmbm(project.getHisXmbm());
@@ -766,14 +902,40 @@
                            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 &&
//                            (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());
@@ -785,12 +947,38 @@
                            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")){
            //检验申请
@@ -813,6 +1001,8 @@
                    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());
@@ -872,6 +1062,8 @@
                    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());
@@ -911,6 +1103,52 @@
                }
            }
            //药品申请
            if(outpinmedicapplyDetilsDtos.size()>0){
                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("200")){
                    JSONArray resultData = object.getJSONArray("ResultData");
                    Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0);
                    String cfh = resultDatasss.get("cfh").toString();
                    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());
                        cfService.save(cf);
                    }
                }
            }
            //门诊治疗处置申请
            if(detailDtos.size()>0){
@@ -932,6 +1170,8 @@
                    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());
@@ -974,23 +1214,23 @@
        //父项耗材
        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);
        }
//        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);
//        }
    }
    @Override
@@ -2394,11 +2634,14 @@
    //临时表添加单项
    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,cardId, proId);
//            if(null !=project) transitionService.saveRedisTransitionByProId(cusId,cardId, proId);
        }
    }