From 201e9ae76d2c8d6219ceabbf4e1ebb36fc2e7a06 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 11 七月 2024 18:18:23 +0800
Subject: [PATCH] zjh 2024/07/11-1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java |  338 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 237 insertions(+), 101 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
index e59e5d5..a510ec2 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
@@ -114,7 +114,18 @@
     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;
     @Override
     public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) {
         long l = System.currentTimeMillis();
@@ -489,6 +500,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();
 
@@ -510,7 +536,7 @@
         for (String tjProId : tjProIds) {
             LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>();
             wqq.eq(TbTransition::getCusId, customer.getCusIdcard());
-            TjProject project = projectService.selectTjProjectByProId(Long.valueOf(tjProId));
+            TjProject project = projectService.getById(Long.valueOf(tjProId));
             if (null != project && project.getProParentId() == 0) {
                 TjOrderRemark tjOrderRemark = new TjOrderRemark();
                 tjOrderRemark.setProId(Long.valueOf(tjProId));
@@ -523,6 +549,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());
@@ -538,6 +565,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();
@@ -546,12 +574,13 @@
 //                    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);
@@ -617,12 +646,10 @@
                 wqq.in(TbTransition::getProId, Arrays.asList(tjProIds));
                 TjProject projects = projectService.selectTjProjectByProId(Long.valueOf(tjProId));
                 if (null != projects) {
-                    TjProject projectss = projectService.selectTjProjectByProId(projects.getProParentId());
+                    TjProject projectss = projectService.getById(projects.getProParentId());
                     if (null != projectss && projectss.getProParentId()==0L) {
                         projectList.add(projectss);
                     }
-
-
                 }
 //                List<Long> proIds = projectService.getTjProjectListBySoneId(tjProId).stream().map(TjProject::getProId).collect(Collectors.toList());
                 TjOrderDetail detail = new TjOrderDetail();
@@ -637,6 +664,7 @@
                 detail.setUpdateTime(dates);
                 detail.setCreateId(String.valueOf(sysUser.getUserId()));
                 detail.setUpdateId(String.valueOf(sysUser.getUserId()));
+                detail.setJxbz(jxbz);
                 tjOrderDetailService.save(detail);
 
             }
@@ -644,54 +672,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){
@@ -708,6 +740,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();
@@ -722,6 +755,7 @@
                 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")){
                     //妫�楠�
@@ -736,7 +770,7 @@
                             } else {
                                 detailsDto.setSfzhfy("0");
                             }
-                            detailsDto.setSl(1);
+                            detailsDto.setSl(project.getSl());
                             detailsDtos.add(detailsDto);
                         }
                     }
@@ -755,7 +789,7 @@
                             } else {
                                 detailsDto.setSfzhfy("0");
                             }
-                            detailsDto.setSl(1);
+                            detailsDto.setSl(project.getSl());
                             detailsDtoss.add(detailsDto);
                         }
                     }
@@ -774,7 +808,7 @@
                             } else {
                                 detailsDto.setSfzhfy("0");
                             }
-                            detailsDto.setSl(1);
+                            detailsDto.setSl(project.getSl());
                             detailDtos.add(detailsDto);
                         }
                     }
@@ -802,13 +836,47 @@
                 JSONObject object3 = getJSONObject(result5);
                 String code3 = object3.getStr("ResultCode");
                 if (code3.equals("0")) {
-                    Map<String, Object> datas = object3.getJSONObject("ResultData");
-                    datas.put("cardId", order.getCardId());
-                    JSONObject object4 = JSONUtil.parseObj(datas);
-                    LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                    lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply");
-                    HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                    hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto)));
+                    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);
+                        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());
+                        }
+                        ltkjJianchajianyanTreeService.save(tree);
+                    }
 
                 }
             }
@@ -829,14 +897,47 @@
                 JSONObject object5 = getJSONObject(result6);
                 String code4 = object5.getStr("ResultCode");
                 if (code4.equals("0")) {
-                    Map<String, Object> map = object5.getJSONObject("ResultData");
-                    map.put("cardId", order.getCardId());
-                    JSONObject jsonObject = JSONUtil.parseObj(map);
-                    LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                    lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply");
-                    HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                    hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto)));
-
+                    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);
+                        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());
+                        }
+                        ltkjJianchajianyanTreeService.save(tree);
+                    }
                 }
             }
 
@@ -858,38 +959,70 @@
                 JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2);
                 String code5 = mzylyzsq3.getStr("ResultCode");
                 if (code5.equals("0")) {
-                    Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData");
-                    map.put("cardId", order.getCardId());
-                    JSONObject jsonObject = JSONUtil.parseObj(map);
-                    LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                    lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply");
-                    HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                    hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao)));
+                    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);
+                        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());
+                        }
+                        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(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
@@ -2293,11 +2426,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);
         }
     }
 

--
Gitblit v1.8.0