|
|
@ -0,0 +1,47 @@ |
|
|
|
package com.digiwin.athena.app.service.purchase; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
|
import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; |
|
|
|
import com.digiwin.athena.app.infra.entity.SupplierContactEntity; |
|
|
|
import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; |
|
|
|
import com.digiwin.athena.opt.common.eai.EAIRequest; |
|
|
|
import com.digiwin.athena.opt.common.eai.EAIUtil; |
|
|
|
import com.digiwin.athena.opt.common.eai.service.AbsEAIService; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* @auther: zhenggl |
|
|
|
* @date: 2023/9/4 |
|
|
|
*/ |
|
|
|
@Log4j2 |
|
|
|
@Service |
|
|
|
public class PurchaseOrderAbnormalUpdateEAIService extends AbsEAIService { |
|
|
|
|
|
|
|
@Resource |
|
|
|
PurchaseOrderDetailRepository purchaseOrderDetailRepository; |
|
|
|
|
|
|
|
@Override |
|
|
|
public String getServiceName() { |
|
|
|
return PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public DWEAIResult execute(Map<String, String> headers, String messageBody) throws Exception { |
|
|
|
|
|
|
|
// 入参反序列化 |
|
|
|
EAIRequest request = new EAIRequest(messageBody); |
|
|
|
List<PurchaseOrderDetailEntity> purchaseOrderDetailEntities = request.getToList("purchase_order_info", PurchaseOrderDetailEntity.class); |
|
|
|
purchaseOrderDetailRepository.updateAbnormalHandlePlan(purchaseOrderDetailEntities); |
|
|
|
|
|
|
|
return EAIUtil.buildEAIResult(new HashMap<>()); |
|
|
|
} |
|
|
|
} |