From 1b5d871c0cd5a8a866a4ec8082c844be2f06c152 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 09:54:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ptc/infra/mapper/ReceivablesDetailMapper.xml | 2 +- .../service/production/ProductionTasUpdateEAIService.java | 2 +- .../service/production/ProductionTaskGetEAIService.java | 2 +- .../receivables/ReceivablesInitialCreateEAIService.java | 7 +++---- .../receivables/ReceivablesTaskUpdateEAIService.java | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml index 7d4f9e1..5791908 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml @@ -6,7 +6,7 @@ - delete from cim_receivables_detail where tenantsid=#{tenantSid} + delete from cim_receivables_detail where tenantsid=#{tenantSid} and ( sales_order = #{item.salesOrder} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java index 6e467e8..39c14b1 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java @@ -47,7 +47,7 @@ public class ProductionTasUpdateEAIService extends AbsEAIService { } LambdaUpdateWrapper ump = new LambdaUpdateWrapper<>(); - ump.set(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.COMPLETED.getValue()); + ump.set(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.COMPLETED.getValue().toString()); List woNoList = productionDetailsEntities.stream().map(ProductionDetailsEntity::getWorkNo).collect(Collectors.toList()); ump.in(ProductionDetailsEntity::getWorkNo,woNoList); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java index 8ebd441..6d6acfd 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java @@ -50,7 +50,7 @@ public class ProductionTaskGetEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); List woNoList = productionDetailsEntities.stream().map(ProductionDetailsEntity::getWorkNo).collect(Collectors.toList()); lmq.eq(ProductionDetailsEntity::getTenantSid,SecurityUtil.getUserProfile().getTenantSid()); - lmq.eq(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.PENDING.getValue()); + lmq.eq(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.PENDING.getValue().toString()); lmq.in(ProductionDetailsEntity::getWorkNo,woNoList); List list = productionDetailsService.list(lmq); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java index 9f377f0..48a397e 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java @@ -3,7 +3,6 @@ package com.digiwin.athena.app.ptc.service.receivables; import com.alibaba.nacos.common.utils.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.digiwin.app.service.DWEAIResult; -import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; @@ -13,7 +12,6 @@ import com.digiwin.athena.app.ptc.infra.service.ReceivablesDetailService; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; import com.digiwin.athena.opt.common.generator.SnowflakeWorker; import com.digiwin.athena.opt.common.security.SecurityUtil; -import com.digiwin.athena.opt.common.util.DateUtils; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; @@ -79,7 +77,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { HashSet set = new HashSet<>(); int count = 0; while (count < 6) { - int num = random.nextInt(27); + int num = random.nextInt(26); if (!set.contains(num)) { set.add(num); count++; @@ -116,7 +114,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { //取出已完成的数据 LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); - lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); + lmq.eq(CollectionDetailEntity::getStatus, "2"); List collectionDetailEntities = collectionDetailService.list(lmq); //删除应收数据 @@ -128,6 +126,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : list) { + int i = random.nextInt(16); ReceivablesDetailEntity sku = skuList.get(i); receivablesDetailEntity.setSkuCode(sku.getSkuCode()); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java index 5dbe2fe..66310e6 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java @@ -49,7 +49,7 @@ public class ReceivablesTaskUpdateEAIService extends AbsEAIService { } LambdaUpdateWrapper ump = new LambdaUpdateWrapper<>(); - ump.set(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); + ump.set(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue().toString()); ump.eq(CollectionDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); ump.and(queryWrapperInner -> { for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) {