From 83a96ad0bd575fb8c55fbc5a983bdd4ff2626125 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 15 Jan 2025 09:28:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=98=E6=9B=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectorder/ProjectOrderServiceImpl.java | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java index 2b6d774..b5c75b4 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java @@ -194,16 +194,16 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { LambdaQueryWrapper eq = new LambdaQueryWrapper().eq(OrderYsDO::getCode, updateReqVO.getCode()); OrderYsDO orderYsDO = orderYsMapper.selectOne(eq); - if (ObjectUtil.isEmpty(orderYsDO)){ - if (updateReqVO.getHasPrice().equals(1)) { + if (updateReqVO.getHasPrice().equals(1)) { + if (ObjectUtil.isEmpty(orderYsDO)) { orderYsDO = new OrderYsDO(); orderYsDO.setCode(updateReqVO.getCode()); orderYsDO.setProjectName(updateReqVO.getProjectName()); orderYsDO.setCgTime(LocalDateTime.now()); orderYsDO.setCgKhname(customerService.getCustomer(updateReqVO.getCustomerId()).getName()); - if(updateReqVO.getPrice()==null){ + if (updateReqVO.getPrice() == null) { orderYsDO.setCgYs(new BigDecimal(0)); - }else { + } else { orderYsDO.setCgYs(updateReqVO.getPrice()); LocalDateTime[] paymentTimes = { updateReqVO.getSixFuKuanTime(), @@ -220,28 +220,30 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { } } } - } - orderYsMapper.insert(orderYsDO); - }else { - orderYsDO.setCgYs(updateReqVO.getPrice()); - LocalDateTime[] paymentTimes = { - updateReqVO.getSixFuKuanTime(), - updateReqVO.getFiveFuKuanTime(), - updateReqVO.getFourFuKuanTime(), - updateReqVO.getThreeFuKuanTime(), - updateReqVO.getTwoFuKuanTime(), - updateReqVO.getShouFuKuanTime() - }; - for (LocalDateTime paymentTime : paymentTimes) { - if (!ObjectUtil.isEmpty(paymentTime)) { - orderYsDO.setPaymentDate(paymentTime); - break; + orderYsMapper.insert(orderYsDO); + } else { + orderYsDO.setCgYs(updateReqVO.getPrice()); + LocalDateTime[] paymentTimes = { + updateReqVO.getSixFuKuanTime(), + updateReqVO.getFiveFuKuanTime(), + updateReqVO.getFourFuKuanTime(), + updateReqVO.getThreeFuKuanTime(), + updateReqVO.getTwoFuKuanTime(), + updateReqVO.getShouFuKuanTime() + }; + for (LocalDateTime paymentTime : paymentTimes) { + if (!ObjectUtil.isEmpty(paymentTime)) { + orderYsDO.setPaymentDate(paymentTime); + break; + } } + orderYsMapper.updateById(orderYsDO); + } + }else{ + if (ObjectUtil.isNotEmpty(orderYsDO)) { + orderYsMapper.deleteById(orderYsDO.getId()); } - orderYsMapper.updateById(orderYsDO); } - ProjectOrderDO updateObj = BeanUtils.toBean(updateReqVO, ProjectOrderDO.class); - projectOrderMapper.updateById(updateObj); } @Override @Transactional(rollbackFor = Exception.class) @@ -516,6 +518,7 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { }else{ if ("ALTER".equals(operateReqVO.getActive())){ updateProjectOrderPrice(operateReqVO); + updateProjectOrder(operateReqVO); }else { updateProjectOrder(operateReqVO); }