|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.service.inout;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.net.URLDecoder;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
@ -13,6 +14,7 @@ import com.glxp.api.entity.basic.UdiRlSupEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.idc.utils.IDCUtils;
|
|
|
|
|
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
|
|
|
|
|
import com.glxp.api.req.inout.ioOrderUploadRequest;
|
|
|
|
|
import com.glxp.api.res.inout.PlatformLinkResponse;
|
|
|
|
|
import com.glxp.api.res.inout.ioUploadOrderResponse;
|
|
|
|
|
import com.glxp.api.util.BeanCopyUtils;
|
|
|
|
@ -29,6 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@ -58,7 +61,7 @@ public class IoOrderUtilsService {
|
|
|
|
|
public boolean getIoder(ioUploadOrderResponse ioUploadOrderRespons) {
|
|
|
|
|
|
|
|
|
|
List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntityList = ioUploadOrderRespons.getIoOrderDetailCodeEntityList();
|
|
|
|
|
List<IoCodeTempEntity> ioCodeTempEntityList = ioUploadOrderRespons.getIoCodeTempEntityList();
|
|
|
|
|
List<IoCodeEntity> ioCodeEntityList = ioUploadOrderRespons.getIoCodeEntityList();
|
|
|
|
|
IoOrderEntity ioOrderEntity = ioUploadOrderRespons.getIoOrderEntity();
|
|
|
|
|
PlatformLinkResponse platformLinkRespons = ioUploadOrderRespons.getPlatformLinkRespons();
|
|
|
|
|
List<IoOrderDetailBizEntity> ioOrderDetailBizEntityList = ioUploadOrderRespons.getIoOrderDetailBizEntityList();
|
|
|
|
@ -66,7 +69,7 @@ public class IoOrderUtilsService {
|
|
|
|
|
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = ioUploadOrderRespons.getIoOrderInvoiceEntityList();
|
|
|
|
|
|
|
|
|
|
//用来存储耗材字典结果集避免重复查询数据库
|
|
|
|
|
Map<String, UdiRlSupEntity> map = new HashMap<>();
|
|
|
|
|
Map<Long, ioOrderUploadRequest> map = new HashMap<>();
|
|
|
|
|
Boolean checkUdi = false; //判断是不是有错误
|
|
|
|
|
|
|
|
|
|
//根据供应商id查询用户id
|
|
|
|
@ -80,21 +83,21 @@ public class IoOrderUtilsService {
|
|
|
|
|
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
|
|
|
|
|
IoCodeTempEntity ioCodeTempEntity1 = new IoCodeTempEntity();
|
|
|
|
|
List<IoCodeTempEntity> ioCodeTempEntities = new ArrayList<>();
|
|
|
|
|
for (IoCodeTempEntity ioCodeTempEntity : ioCodeTempEntityList) {
|
|
|
|
|
for (IoCodeEntity ioCodeTempEntity : ioCodeEntityList) {
|
|
|
|
|
|
|
|
|
|
//查询物资信息
|
|
|
|
|
filterCompanyProductRelevanceRequest.setCustomerId(Long.valueOf(platformLinkRespons.getUnitId()));
|
|
|
|
|
filterCompanyProductRelevanceRequest.setNameCode(ioCodeTempEntity.getNameCode());
|
|
|
|
|
List<UdiRlSupEntity> udiRlSupEntityList = udiRlSupDao.filterCompanyProduct(filterCompanyProductRelevanceRequest);
|
|
|
|
|
List<ioOrderUploadRequest> udiRlSupEntityList = udiRlSupDao.filterCompanyProduct(filterCompanyProductRelevanceRequest);
|
|
|
|
|
if (udiRlSupEntityList != null && udiRlSupEntityList.size() == 0 || udiRlSupEntityList.size() > 1) {
|
|
|
|
|
ioCodeTempEntity1.setRelId(null);
|
|
|
|
|
checkUdi = true;
|
|
|
|
|
} else {
|
|
|
|
|
ioCodeTempEntity1.setRelId(udiRlSupEntityList.get(0).getId());
|
|
|
|
|
map.put(ioCodeTempEntity.getRelId() + "", udiRlSupEntityList.get(0));
|
|
|
|
|
map.put(ioCodeTempEntity.getRelId(), udiRlSupEntityList.get(0));
|
|
|
|
|
|
|
|
|
|
ioCodeTempEntity1.setOrderId(billNO);
|
|
|
|
|
ioCodeTempEntity1.setCode(ioCodeTempEntity.getCode());
|
|
|
|
|
ioCodeTempEntity1.setCode(URLDecoder.decode(ioCodeTempEntity.getCode(), StandardCharsets.UTF_8));
|
|
|
|
|
ioCodeTempEntity1.setMainAction(ioCodeTempEntity.getMainAction());
|
|
|
|
|
ioCodeTempEntity1.setAction(platformLinkRespons.getTargetAction());
|
|
|
|
|
ioCodeTempEntity1.setNameCode(ioCodeTempEntity.getNameCode());
|
|
|
|
@ -120,7 +123,7 @@ public class IoOrderUtilsService {
|
|
|
|
|
for (IoOrderDetailCodeEntity ioOrderDetailCodeEntity : ioOrderDetailCodeEntityList) {
|
|
|
|
|
ioOrderDetailCodeEntity1.setOrderIdFk(billNO);
|
|
|
|
|
|
|
|
|
|
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailCodeEntity.getBindRlFk());
|
|
|
|
|
ioOrderUploadRequest udiRlSupEntity = map.get(ioOrderDetailCodeEntity.getBindRlFk());
|
|
|
|
|
if (udiRlSupEntity != null) {
|
|
|
|
|
ioOrderDetailCodeEntity1.setBindRlFk(udiRlSupEntity.getId());
|
|
|
|
|
ioOrderDetailCodeEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + "");
|
|
|
|
@ -157,7 +160,7 @@ public class IoOrderUtilsService {
|
|
|
|
|
|
|
|
|
|
ioOrderDetailBizEntity1.setOrderIdFk(billNO);
|
|
|
|
|
|
|
|
|
|
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailBizEntity.getBindRlFk());
|
|
|
|
|
ioOrderUploadRequest udiRlSupEntity = map.get(ioOrderDetailBizEntity.getBindRlFk());
|
|
|
|
|
if (udiRlSupEntity != null) {
|
|
|
|
|
ioOrderDetailBizEntity1.setBindRlFk(udiRlSupEntity.getId());
|
|
|
|
|
ioOrderDetailBizEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + "");
|
|
|
|
@ -194,7 +197,7 @@ public class IoOrderUtilsService {
|
|
|
|
|
|
|
|
|
|
ioOrderDetailResultEntity1.setOrderIdFk(billNO);
|
|
|
|
|
|
|
|
|
|
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailResultEntity.getBindRlFk());
|
|
|
|
|
ioOrderUploadRequest udiRlSupEntity = map.get(ioOrderDetailResultEntity.getBindRlFk());
|
|
|
|
|
if (udiRlSupEntity != null) {
|
|
|
|
|
ioOrderDetailResultEntity1.setBindRlFk(udiRlSupEntity.getId());
|
|
|
|
|
ioOrderDetailResultEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + "");
|
|
|
|
@ -229,7 +232,7 @@ public class IoOrderUtilsService {
|
|
|
|
|
for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) {
|
|
|
|
|
|
|
|
|
|
ioOrderInvoiceEntity1.setOrderIdFk(billNO);
|
|
|
|
|
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderInvoiceEntity.getBindRlFk());
|
|
|
|
|
ioOrderUploadRequest udiRlSupEntity = map.get(ioOrderInvoiceEntity.getBindRlFk());
|
|
|
|
|
if (udiRlSupEntity != null) {
|
|
|
|
|
ioOrderInvoiceEntity1.setBindRlFk(udiRlSupEntity.getId() + "");
|
|
|
|
|
} else {
|
|
|
|
|