Browse Source

外协供应商get修改,异常排除更新接口新增

master
郑贵龙 1 year ago
parent
commit
d92302db56
6 changed files with 34 additions and 14 deletions
  1. +3
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java
  2. +5
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java
  3. +3
    -2
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java
  4. +5
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java
  5. +3
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java
  6. +15
    -12
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java

+ 3
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java View File

@ -3,6 +3,7 @@ package com.digiwin.athena.app.infra.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@ -102,12 +103,14 @@ public class PurchaseOrderDetailEntity extends BaseMgrEntity<PurchaseOrderDetail
* 采购需求日期 * 采购需求日期
*/ */
@SerializedName(value = "purchase_date") @SerializedName(value = "purchase_date")
@JsonProperty(value = "purchase_date")
private Date purchaseDate; private Date purchaseDate;
/** /**
* 预计到货日 * 预计到货日
*/ */
@SerializedName(value = "expected_date") @SerializedName(value = "expected_date")
@JsonProperty(value = "expected_date")
private Date expectedDate; private Date expectedDate;
/** /**


+ 5
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java View File

@ -2,6 +2,9 @@ package com.digiwin.athena.app.infra.repository;
import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity;
import com.digiwin.athena.opt.persistence.repository.BaseRepository; import com.digiwin.athena.opt.persistence.repository.BaseRepository;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author lz * @author lz
@ -10,4 +13,6 @@ import com.digiwin.athena.opt.persistence.repository.BaseRepository;
* @time 2023/8/29 16:35 * @time 2023/8/29 16:35
*/ */
public interface PurchaseOrderDetailRepository extends BaseRepository<PurchaseOrderDetailEntity> { public interface PurchaseOrderDetailRepository extends BaseRepository<PurchaseOrderDetailEntity> {
public void updateAbnormalHandlePlan(@Param("list") List<PurchaseOrderDetailEntity> list);
} }

+ 3
- 2
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java View File

@ -21,5 +21,6 @@ public interface PurchaseDemoEAIService extends DWService {
@EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET) @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET)
DWEAIResult get(Map<String, String> headers, String messageBody) throws Exception; DWEAIResult get(Map<String, String> headers, String messageBody) throws Exception;
}
@EAIService(id = PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE)
DWEAIResult abnormalUpdate(Map<String, String> headers, String messageBody) throws Exception;
}

+ 5
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java View File

@ -29,4 +29,9 @@ public class PurchaseDemoEAIServiceImpl implements PurchaseDemoEAIService {
public DWEAIResult get(Map<String, String> headers, String messageBody) throws Exception { public DWEAIResult get(Map<String, String> headers, String messageBody) throws Exception {
return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_DEMO_GET, headers, messageBody); return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_DEMO_GET, headers, messageBody);
} }
@Override
public DWEAIResult abnormalUpdate(Map<String, String> headers, String messageBody) throws Exception {
return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE, headers, messageBody);
}
} }

+ 3
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java View File

@ -15,5 +15,8 @@ public class PurchaseUtil {
//查询请购单 //查询请购单
public static final String DEMO_PURCHASE_DEMO_GET = "demo.purchase.order.get"; public static final String DEMO_PURCHASE_DEMO_GET = "demo.purchase.order.get";
//异常排除更新
public static final String DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE = "demo.purchase.order.abnormal.update";
} }

+ 15
- 12
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java View File

@ -1,6 +1,7 @@
package com.digiwin.athena.app.service.supplier; package com.digiwin.athena.app.service.supplier;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.digiwin.app.service.DWEAIResult; import com.digiwin.app.service.DWEAIResult;
import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; import com.digiwin.athena.app.infra.entity.ItemSupplierEntity;
@ -39,18 +40,20 @@ public class SupplierGetEAIService extends AbsEAIService {
List<ItemSupplierEntity> supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); List<ItemSupplierEntity> supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER);
LambdaQueryWrapper<ItemSupplierEntity> lmq = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ItemSupplierEntity> lmq = new LambdaQueryWrapper<>();
lmq.eq(ItemSupplierEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); lmq.eq(ItemSupplierEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId());
lmq.and(
queryWrapperInner -> {
for (ItemSupplierEntity itemSupplierEntity : supplierInfo) {
queryWrapperInner.or(
wrapper -> wrapper
.eq(ItemSupplierEntity::getItemNo, itemSupplierEntity.getItemNo())
.eq(ItemSupplierEntity::getItemName, itemSupplierEntity.getItemName())
.eq(ItemSupplierEntity::getSupplierNo, itemSupplierEntity.getSupplierNo())
.eq(ItemSupplierEntity::getSupplierName, itemSupplierEntity.getSupplierName())
);
}
});
if (CollectionUtils.isNotEmpty(supplierInfo)) {
lmq.and(
queryWrapperInner -> {
for (ItemSupplierEntity itemSupplierEntity : supplierInfo) {
queryWrapperInner.or(
wrapper -> wrapper
.eq(ItemSupplierEntity::getItemNo, itemSupplierEntity.getItemNo())
.eq(ItemSupplierEntity::getItemName, itemSupplierEntity.getItemName())
.eq(ItemSupplierEntity::getSupplierNo, itemSupplierEntity.getSupplierNo())
.eq(ItemSupplierEntity::getSupplierName, itemSupplierEntity.getSupplierName())
);
}
});
}
List<ItemSupplierEntity> list = supplierService.list(lmq); List<ItemSupplierEntity> list = supplierService.list(lmq);
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", list)); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", list));


Loading…
Cancel
Save