|
|
|
@ -2,12 +2,14 @@ package com.glxp.mipsdl.client.zzzyy;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.glxp.mipsdl.client.BaseHttpClient;
|
|
|
|
|
import com.glxp.mipsdl.config.ThirdSysConfig;
|
|
|
|
|
import com.glxp.mipsdl.constant.ConstantType;
|
|
|
|
@ -28,10 +30,7 @@ import com.glxp.mipsdl.entity.auth.AuthWarehouseEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.auth.AuthWarehouseUser;
|
|
|
|
|
import com.glxp.mipsdl.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.basic.BasicCorpEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.inout.IoCodeEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.inout.IoOrderUploadLogEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.inout.*;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity;
|
|
|
|
|
import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity;
|
|
|
|
@ -63,6 +62,7 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 漳州中医院客户端--智业接口对接
|
|
|
|
@ -285,6 +285,7 @@ public class ZzzyyClient implements BaseHttpClient {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询仓库信息
|
|
|
|
|
AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new QueryWrapper<AuthWarehouseEntity>().eq("code", orderEntity.getInvCode()));
|
|
|
|
|
try {
|
|
|
|
@ -298,7 +299,7 @@ public class ZzzyyClient implements BaseHttpClient {
|
|
|
|
|
zaxzyyOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode());
|
|
|
|
|
zaxzyyOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.info("查询第三方系统仓库信息异常", e);
|
|
|
|
|
log.error("查询第三方系统仓库信息异常", e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//设置单据出入库类型
|
|
|
|
@ -320,7 +321,27 @@ public class ZzzyyClient implements BaseHttpClient {
|
|
|
|
|
List<IoOrderDetailBizEntity> detailBizEntities = orderDetailBizDao.selectList(new QueryWrapper<IoOrderDetailBizEntity>().eq("orderIdFk", orderEntity.getBillNo()));
|
|
|
|
|
setOrderDetailList(ioCodeEntities, items, detailBizEntities);
|
|
|
|
|
zaxzyyOrderRequest.setItem(items);
|
|
|
|
|
if (CollUtil.isEmpty(items)) {
|
|
|
|
|
log.error("\"产品信息对照异常,无法上传\"");
|
|
|
|
|
return ResultVOUtils.error(500, "产品信息对照异常,无法上传");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (UdiwmsOrderDetailRequest i : items) {
|
|
|
|
|
String fphm = "";
|
|
|
|
|
String fprq = null;
|
|
|
|
|
List<IoOrderInvoiceEntity> invoiceList = IoOrderInvoiceEntity.builder().build()
|
|
|
|
|
.selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getBillNo())
|
|
|
|
|
.eq(IoOrderInvoiceEntity::getBindRlFk, i.getBindRlFk())
|
|
|
|
|
.eq(StrUtil.isNotEmpty(i.getBatchNo()), IoOrderInvoiceEntity::getBatchNo, i.getBatchNo()).
|
|
|
|
|
groupBy(IoOrderInvoiceEntity::getInvoiceEncode));
|
|
|
|
|
if (CollectionUtil.isNotEmpty(invoiceList)) {
|
|
|
|
|
fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceEncode).collect(Collectors.joining(","));
|
|
|
|
|
if (invoiceList.get(0).getInvoiceDate() != null)
|
|
|
|
|
fprq = DateUtil.formatDateTime(invoiceList.get(0).getInvoiceDate());
|
|
|
|
|
}
|
|
|
|
|
i.setFirstSalesInvNo(fphm);
|
|
|
|
|
i.setInvoiceDate(fprq);
|
|
|
|
|
}
|
|
|
|
|
//构造诏安接口参数
|
|
|
|
|
ZzzyyRequest zaZyRequest = new ZzzyyRequest();
|
|
|
|
|
|
|
|
|
@ -436,11 +457,11 @@ public class ZzzyyClient implements BaseHttpClient {
|
|
|
|
|
private void setOrderDetailList(List<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> detailBizEntities) {
|
|
|
|
|
for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) {
|
|
|
|
|
UdiwmsOrderDetailRequest item = submitOrderUtil.buildProductInfo(detailBizEntity);
|
|
|
|
|
|
|
|
|
|
//封装条码信息
|
|
|
|
|
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
|
|
|
|
|
|
|
|
|
|
orderDetailRequests.add(item);
|
|
|
|
|
if (item != null) {
|
|
|
|
|
//封装条码信息
|
|
|
|
|
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
|
|
|
|
|
orderDetailRequests.add(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|