| | |
| | | return AjaxResult.error("参数错误"); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getCusId,cusId); |
| | | wrapper.isNull(TjSampling::getParentId); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | if (list.isEmpty()) |
| | | return AjaxResult.error("参数错误"); |
| | | List<TjSampling> projectList = new ArrayList<>(); |
| | | for (TjSampling sampling : list) { |
| | | sampling.setCusName(MatchUtils.hideCusName(sampling.getCusName())); |
| | | TjProject project = projectService.getById(sampling.getProId()); |
| | | if (null != project && project.getProParentId() == 0) { |
| | | projectList.add(sampling); |
| | | } |
| | | } |
| | | return AjaxResult.success(projectList); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PostMapping("/mergeCaiYang") |
| | |
| | | if (null == ids || ids.size() == 0) { |
| | | return AjaxResult.error("请选择要确认项"); |
| | | } |
| | | String tjNumber = ""; |
| | | ArrayList<TjProject> projects = new ArrayList<>(); |
| | | for (String id : ids) { |
| | | TjSampling sampling = tjSamplingService.getById(id); |
| | | if (null != sampling) { |
| | | tjNumber = sampling.getTjNum(); |
| | | sampling.setIsSignFor("0"); |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjProject::getProParentId, sampling.getProId()); |
| | |
| | | for (TjProject project : projectList) { |
| | | Long proId = project.getProId(); |
| | | collect.add(String.valueOf(proId)); |
| | | projects.add(project); |
| | | } |
| | | LambdaQueryWrapper<TjSampling> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum, sampling.getTjNum()); |
| | |
| | | if (!tjSamplingService.updateById(sampling)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("操作失败,请重试"); |
| | | } |
| | | } |
| | | if (StrUtil.isNotBlank(tjNumber)){ |
| | | TjOrder order = orderService.getOrderByTjNum(tjNumber); |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(String.valueOf(customer.getCusId()),order.getCardId()); |
| | | Boolean save = lisApiMethod.save(order, customer, projects, detailList); |
| | | if (!save){ |
| | | |
| | | } |
| | | } |
| | | |