Browse Source

feat:新增根据bk删除催收数据接口,催收表新增处理人字段

master
郑贵龙 1 year ago
parent
commit
f87e8a1cd0
1 changed files with 48 additions and 0 deletions
  1. +48
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java

+ 48
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java View File

@ -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<String, String> headers, String messageBody) throws Exception {
EAIRequest eaiRequest = EAIRequest.build(messageBody);
List<CollectionDetailEntity> collectionDetailEntities = eaiRequest.getObject("receivables_info", new TypeReference<List<CollectionDetailEntity>>() {});
for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) {
if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder())
||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){
throw new DWBusinessException("缺少必要参数");
}
}
collectionDetailRepository.deleteBatch(collectionDetailEntities, SecurityUtil.getUserProfile().getTenantSid());
return buildOK();
}
}

Loading…
Cancel
Save