From d14f2dbefd6c29ec5a545b31d03a893234deff59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 15 Jun 2023 19:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E4=B8=8A=E4=BC=A0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/auth/LoginController.java | 12 +- .../com/glxp/api/dao/basic/UdiRlSupDao.java | 3 + .../api/entity/inout/IoCodeTempEntity.java | 1 + .../FilterCompanyProductRelevanceRequest.java | 1 + .../api/res/inout/PlatformLinkResponse.java | 44 +++ .../api/res/inout/ioUploadOrderResponse.java | 18 ++ .../service/inout/IoOrderUtilsService.java | 290 ++++++++++++++++++ .../mybatis/mapper/basic/UdiRlSupDao.xml | 21 ++ 8 files changed, 389 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/glxp/api/res/inout/PlatformLinkResponse.java create mode 100644 src/main/java/com/glxp/api/res/inout/ioUploadOrderResponse.java create mode 100644 src/main/java/com/glxp/api/service/inout/IoOrderUtilsService.java diff --git a/src/main/java/com/glxp/api/controller/auth/LoginController.java b/src/main/java/com/glxp/api/controller/auth/LoginController.java index c1064035..7b975529 100644 --- a/src/main/java/com/glxp/api/controller/auth/LoginController.java +++ b/src/main/java/com/glxp/api/controller/auth/LoginController.java @@ -18,6 +18,8 @@ import com.glxp.api.req.auth.PCLoginRequest; import com.glxp.api.req.auth.UpdatePasswordRequest; import com.glxp.api.res.auth.LoginResponse; import com.glxp.api.res.auth.LoginUserInfoResponse; +import com.glxp.api.res.inout.ioUploadOrderResponse; +import com.glxp.api.service.inout.IoOrderUtilsService; import com.glxp.api.service.system.CompanyService; import com.glxp.api.service.monitor.LogininforService; import com.glxp.api.common.enums.ResultEnum; @@ -25,7 +27,6 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.service.auth.*; import com.glxp.api.util.*; -import com.glxp.api.vo.inv.InvWarehouseTreeVo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -65,6 +66,8 @@ public class LoginController extends BaseController { private DeptService deptService; @Resource WarehouseBussinessTypeService warehouseBussinessTypeService; + @Resource + IoOrderUtilsService ioOrderUtilsService; /** @@ -382,6 +385,13 @@ public class LoginController extends BaseController { return ResultVOUtils.success(data); } + @PostMapping("/spms/sub/inv/warehouse/addOrder") + public BaseResponse addOrder(@RequestBody ioUploadOrderResponse ioUploadOrderRespons) { + + ioOrderUtilsService.getIoder(ioUploadOrderRespons); + return ResultVOUtils.success(); + } + diff --git a/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java b/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java index e7ed0d6b..c44a0d79 100644 --- a/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java +++ b/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java @@ -51,4 +51,7 @@ public interface UdiRlSupDao extends BaseMapperPlus filterCompanyProduct(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest); } diff --git a/src/main/java/com/glxp/api/entity/inout/IoCodeTempEntity.java b/src/main/java/com/glxp/api/entity/inout/IoCodeTempEntity.java index a1e36018..2d0c9c30 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoCodeTempEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoCodeTempEntity.java @@ -4,6 +4,7 @@ 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.JsonIdentityReference; import lombok.Data; import java.util.Date; diff --git a/src/main/java/com/glxp/api/req/basic/FilterCompanyProductRelevanceRequest.java b/src/main/java/com/glxp/api/req/basic/FilterCompanyProductRelevanceRequest.java index 31467b96..522152d8 100644 --- a/src/main/java/com/glxp/api/req/basic/FilterCompanyProductRelevanceRequest.java +++ b/src/main/java/com/glxp/api/req/basic/FilterCompanyProductRelevanceRequest.java @@ -13,4 +13,5 @@ public class FilterCompanyProductRelevanceRequest extends ListPageRequest { private String unitFk; private String lastUpdateTime; private String key; + private String nameCode; } diff --git a/src/main/java/com/glxp/api/res/inout/PlatformLinkResponse.java b/src/main/java/com/glxp/api/res/inout/PlatformLinkResponse.java new file mode 100644 index 00000000..29c43fdd --- /dev/null +++ b/src/main/java/com/glxp/api/res/inout/PlatformLinkResponse.java @@ -0,0 +1,44 @@ +package com.glxp.api.res.inout; + +import lombok.Data; + +/** + * 往来单位关联自助平台数据实体类 + */ +@Data +public class PlatformLinkResponse { + + //往来单位ID + private Long id; + //往来单位编码 + private String unitId; + //往来单位名称 + private String corpName; + //往来单位类型 + private Integer corpType; + //拼音码 + private String pinyinCode; + //自助平台名称 + private String platformName; + //自助平台ID + private String platformId; + + private String socurceName; + + //本地单据类型 + private String sourceAction; + private String sourceName; + //目标单据类型 + private String targetAction; + private String targetName; + + private String invCode; + private String invName; + private String invSubCode; + private String invSubName; + + private String name; + private String host; + private String appid; + private String secretKey; +} diff --git a/src/main/java/com/glxp/api/res/inout/ioUploadOrderResponse.java b/src/main/java/com/glxp/api/res/inout/ioUploadOrderResponse.java new file mode 100644 index 00000000..064696fa --- /dev/null +++ b/src/main/java/com/glxp/api/res/inout/ioUploadOrderResponse.java @@ -0,0 +1,18 @@ +package com.glxp.api.res.inout; + +import com.glxp.api.entity.inout.*; +import lombok.Data; +import java.util.List; + +@Data +public class ioUploadOrderResponse { + + private List ioOrderDetailCodeEntityList; + private List ioCodeTempEntityList; + private IoOrderEntity ioOrderEntity; + private PlatformLinkResponse platformLinkRespons; + private List ioOrderDetailBizEntityList; + private List ioOrderDetailResultEntityList; + private List ioOrderInvoiceEntityList; + +} diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderUtilsService.java b/src/main/java/com/glxp/api/service/inout/IoOrderUtilsService.java new file mode 100644 index 00000000..a38a65ae --- /dev/null +++ b/src/main/java/com/glxp/api/service/inout/IoOrderUtilsService.java @@ -0,0 +1,290 @@ +package com.glxp.api.service.inout; + +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSON; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.Constant; +import com.glxp.api.dao.auth.AuthAdminDao; +import com.glxp.api.dao.basic.UdiRlSupDao; +import com.glxp.api.dao.inout.*; +import com.glxp.api.entity.auth.AuthAdmin; +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.res.inout.PlatformLinkResponse; +import com.glxp.api.res.inout.ioUploadOrderResponse; +import com.glxp.api.util.BeanCopyUtils; +import com.glxp.api.util.FileUtils; +import com.glxp.api.util.GennerOrderUtils; +import com.glxp.api.util.OrderNoTypeBean; +import org.apache.catalina.User; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.*; + +@Service +public class IoOrderUtilsService { + + @Resource + AuthAdminDao authAdminDao; + @Resource + private GennerOrderUtils gennerOrderUtils; + @Resource + private UdiRlSupDao udiRlSupDao; + @Resource + private IoOrderService ioOrderService; + @Resource + private IoOrderDetailCodeDao ioOrderDetailCodeDao; + @Resource + private IoOrderDetailBizDao ioOrderDetailBizDao; + @Resource + private IoCodeTempDao ioCodeTempDao; + @Resource + private IoOrderDetailResultDao ioOrderDetailResultDao; + @Resource + private IoOrderInvoiceMapper ioOrderInvoiceMapper; + @Value("${file_path}") + private String filePath; + + public boolean getIoder(ioUploadOrderResponse ioUploadOrderRespons) { + + List ioOrderDetailCodeEntityList = ioUploadOrderRespons.getIoOrderDetailCodeEntityList(); + List ioCodeTempEntityList = ioUploadOrderRespons.getIoCodeTempEntityList(); + IoOrderEntity ioOrderEntity = ioUploadOrderRespons.getIoOrderEntity(); + PlatformLinkResponse platformLinkRespons = ioUploadOrderRespons.getPlatformLinkRespons(); + List ioOrderDetailBizEntityList = ioUploadOrderRespons.getIoOrderDetailBizEntityList(); + List ioOrderDetailResultEntityList = ioUploadOrderRespons.getIoOrderDetailResultEntityList(); + List ioOrderInvoiceEntityList = ioUploadOrderRespons.getIoOrderInvoiceEntityList(); + + //用来存储耗材字典结果集避免重复查询数据库 + Map map = new HashMap<>(); + Boolean checkUdi = false; //判断是不是有错误 + + //根据供应商id查询用户id + AuthAdmin authAdmins = authAdminDao.findByCustomerld(platformLinkRespons.getUnitId()).get(0); + + //单据表生成 + String billNO = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd")); + + + //扫码明细表生成 + FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest(); + IoCodeTempEntity ioCodeTempEntity1 = new IoCodeTempEntity(); + List ioCodeTempEntities = new ArrayList<>(); + for (IoCodeTempEntity ioCodeTempEntity : ioCodeTempEntityList) { + + //查询物资信息 + filterCompanyProductRelevanceRequest.setCustomerId(Long.valueOf(platformLinkRespons.getUnitId())); + filterCompanyProductRelevanceRequest.setNameCode(ioCodeTempEntity.getNameCode()); + List 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)); + } + ioCodeTempEntity1.setOrderId(billNO); + ioCodeTempEntity1.setCode(ioCodeTempEntity.getCode()); + ioCodeTempEntity1.setMainAction(ioCodeTempEntity.getMainAction()); + ioCodeTempEntity1.setAction(platformLinkRespons.getTargetAction()); + ioCodeTempEntity1.setNameCode(ioCodeTempEntity.getNameCode()); + ioCodeTempEntity1.setBatchNo(ioCodeTempEntity.getBatchNo()); + ioCodeTempEntity1.setProduceDate(ioCodeTempEntity.getProduceDate()); + ioCodeTempEntity1.setExpireDate(ioCodeTempEntity.getExpireDate()); + ioCodeTempEntity1.setSerialNo(ioCodeTempEntity.getSerialNo()); + ioCodeTempEntity1.setPackageLevel(ioCodeTempEntity.getPackageLevel()); + ioCodeTempEntity1.setSupId(ioCodeTempEntity.getSupId()); + ioCodeTempEntity1.setCount(ioCodeTempEntity.getCount()); + ioCodeTempEntity1.setReCount(ioCodeTempEntity.getReCount()); + ioCodeTempEntity1.setDeptCode(platformLinkRespons.getInvCode()); + ioCodeTempEntity1.setInvCode(platformLinkRespons.getInvSubCode()); + ioCodeTempEntity1.setUpdateTime(new Date()); + ioCodeTempEntity1.setCreateTime(new Date()); + ioCodeTempEntities.add(ioCodeTempEntity1); + } + + //扫码单据生成 + IoOrderDetailCodeEntity ioOrderDetailCodeEntity1 = new IoOrderDetailCodeEntity(); + List ioOrderDetailCodeEntities = new ArrayList<>(); + for (IoOrderDetailCodeEntity ioOrderDetailCodeEntity : ioOrderDetailCodeEntityList) { + ioOrderDetailCodeEntity1.setOrderIdFk(billNO); + + UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailCodeEntity.getBindRlFk()); + if (udiRlSupEntity != null) { + ioOrderDetailCodeEntity1.setBindRlFk(udiRlSupEntity.getId()); + ioOrderDetailCodeEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + ""); + } else { + ioOrderDetailCodeEntity1.setBindRlFk(null); + ioOrderDetailCodeEntity1.setUuidFk(null); + } + ioOrderDetailCodeEntity1.setNameCode(ioOrderDetailCodeEntity.getNameCode()); + ioOrderDetailCodeEntity1.setBatchNo(ioOrderDetailCodeEntity.getBatchNo()); + ioOrderDetailCodeEntity1.setProductDate(ioOrderDetailCodeEntity.getProductDate()); + ioOrderDetailCodeEntity1.setExpireDate(ioOrderDetailCodeEntity.getExpireDate()); + ioOrderDetailCodeEntity1.setCoName(ioOrderDetailCodeEntity.getCoName()); + ioOrderDetailCodeEntity1.setCertCode(ioOrderDetailCodeEntity.getCertCode()); + ioOrderDetailCodeEntity1.setYlqxzcrbarmc(ioOrderDetailCodeEntity.getYlqxzcrbarmc()); + ioOrderDetailCodeEntity1.setManufacturer(ioOrderDetailCodeEntity.getManufacturer()); + ioOrderDetailCodeEntity1.setMeasname(ioOrderDetailCodeEntity.getMeasname()); + ioOrderDetailCodeEntity1.setPrice(ioOrderDetailCodeEntity.getPrice()); + ioOrderDetailCodeEntity1.setSpec(ioOrderDetailCodeEntity.getSpec()); + ioOrderDetailCodeEntity1.setCertCode(ioOrderDetailCodeEntity.getCertCode()); + ioOrderDetailCodeEntity1.setSupId(ioOrderDetailCodeEntity.getSupId()); + ioOrderDetailCodeEntity1.setBindSupStatus(ioOrderDetailCodeEntity.getBindSupStatus()); + ioOrderDetailCodeEntity1.setCount(ioOrderDetailCodeEntity.getCount()); + ioOrderDetailCodeEntity1.setReCount(ioOrderDetailCodeEntity.getReCount()); + ioOrderDetailCodeEntity1.setUpdateTime(new Date()); + ioOrderDetailCodeEntities.add(ioOrderDetailCodeEntity1); + } + + //业务单生成 + IoOrderDetailBizEntity ioOrderDetailBizEntity1 = new IoOrderDetailBizEntity(); + List ioOrderDetailBizEntities = new ArrayList<>(); + if (ioOrderDetailBizEntityList != null && ioOrderDetailBizEntityList.size() > 0) { + for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderDetailBizEntityList) { + + ioOrderDetailBizEntity1.setOrderIdFk(billNO); + + UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailBizEntity.getBindRlFk()); + if (udiRlSupEntity != null) { + ioOrderDetailBizEntity1.setBindRlFk(udiRlSupEntity.getId()); + ioOrderDetailBizEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + ""); + } else { + ioOrderDetailBizEntity1.setBindRlFk(null); + ioOrderDetailBizEntity1.setUuidFk(null); + } + + ioOrderDetailBizEntity1.setNameCode(ioOrderDetailBizEntity.getNameCode()); + ioOrderDetailBizEntity1.setBatchNo(ioOrderDetailBizEntity.getBatchNo()); + ioOrderDetailBizEntity1.setProductDate(ioOrderDetailBizEntity.getProductDate()); + ioOrderDetailBizEntity1.setExpireDate(ioOrderDetailBizEntity.getExpireDate()); + ioOrderDetailBizEntity1.setCoName(ioOrderDetailBizEntity.getCoName()); + ioOrderDetailBizEntity1.setCertCode(ioOrderDetailBizEntity.getCertCode()); + ioOrderDetailBizEntity1.setYlqxzcrbarmc(ioOrderDetailBizEntity.getYlqxzcrbarmc()); + ioOrderDetailBizEntity1.setManufacturer(ioOrderDetailBizEntity.getManufacturer()); + ioOrderDetailBizEntity1.setMeasname(ioOrderDetailBizEntity.getMeasname()); + ioOrderDetailBizEntity1.setPrice(ioOrderDetailBizEntity.getPrice()); + ioOrderDetailBizEntity1.setSpec(ioOrderDetailBizEntity.getSpec()); + ioOrderDetailBizEntity1.setCertCode(ioOrderDetailBizEntity.getCertCode()); + ioOrderDetailBizEntity1.setSupId(ioOrderDetailBizEntity.getSupId()); + ioOrderDetailBizEntity1.setBindSupStatus(ioOrderDetailBizEntity.getBindSupStatus()); + ioOrderDetailBizEntity1.setCount(ioOrderDetailBizEntity.getCount()); + ioOrderDetailBizEntities.add(ioOrderDetailBizEntity1); + } + } + + + //实际单据生成 + IoOrderDetailResultEntity ioOrderDetailResultEntity1 = new IoOrderDetailResultEntity(); + List ioOrderDetailResultEntities = new ArrayList<>(); + if (ioOrderDetailResultEntityList != null && ioOrderDetailResultEntityList.size() > 0) { + for (IoOrderDetailResultEntity ioOrderDetailResultEntity : ioOrderDetailResultEntityList) { + + ioOrderDetailResultEntity1.setOrderIdFk(billNO); + + UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailResultEntity.getBindRlFk()); + if (udiRlSupEntity != null) { + ioOrderDetailResultEntity1.setBindRlFk(udiRlSupEntity.getId()); + ioOrderDetailResultEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + ""); + } else { + ioOrderDetailResultEntity1.setBindRlFk(null); + ioOrderDetailResultEntity1.setUuidFk(null); + } + + ioOrderDetailResultEntity1.setNameCode(ioOrderDetailResultEntity.getNameCode()); + ioOrderDetailResultEntity1.setBatchNo(ioOrderDetailResultEntity.getBatchNo()); + ioOrderDetailResultEntity1.setProductDate(ioOrderDetailResultEntity.getProductDate()); + ioOrderDetailResultEntity1.setExpireDate(ioOrderDetailResultEntity.getExpireDate()); + ioOrderDetailResultEntity1.setCoName(ioOrderDetailResultEntity.getCoName()); + ioOrderDetailResultEntity1.setCertCode(ioOrderDetailResultEntity.getCertCode()); + ioOrderDetailResultEntity1.setYlqxzcrbarmc(ioOrderDetailResultEntity.getYlqxzcrbarmc()); + ioOrderDetailResultEntity1.setManufacturer(ioOrderDetailResultEntity.getManufacturer()); + ioOrderDetailResultEntity1.setMeasname(ioOrderDetailResultEntity.getMeasname()); + ioOrderDetailResultEntity1.setPrice(ioOrderDetailResultEntity.getPrice()); + ioOrderDetailResultEntity1.setSpec(ioOrderDetailResultEntity.getSpec()); + ioOrderDetailResultEntity1.setCertCode(ioOrderDetailResultEntity.getCertCode()); + ioOrderDetailResultEntity1.setSupId(ioOrderDetailResultEntity.getSupId()); + ioOrderDetailResultEntity1.setBindSupStatus(ioOrderDetailResultEntity.getBindSupStatus()); + ioOrderDetailResultEntity1.setCount(ioOrderDetailResultEntity.getCount()); + ioOrderDetailResultEntities.add(ioOrderDetailResultEntity1); + } + } + + //发票生成 + IoOrderInvoiceEntity ioOrderInvoiceEntity1 = new IoOrderInvoiceEntity(); + List ioOrderInvoiceEntities = new ArrayList<>(); + if (ioOrderInvoiceEntityList != null && ioOrderInvoiceEntityList.size() > 0) { + for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) { + + ioOrderInvoiceEntity1.setOrderIdFk(billNO); + UdiRlSupEntity udiRlSupEntity = map.get(ioOrderInvoiceEntity.getBindRlFk()); + if (udiRlSupEntity != null) { + ioOrderInvoiceEntity1.setBindRlFk(udiRlSupEntity.getId() + ""); + } else { + ioOrderInvoiceEntity1.setBindRlFk(null); + } + + ioOrderInvoiceEntity1.setBatchNo(ioOrderInvoiceEntity.getBatchNo()); + ioOrderInvoiceEntity1.setProductDate(ioOrderInvoiceEntity.getProductDate()); + ioOrderInvoiceEntity1.setExpireDate(ioOrderInvoiceEntity.getExpireDate()); + ioOrderInvoiceEntity1.setMachineNo(ioOrderInvoiceEntity.getMachineNo()); + ioOrderInvoiceEntity1.setInvoiceCode(ioOrderInvoiceEntity.getInvoiceCode()); + ioOrderInvoiceEntity1.setInvoiceEncode(ioOrderInvoiceEntity.getInvoiceEncode()); + ioOrderInvoiceEntity1.setInvoiceDate(ioOrderInvoiceEntity.getInvoiceDate()); + ioOrderInvoiceEntity1.setPrice(ioOrderInvoiceEntity.getPrice()); + ioOrderInvoiceEntity1.setUpdateTime(new Date()); + ioOrderInvoiceEntity1.setCreateTime(new Date()); + ioOrderInvoiceEntity1.setUpdateUser(authAdmins.getId() + ""); + ioOrderInvoiceEntity1.setCreateUser(authAdmins.getId() + ""); + ioOrderInvoiceEntity1.setLicenseUrl(ioOrderInvoiceEntity.getLicenseUrl()); + ioOrderInvoiceEntities.add(ioOrderInvoiceEntity1); + } + } + + //生成单据 + IoOrderEntity ioOrderEntity1 = new IoOrderEntity(); + ioOrderEntity1.setBillNo(billNO); + ioOrderEntity1.setMainAction(ioOrderEntity.getMainAction()); + ioOrderEntity1.setAction(platformLinkRespons.getTargetAction()); + ioOrderEntity1.setFromCorp(ioOrderEntity.getFromCorp()); + ioOrderEntity1.setFromCorp(ioOrderEntity.getFromCorp()); + ioOrderEntity1.setFromDeptCode(ioOrderEntity.getFromDeptCode()); + ioOrderEntity1.setFromInvCode(ioOrderEntity.getFromInvCode()); + ioOrderEntity1.setFromType(1); + if (!checkUdi) { + ioOrderEntity1.setStatus(1); + ioOrderEntity1.setDealStatus(1); + } else { + ioOrderEntity1.setStatus(3); + ioOrderEntity1.setDealStatus(1); + ioOrderEntity1.setRemark("产品错误!"); + } + ioOrderEntity1.setCreateTime(new Date()); + ioOrderEntity1.setCreateUser(authAdmins.getId() + ""); + ioOrderEntity1.setUpdateUser(authAdmins.getId() + ""); + ioOrderEntity1.setUpdateTime(new Date()); + ioOrderEntity1.setCustomerId(platformLinkRespons.getUnitId()); + ioOrderEntity1.setDeptCode(platformLinkRespons.getInvCode()); + ioOrderEntity1.setInvCode(platformLinkRespons.getInvSubCode()); + + //结果插入 + ioOrderService.insertOrder(ioOrderEntity1); + ioOrderDetailBizDao.insertIgnoreBatchs(ioOrderDetailBizEntities); + ioOrderDetailCodeDao.insertIgnoreBatchs(ioOrderDetailCodeEntities); + ioCodeTempDao.insertIgnoreBatchs(ioCodeTempEntities); + ioOrderDetailResultDao.insertIgnoreBatchs(ioOrderDetailResultEntities); + ioOrderInvoiceMapper.insertIgnoreBatchs(ioOrderInvoiceEntities); + return true; + } + +} diff --git a/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml index 2cbd3b73..e7e270df 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml @@ -368,4 +368,25 @@ + +