diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java index 8b479a7..6b9792f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java @@ -119,6 +119,10 @@ public class CollectionDetailEntity extends BaseMgrEntity headers, String messageBody) throws Exception; - @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_GET) + @EAIService(id = ReceivablesUtil.RECEIVABLES_INITIAL_CREATE) DWEAIResult initialCreate(Map headers, String messageBody) throws Exception; + + @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_DELETE) + DWEAIResult taskDelete(Map headers, String messageBody) throws Exception; } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java index 5a71f22..6aa553e 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java @@ -36,4 +36,9 @@ public class ReceivablesDetailEAIServiceImpl implements ReceivablesDetailEAIServ public DWEAIResult initialCreate(Map headers, String messageBody) throws Exception { return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_INITIAL_CREATE,headers,messageBody); } + + @Override + public DWEAIResult taskDelete(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_TASK_DELETE,headers,messageBody); + } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java new file mode 100644 index 0000000..33aca83 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java @@ -0,0 +1,48 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.StringUtils; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/13 + */ +public class ReceivablesTaskDeleteEAIService extends AbsEAIService { + + @Resource + private CollectionDetailRepository collectionDetailRepository; + + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_TASK_DELETE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List collectionDetailEntities = eaiRequest.getObject("receivables_info", new TypeReference>() {}); + + + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder()) + ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + throw new DWBusinessException("缺少必要参数"); + } + } + + collectionDetailRepository.deleteBatch(collectionDetailEntities, SecurityUtil.getUserProfile().getTenantSid()); + return buildOK(); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java index cb7507d..b61bc9b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java @@ -41,7 +41,9 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { List collectionDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { - if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder())||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder()) + ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber()) + ||StringUtils.isEmpty(collectionDetailEntity.getProcessedBy())){ throw new DWBusinessException("缺少必要参数"); } } @@ -55,6 +57,7 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { wrapper -> wrapper .eq(CollectionDetailEntity::getSalesOrder, collectionDetailEntity.getSalesOrder()) .eq(CollectionDetailEntity::getSalesOrderNumber, collectionDetailEntity.getSalesOrderNumber()) + .eq(CollectionDetailEntity::getProcessedBy, collectionDetailEntity.getProcessedBy()) ); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java index e15b528..6eacabb 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java @@ -13,4 +13,6 @@ public class ReceivablesUtil { public static final String RECEIVABLES_TASK_CREATE = "demo.ptc.athenapot.receivables.create"; public static final String RECEIVABLES_INITIAL_CREATE = "demo.ptc.athenapot.receivables.initial.create"; + + public static final String RECEIVABLES_TASK_DELETE = "demo.ptc.athenapot.receivables.task.delete"; } diff --git a/doc/sql/app-2023-09-12-ddl.sql b/doc/sql/app-20230912-ddl.sql similarity index 97% rename from doc/sql/app-2023-09-12-ddl.sql rename to doc/sql/app-20230912-ddl.sql index 79bc4fe..8247887 100644 --- a/doc/sql/app-2023-09-12-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -116,3 +116,6 @@ CREATE TABLE `cim_limit_credit` ( -- 修改问题明细长度 ALTER TABLE `cim_chat_file` MODIFY COLUMN `question` varchar (500); + +-- 催收表新增处理人 +alter table cim_collection_detail Add column processed_by varchar(32) null default '' COMMENT '处理人';