| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | private LisApiMethod lisApiMethod; |
| | | @Autowired |
| | | private IdUtils idUtils; |
| | | @Autowired |
| | | private LtkjJybbzdService jybbzdService; |
| | | @Autowired |
| | | private LisJyflhbService lisJyflhbService; |
| | | |
| | | |
| | | @Override |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | |
| | | // wq.eq(TjOrderDetail::getIsSampling, 0); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser,null); |
| | | } |
| | | |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser) { |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser,String jxbz) { |
| | | 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(); |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID()); |
| | | sampling.setSpecimenType(projectService.getById(detail.getProId()).getSpecimenType()); |
| | | 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()); |
| | | sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | } |
| | | } else { |
| | | sampling.setSpecimenType(projectService.getById(projectService.getById(detail.getProId()).getProParentId()).getSpecimenType()); |
| | | 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.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | } |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | |
| | | sampling.setUpdateTime(new Date()); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | } |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | List<TjProject> projectList=new ArrayList<>(); |
| | | |
| | | ArrayList<TjOrderDetail> tjOrderDetails = new ArrayList<>(); |
| | | for (String tjProId : tjProIds) { |
| | | // LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail); |
| | | tjOrderDetails.add(detail); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | List<TjOrderDetail> collect = tjOrderDetails.stream().filter(item -> { |
| | | TjProject project = projectService.getById(item.getProId()); |
| | | return project != null && project.getProParentId() == 0; |
| | | }).collect(Collectors.toList()); |
| | | // addCaiYangDengJi(collect, !collect.isEmpty(), order, sysUser,jxbz); |
| | | tjOrderDetails = new ArrayList<>(); |
| | | |
| | | ArrayList<TjProject> jianChaProjects = new ArrayList<>(); |
| | | ArrayList<TjProject> jianYanProjects = new ArrayList<>(); |
| | |
| | | detail1.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail1.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail1); |
| | | tjOrderDetails.add(detail1); |
| | | if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | |
| | | } |
| | | } |
| | | } |
| | | collect = tjOrderDetails.stream().filter(item -> { |
| | | TjProject project = projectService.getById(item.getProId()); |
| | | return project != null && project.getProParentId() == 0; |
| | | }).collect(Collectors.toList()); |
| | | // addCaiYangDengJi(collect, !collect.isEmpty(), order, sysUser,jxbz); |
| | | } |
| | | |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if(null !=config && config.equals("Y")){ |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order)) { |
| | | List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | 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); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser); |
| | | |
| | | if (useLisAndPacsRegister) { |
| | | // List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | }else { |
| | |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | |
| | | addCaiYangDengJi(detailList,!detailList.isEmpty(), order, sysUser,jxbz); |
| | | |
| | | } |
| | | } |
| | |
| | | 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); |
| | | addCaiYangDengJi(detailList, detailList.size() > 0, order, sysUser); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, detailList.size() > 0, order, sysUser,null); |
| | | } |
| | | |
| | | //首页饼状图登记人数接口 |