单据上传功能代码提交

dev
郑明梁 2 years ago
parent 8f11acd645
commit 5236bfaf39

@ -4,6 +4,7 @@ import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
import com.glxp.api.req.inout.ioOrderUploadRequest;
import com.glxp.api.res.basic.UdiRlSupResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -53,5 +54,5 @@ public interface UdiRlSupDao extends BaseMapperPlus<UdiRlSupDao, UdiRlSupEntity,
Long selectSupRlCount(CompanyProductRelevanceRequest companyProductRelevanceRequest);
List<UdiRlSupEntity> filterCompanyProduct(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
List<ioOrderUploadRequest> filterCompanyProduct(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
}

@ -1,11 +1,14 @@
package com.glxp.api.entity.inout;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
import java.io.Serializable;
import java.util.Date;

@ -0,0 +1,10 @@
package com.glxp.api.req.inout;
import lombok.Data;
@Data
public class ioOrderUploadRequest {
private long id;
private String udiRlIdFk;
}

@ -8,7 +8,7 @@ import java.util.List;
public class ioUploadOrderResponse {
private List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntityList;
private List<IoCodeTempEntity> ioCodeTempEntityList;
private List<IoCodeEntity> ioCodeEntityList;
private IoOrderEntity ioOrderEntity;
private PlatformLinkResponse platformLinkRespons;
private List<IoOrderDetailBizEntity> ioOrderDetailBizEntityList;

@ -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 {

@ -379,7 +379,7 @@
</select>
<select id="filterCompanyProduct" parameterType="com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest"
resultType="com.glxp.api.entity.basic.UdiRlSupEntity">
resultType="com.glxp.api.req.inout.ioOrderUploadRequest">
SELECT
basic_udirel.id,
basic_udirel.uuid as udiRlIdFk

Loading…
Cancel
Save