diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IBdPurorgDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IBdPurorgDao.java new file mode 100644 index 00000000..ed13bca3 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IBdPurorgDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.lets.dao; + +import com.hzya.frame.plugin.lets.entity.BdPurorgEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * (BD_PURORG: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-20 14:20:10 + */ +public interface IBdPurorgDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdPurorgDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdPurorgDaoImpl.java new file mode 100644 index 00000000..14be7489 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdPurorgDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.lets.dao.impl; + +import com.hzya.frame.plugin.lets.entity.BdPurorgEntity; +import com.hzya.frame.plugin.lets.dao.IBdPurorgDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * (BdPurorg)表数据库访问层 + * + * @author makejava + * @since 2024-08-20 14:20:11 + */ +public class BdPurorgDaoImpl extends MybatisGenericDao implements IBdPurorgDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdPurorgEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdPurorgEntity.java new file mode 100644 index 00000000..75f6795e --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdPurorgEntity.java @@ -0,0 +1,178 @@ +package com.hzya.frame.plugin.lets.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * (BdPurorg)实体类 + * + * @author makejava + * @since 2024-08-20 14:20:11 + */ +public class BdPurorgEntity extends BaseEntity { + + private String code; + private String createdate; + private String def1; + private String def2; + private String def3; + private String def4; + private String def5; + private String dr; + private String memo; + private String mobile; + private String name; + private String officeaddr; + private String ownercorp; + private String pkPurorg; + private String pkResppsn; + private String sealdate; + private String settlestockorg; + private String ts; + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreatedate() { + return createdate; + } + + public void setCreatedate(String createdate) { + this.createdate = createdate; + } + + public String getDef1() { + return def1; + } + + public void setDef1(String def1) { + this.def1 = def1; + } + + public String getDef2() { + return def2; + } + + public void setDef2(String def2) { + this.def2 = def2; + } + + public String getDef3() { + return def3; + } + + public void setDef3(String def3) { + this.def3 = def3; + } + + public String getDef4() { + return def4; + } + + public void setDef4(String def4) { + this.def4 = def4; + } + + public String getDef5() { + return def5; + } + + public void setDef5(String def5) { + this.def5 = def5; + } + + public String getDr() { + return dr; + } + + public void setDr(String dr) { + this.dr = dr; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOfficeaddr() { + return officeaddr; + } + + public void setOfficeaddr(String officeaddr) { + this.officeaddr = officeaddr; + } + + public String getOwnercorp() { + return ownercorp; + } + + public void setOwnercorp(String ownercorp) { + this.ownercorp = ownercorp; + } + + public String getPkPurorg() { + return pkPurorg; + } + + public void setPkPurorg(String pkPurorg) { + this.pkPurorg = pkPurorg; + } + + public String getPkResppsn() { + return pkResppsn; + } + + public void setPkResppsn(String pkResppsn) { + this.pkResppsn = pkResppsn; + } + + public String getSealdate() { + return sealdate; + } + + public void setSealdate(String sealdate) { + this.sealdate = sealdate; + } + + public String getSettlestockorg() { + return settlestockorg; + } + + public void setSettlestockorg(String settlestockorg) { + this.settlestockorg = settlestockorg; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdPurorgEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdPurorgEntity.xml new file mode 100644 index 00000000..4a0e32c5 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdPurorgEntity.xml @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + CODE + ,CREATEDATE + ,DEF1 + ,DEF2 + ,DEF3 + ,DEF4 + ,DEF5 + ,DR + ,MEMO + ,MOBILE + ,NAME + ,OFFICEADDR + ,OWNERCORP + ,PK_PURORG + ,PK_RESPPSN + ,SEALDATE + ,SETTLESTOCKORG + ,TS + + + + + + + + + + + + + + + + insert into BD_PURORG( + + CODE , + CREATEDATE , + DEF1 , + DEF2 , + DEF3 , + DEF4 , + DEF5 , + DR , + MEMO , + MOBILE , + NAME , + OFFICEADDR , + OWNERCORP , + PK_PURORG , + PK_RESPPSN , + SEALDATE , + SETTLESTOCKORG , + TS , + sorts, + + + )values( + + #{code} , + #{createdate} , + #{def1} , + #{def2} , + #{def3} , + #{def4} , + #{def5} , + #{dr} , + #{memo} , + #{mobile} , + #{name} , + #{officeaddr} , + #{ownercorp} , + #{pkPurorg} , + #{pkResppsn} , + #{sealdate} , + #{settlestockorg} , + #{ts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from BD_PURORG a WHERE a.sts = 'Y' ), +-- 'Y', + + ) + + + + insert into BD_PURORG(CODE, CREATEDATE, DEF1, DEF2, DEF3, DEF4, DEF5, DR, MEMO, MOBILE, NAME, OFFICEADDR, OWNERCORP, PK_RESPPSN, SEALDATE, SETTLESTOCKORG, TS) + values + + (#{entity.code},#{entity.createdate},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.dr},#{entity.memo},#{entity.mobile},#{entity.name},#{entity.officeaddr},#{entity.ownercorp},#{entity.pkResppsn},#{entity.sealdate},#{entity.settlestockorg},#{entity.ts}) + + + + + insert into BD_PURORG(CODE, CREATEDATE, DEF1, DEF2, DEF3, DEF4, DEF5, DR, MEMO, MOBILE, NAME, OFFICEADDR, OWNERCORP, PK_RESPPSN, SEALDATE, SETTLESTOCKORG, TS) + values + + (#{entity.code},#{entity.createdate},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.dr},#{entity.memo},#{entity.mobile},#{entity.name},#{entity.officeaddr},#{entity.ownercorp},#{entity.pkResppsn},#{entity.sealdate},#{entity.settlestockorg},#{entity.ts}) + + on duplicate key update + CODE = values(CODE), + CREATEDATE = values(CREATEDATE), + DEF1 = values(DEF1), + DEF2 = values(DEF2), + DEF3 = values(DEF3), + DEF4 = values(DEF4), + DEF5 = values(DEF5), + DR = values(DR), + MEMO = values(MEMO), + MOBILE = values(MOBILE), + NAME = values(NAME), + OFFICEADDR = values(OFFICEADDR), + OWNERCORP = values(OWNERCORP), + PK_RESPPSN = values(PK_RESPPSN), + SEALDATE = values(SEALDATE), + SETTLESTOCKORG = values(SETTLESTOCKORG), + TS = values(TS) + + +update BD_PURORG set + + CODE = #{code}, + CREATEDATE = #{createdate}, + DEF1 = #{def1}, + DEF2 = #{def2}, + DEF3 = #{def3}, + DEF4 = #{def4}, + DEF5 = #{def5}, + DR = #{dr}, + MEMO = #{memo}, + MOBILE = #{mobile}, + NAME = #{name}, + OFFICEADDR = #{officeaddr}, + OWNERCORP = #{ownercorp}, + PK_RESPPSN = #{pkResppsn}, + SEALDATE = #{sealdate}, + SETTLESTOCKORG = #{settlestockorg}, + TS = #{ts}, + +where PK_PURORG = #{pkPurorg} + + + +update BD_PURORG set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where PK_PURORG = #{pkPurorg} + + + +update BD_PURORG set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and CODE = #{code} + and CREATEDATE = #{createdate} + and DEF1 = #{def1} + and DEF2 = #{def2} + and DEF3 = #{def3} + and DEF4 = #{def4} + and DEF5 = #{def5} + and DR = #{dr} + and MEMO = #{memo} + and MOBILE = #{mobile} + and NAME = #{name} + and OFFICEADDR = #{officeaddr} + and OWNERCORP = #{ownercorp} + and PK_PURORG = #{pkPurorg} + and PK_RESPPSN = #{pkResppsn} + and SEALDATE = #{sealdate} + and SETTLESTOCKORG = #{settlestockorg} + and TS = #{ts} + and sts='Y' + + + + + delete from BD_PURORG where PK_PURORG = #{pkPurorg} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java new file mode 100644 index 00000000..53c62e27 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java @@ -0,0 +1,505 @@ +package com.hzya.frame.plugin.lets.plugin.purchase; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.beanutil.BeanUtil; +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +import com.hzya.frame.plugin.lets.dao.*; +import com.hzya.frame.plugin.lets.entity.*; +import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; +import com.hzya.frame.plugin.lets.u8cdto.PoOrderChildrenDto; +import com.hzya.frame.plugin.lets.u8cdto.PoOrderParentChildrenDto; +import com.hzya.frame.plugin.lets.u8cdto.PoOrderParentDto; +import com.hzya.frame.plugin.lets.u8cdto.PoOrderSonDto; +import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; +import com.hzya.frame.ttxofs.dto.InterfaceParamDto; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader; +import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 代理品牌采购退货业务:(代理品牌采购退货)OFS销退出库单生成U8C红字采购订单 + * + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.plugin.purchase + * @Project:kangarooDataCenterV3 + * @name:ProxyPurchase + * @Date:2024/8/19 18:01 + * @Filename:ProxyPurchase + */ +public class ProxyPurchaseReturn extends PluginBaseEntity { + + Logger logger = LoggerFactory.getLogger(ProxyPurchaseReturn.class); + + @Autowired + private OfsUnifiedService ofsUnifiedService; + + @Autowired + private QueryBdBusitypeUtil queryBdBusitypeUtil; + + @Autowired + private IBdCorpDao iBdCorpDao; + + @Autowired + private IBdDeptdocDao iBdDeptdocDao; + + @Autowired + private IBdPurorgDao iBdPurorgDao; + + @Autowired + private IBdCubasdocDao iBdCubasdocDao; + + @Autowired + private IBdCumandocDao iBdCumandocDao; + + @Autowired + private IBdInvmandocDao iBdInvmandocDao; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseReturn"; + } + + @Override + public String getPluginName() { + return "OFS销退出库单生成U8C红字采购订单(代理品牌采购退货)"; + } + + @Override + public String getPluginLabel() { + return "OFS销退出库单生成U8C红字采购订单(代理品牌采购退货)"; + } + + @Override + public String getPluginType() { + return "3"; + } + + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + return null; + } + + /** + * 根据单号查询 + * + * @author liuyang + */ + public void startImplement(String code) { + String threadNameStr = StrUtil.format("(代理品牌采购)OFS采购入库单生成U8C采购订单 售后入库单号", code); + logger.info(threadNameStr); + + Thread thread = new Thread(new Runnable() { + @Override + public void run() { + try { + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setCode(code); + queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE_RETURN"); + queryOfsSoSaleOutVo.setStatus(900L); + queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); + logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + getSet(returnGoodHeaderDetailsDataDtoArrayList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } + } catch (Exception e) { + logger.error("startImplement方法抛出异常", e); + } + } + }, threadNameStr); + thread.start(); + try { + thread.join(); + } catch (Exception e) { + logger.error("thread.join()异常", e); + } + } + + /** + * 查询OFS售后退货入库单 + * + * @param queryOfsSoSaleOutVo 查询参数 + * @param headerDetailsDtoList 查询结果集 + * @param pageNo 从第pageNo页开始查询 + */ + private void queryOfsReturnGoods(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List headerDetailsDtoList, Long pageNo) throws Exception { + Long pageSize = 200L; + queryOfsSoSaleOutVo.setPageNo(pageNo); + queryOfsSoSaleOutVo.setPageSize(pageSize); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.shipment.search"); + interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo)); + ofsUnifiedService.unified(interfaceParamDto); + } + + /** + * 环境预配置 + * + * @param returnGoodHeaderDetailsDataDtoArrayList 采购入库单 + * @author liuyang + */ + private void getSet(List returnGoodHeaderDetailsDataDtoArrayList) throws Exception { + //过滤成功的数据 + List stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList); + //执行推送主逻辑 + implement(stockinOrderList); + } + + /** + * 过滤掉成功的数据 + * + * @author liuyang + */ + private List filterData(List returnGoodHeaderDetailsDataDtoArrayList) { + List headerDetailsDtoList1 = new ArrayList<>(); + if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + //TODO 出库单明细主键,需要O返回,目前没有,已经提需求 + headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoArrayList); + } + return headerDetailsDtoList1; + } + + /** + * 执行主逻辑 + * + * @author liuyang + */ + private void implement(List returnGoodHeaderDetailsDataDtoList) throws Exception { + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { + try { + // 查询基本档案 + List poOrderSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList); + // 代理品牌采购业务流程 + BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow(); + + if (poOrderSonDtos != null && poOrderSonDtos.size() > 0) { + for (int i = 0; i < poOrderSonDtos.size(); i++) { + PoOrderSonDto poOrderSonDto = poOrderSonDtos.get(i); + List details = poOrderSonDto.getDetails(); + + //生成业务日期 + String generateBusinessDate = createGenerateBusinessDate(poOrderSonDto); + + BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司、收货公司 + BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门 + BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织 + BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity(); + BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商档案-供应商 + + OfsPoOrderData ofsPoOrderData = poOrderSonDto.getOfsPoOrderData();//OFS采购订单 + OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader(); + List ofsPoOrderDataDetails = ofsPoOrderData.getDetails(); + + //采购订单表头 + PoOrderParentDto poOrderParentDto = new PoOrderParentDto(); + poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程 + poOrderParentDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//采购部门 + poOrderParentDto.setCoperator("0001A110000000000U3D");//制单人 + poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());//采购组织 + poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());//采购公司 + poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());//供应商管理档案 + poOrderParentDto.setDauditdate(generateBusinessDate);//审批日期 + poOrderParentDto.setDorderdate(generateBusinessDate);//订单日期 + poOrderParentDto.setDrevisiondate(generateBusinessDate);//修改日期 + + //采购订单明细行 + List poOrderChildrenDtoList = new ArrayList<>(); + + for (int j = 0; j < details.size(); j++) { + StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j); + + //2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑 + BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp()); + String receivedQty = stockinB.getReceivedQty();//实收数量 + + //原币含税单价 + try { +// noriginalcurprice = noriginalcurtaxprice.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP); + } catch (Exception e) { + logger.error("计算采购入库单原币含税单价失败", e); + Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage()); + } + + + PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto(); + poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id + poOrderChildrenDto.setNordernum(receivedQty);//订货数量 +// poOrderChildrenDto.setNorgtaxprice();//原币含税单价 +// poOrderChildrenDto.setPk_arrvcorp();//收货公司 +// poOrderChildrenDto.setPk_arrvstoorg();//收货库存组织 +// poOrderChildrenDto.setCwarehouseid();//收货仓库 + poOrderChildrenDtoList.add(poOrderChildrenDto); + + //2024年8月20日 16:00:03 已经和佳妮总确认,计划到货日期,不用进行传递 + } + + PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto(); + poOrderParentChildrenDto.setParentvo(poOrderParentDto); + poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList); + + } + } else { + logger.info("poOrderSonDto.size为0!"); + } + } catch (Exception e) { + logger.error("implement方法抛出异常", e); + } + } + } + + /** + * 档案转换 + * + * @author liuyang + */ + private List queryBasicArchives(List returnGoodHeaderDetailsDataDtoList) { + List poOrderSonDtoArrayList = new ArrayList<>(); + + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { + try { + for (int i = 0; i < returnGoodHeaderDetailsDataDtoList.size(); i++) { + StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoList.get(i); + StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader(); + List details = stockinOrder.getDetails(); + + //采购公司 + String companyCode = header.getCompanyCode(); + Assert.notNull(companyCode, "O表头公司不能为空"); + BdCorpEntity bdCorpEntity = new BdCorpEntity(); + bdCorpEntity.setDr(0); + bdCorpEntity.setDataSourceCode("lets_u8c"); + bdCorpEntity.setUnitcode(companyCode); + List bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); + if (bdCorpEntityList.size() == 0) { + Assert.state(false, "根据O货主编码{},无法匹配到U8C销售公司", companyCode); + } else if (bdCorpEntityList.size() >= 2) { + Assert.state(false, "根据O货主编码{},匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size()); + } + + //采购部门:其他 + String deptName = "其他部门"; + BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); + bdDeptdocEntity.setDataSourceCode("lets_u8c"); + bdDeptdocEntity.setDr(0); + bdDeptdocEntity.setDeptname(deptName); + bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); + List bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); + if (bdDeptdocEntityList.size() == 0) { + Assert.state(false, "根据部门名称:{} 公司id:{},无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp()); + } else if (bdDeptdocEntityList.size() >= 2) { + Assert.state(false, "根据部门名称:{} 公司id:{},匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp()); + } + + //采购组织 + BdPurorgEntity bdPurorgEntity = new BdPurorgEntity(); + bdPurorgEntity.setDr("0"); + bdPurorgEntity.setDataSourceCode("lets_u8c"); + bdPurorgEntity.setOwnercorp(bdCorpEntityList.get(0).getPkCorp()); + List bdPurorgEntityList = iBdPurorgDao.query(bdPurorgEntity); + if (bdPurorgEntityList.size() == 0) { + Assert.state(false, "根据采购公司主键:{} 无法匹配到采购组织", bdCorpEntityList.get(0).getPkCorp()); + } else if (bdPurorgEntityList.size() >= 2) { + Assert.state(false, "根据采购公司主键:{} 匹配到多个采购组织", bdCorpEntityList.get(0).getPkCorp()); + } + + //客商基本档案(供应商类型) + //2024年8月20日 14:47:55 丽知商城、OFS 供应商客商档案、传递到U8C的客商, + //其中自定义项1作为原系统编码,因此统一传到自定义项一,已经和大家确认好了,没有关系的,放心大胆传吧,宝贝 + String shipFromCode = header.getShipFromCode(); + BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); + bdCubasdocEntity.setDataSourceCode("lets_u8c"); + bdCubasdocEntity.setDr(0L); + bdCubasdocEntity.setDef1(shipFromCode); + List bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); + if (bdCubasdocEntityList == null || bdCubasdocEntityList.size() == 0) { + Assert.state(false, "根据OFS供应商业务编码{},无法查询到U8C客商档案信息(供应商)", shipFromCode); + } else if (bdCubasdocEntityList.size() >= 2) { + Assert.state(false, "根据OFS供应商业务编码{},查询到多个U8C客商档案信息(供应商)", shipFromCode); + } + + //客商管理档案 + BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity(); + bdCumandocEntity1.setDataSourceCode("lets_u8c"); + bdCumandocEntity1.setDr(0L); + bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); + bdCumandocEntity1.setCustflags(ProfilesActiveConstant.SUPPLIER); + bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc()); + List bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); + if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) { + Assert.state(false, "根据客商基本档案主键{},无法匹配到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc()); + } else if (bdCumandocEntityList.size() >= 2) { + Assert.state(false, "根据客商基本档案主键{},匹配到多个客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc()); + } + + //查询OFS采购订单 + OfsPoOrderData ofsPoOrderData = queryOfsPoOrder(header.getRefOrderCode()); + + PoOrderSonDto poOrderSonDto = new PoOrderSonDto(); + poOrderSonDto.setBdCorpEntity(bdCorpEntityList.get(0)); + poOrderSonDto.setBdDeptdocEntity(bdDeptdocEntityList.get(0)); + poOrderSonDto.setBdPurorgEntity(bdPurorgEntityList.get(0)); + poOrderSonDto.setBdCubasdocEntity(bdCubasdocEntityList.get(0)); + poOrderSonDto.setBdCumandocEntity(bdCumandocEntityList.get(0)); + poOrderSonDto.setOfsPoOrderData(ofsPoOrderData); + + BeanUtil.copyPropertiesV2(poOrderSonDto, header); + poOrderSonDtoArrayList.add(poOrderSonDto); + } + //成功 + } catch (Exception e) { + logger.error("代理品牌采购入库单档案转换失败", e); + //失败 + } + } else { + logger.info("queryBasicArchives对应returnGoodHeaderDetailsDataDtoList.size为0"); + } + return poOrderSonDtoArrayList; + } + + /** + * 2024年8月6日 10:59:03 查询U8C业务流程 + * + * @author liuyang + */ + private BdBusitypeEntity u8cOperationFlow() throws Exception { + //查询业务流程 + //2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供 + String processName = "代理品牌采购"; + BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName); + Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName); + return bdBusitypeEntity; + } + + /** + * 2024年8月20日 15:46:10 + * 生成业务日期,以发货时间作为业务日期 + * + * @author liuyang + */ + private String createGenerateBusinessDate(PoOrderSonDto poOrderSonDto) { + if (poOrderSonDto != null && poOrderSonDto.getShipAt() != null) { + String shipAt = poOrderSonDto.getShipAt(); + String businessFormat = null; + try { + Date dbill = DateUtil.parse(shipAt); + businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); + } catch (Exception e) { + logger.error("业务日期生成失败", e); + } + return businessFormat; + } else { + logger.error("生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + Assert.state(false, "生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + return null; + } + } + + /** + * 查询存货管理档案 + * + * @param pkCorp 发货公司主键 + * @param stockinB 采购入库单明细行 + * @author liuyang + */ + private BdInvmandocEntity queryInventoryMan(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, String pkCorp) throws Exception { + Assert.notNull(stockinB, "sonDetailsDto不能为空"); + Assert.notNull(stockinB.getSkuCode(), "O存货商家编码不能为空"); + Assert.notNull(pkCorp, "发货公司主键不能为空"); + + BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity(); + bdInvmandocEntity.setInvcode(stockinB.getSkuCode()); + bdInvmandocEntity.setPkCorp(pkCorp); + List bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity); + if (bdInvmandocEntity2.size() == 0) { + Assert.state(false, "根据O商家编码:{} U8C发货公司主键:{}没有查询到存货管理档案", stockinB.getSkuCode(), pkCorp); + } else if (bdInvmandocEntity2.size() >= 2) { + Assert.state(false, "根据O商家编码:{} U8C发货公司主键:{}没有查询到存货管理档案", stockinB.getSkuCode(), pkCorp); + } + return bdInvmandocEntity2.get(0); + } + + /** + * 2024年8月20日 16:11:46 + * + * @author liuyang + */ + public OfsPoOrderData queryOfsPoOrder(String code) throws Exception { + if (code != null && !"".equals(code)) { + Long pageSize = 200L; + Long pageNo = 1L; + + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setPageNo(pageNo); + queryOfsSoSaleOutVo.setPageSize(pageSize); + queryOfsSoSaleOutVo.setCode(code); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.purchaseOrder.search"); + interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo)); + OfsPoOrderBean ofsPoOrderBean = (OfsPoOrderBean) ofsUnifiedService.unified(interfaceParamDto); + if (ofsPoOrderBean != null) { + if ("false".equals(ofsPoOrderBean.getError()) && "0".equals(ofsPoOrderBean.getCode()) && "Success".equals(ofsPoOrderBean.getMsg())) { + List data = ofsPoOrderBean.getData(); + if (data != null && data.size() > 0) { + return data.get(0); + } + } else { + logger.error("查询采购订单失败,失败原因:{}", JSON.toJSON(interfaceParamDto)); + } + } else { + logger.error("ofsPoOrderBean为空!interfaceParamDto接口入参:{}", JSON.toJSON(interfaceParamDto)); + } + } else { + Assert.state(false, "采购订单编码不能为空!"); + } + return null; + } + + /** + * 2024年8月20日 16:42:14 + * 查找对应的采购订单明细行 + * 2024年8月20日 17:42:15 + * 应该通过明细行主键匹配,但是只能根据sku匹配目前的实现逻辑 + * + * @param ofsPoOrderDataDetails OFS采购订单明细行所有对象 + * @param stockinB OFS采购入库单明细行对象 + * @author liuyang + */ + private void findOfsPoOrderDetail(List ofsPoOrderDataDetails, StockinOrderSearchResponse.StockinOrder.StockinB stockinB) { + if (ofsPoOrderDataDetails != null && ofsPoOrderDataDetails.size() > 0 && stockinB != null) { + + } + } +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehous.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehous.java index 02ca0b59..dd3f277d 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehous.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehous.java @@ -1,115 +1,631 @@ -//package com.hzya.frame.plugin.lets.plugin.purchase; -// -//import cn.hutool.core.util.StrUtil; -//import com.alibaba.fastjson.JSONObject; -//import com.hzya.frame.base.PluginBaseEntity; -//import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; -//import com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB; -//import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; -//import com.hzya.frame.plugin.lets.util.DateStrUtil; -//import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto; -//import com.hzya.frame.web.entity.JsonResultEntity; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -// -//import java.util.ArrayList; -//import java.util.List; -// -///** -// * 代理品牌采购业务:(代理品牌采购)OFS采购入库单生成U8C采购订单 -// * -// * @Author:liuyang -// * @Package:com.hzya.frame.plugin.lets.plugin.purchase -// * @Project:kangarooDataCenterV3 -// * @name:ProxyPurchase -// * @Date:2024/8/19 18:01 -// * @Filename:ProxyPurchase -// */ -//public class ProxyPurchaseWarehous extends PluginBaseEntity { -// -// Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehous.class); -// -// @Override -// public void initialize() { -// logger.info(getPluginLabel() + "執行初始化方法initialize()"); -// } -// -// @Override -// public void destroy() { -// logger.info(getPluginLabel() + "執行銷毀方法destroy()"); -// } -// -// @Override -// public String getPluginId() { -// return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous"; -// } -// -// @Override -// public String getPluginName() { -// return "OFS采购入库单生成U8C采购订单(代理品牌)"; -// } -// -// @Override -// public String getPluginLabel() { -// return "OFS采购入库单生成U8C采购订单(代理品牌)"; -// } -// -// @Override -// public String getPluginType() { -// return "3"; -// } -// -// @Override -// public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { -// return null; -// } -// -// /** -// * 根据指定时间范围拉取 -// * -// * @author liuyang -// */ -// public void startImplement(String startTime, String endTime) { -// String threadNameStr = StrUtil.format("(代理品牌采购)OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", dateStr, summaryOrderNumber); -// logger.info(threadNameStr); -// -// Thread thread = new Thread(new Runnable() { -// @Override -// public void run() { -// try { -// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); -// String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); -// -// List headerDetailsDtoList = new ArrayList<>(); -// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); -// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time()); -// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time()); -// queryOfsSoSaleOutVo.setClientCode("LETS"); -// queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); -//// queryOfsSoSaleOutVo.setCompanyCode("SHLZ"); -// queryOfsSoSaleOutVo.setStatus(900L); -// queryOfsSoSaleOutVo.setPageNo(1L); -// queryOfsSoSaleOutVo.setPageSize(50L); -// queryOfsSoSaleOutVo.setStoreCode(tobShop); -//// queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004"); -// queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L); -// logger.info("数据返回行数:{}", headerDetailsDtoList.size()); -// if (headerDetailsDtoList.size() > 0) { -// getSet(headerDetailsDtoList); -// } else { -// logger.info("没有查询到任何数据!不需要同步"); -// } -// } catch (Exception e) { -// logger.error("startImplement方法抛出异常", e); -// } -// } -// }, threadNameStr); -// thread.start(); -// try { -// thread.join(); -// } catch (Exception e) { -// logger.error("thread.join()异常", e); -// } -// } -// -//} \ No newline at end of file +package com.hzya.frame.plugin.lets.plugin.purchase; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.beanutil.BeanUtil; +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +import com.hzya.frame.plugin.lets.dao.*; +import com.hzya.frame.plugin.lets.entity.*; +import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; +import com.hzya.frame.plugin.lets.u8cdto.*; +import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; +import com.hzya.frame.ttxofs.dto.InterfaceParamDto; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader; +import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.math.BigDecimal; +import java.util.*; + +/** + * 代理品牌采购业务:(代理品牌采购)OFS采购入库单生成U8C采购订单 + * + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.plugin.purchase + * @Project:kangarooDataCenterV3 + * @name:ProxyPurchase + * @Date:2024/8/19 18:01 + * @Filename:ProxyPurchase + */ +public class ProxyPurchaseWarehous extends PluginBaseEntity { + + Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehous.class); + + @Autowired + private OfsUnifiedService ofsUnifiedService; + + @Autowired + private QueryBdBusitypeUtil queryBdBusitypeUtil; + + @Autowired + private IBdCorpDao iBdCorpDao; + + @Autowired + private IBdDeptdocDao iBdDeptdocDao; + + @Autowired + private IBdPurorgDao iBdPurorgDao; + + @Autowired + private IBdCubasdocDao iBdCubasdocDao; + + @Autowired + private IBdCumandocDao iBdCumandocDao; + + @Autowired + private IBdInvmandocDao iBdInvmandocDao; + + @Autowired + private IBdCalbodyDao iBdCalbodyDao; + + @Autowired + private IBdStordocDao iBdStordocDao; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous"; + } + + @Override + public String getPluginName() { + return "OFS采购入库单生成U8C采购订单(代理品牌)"; + } + + @Override + public String getPluginLabel() { + return "OFS采购入库单生成U8C采购订单(代理品牌)"; + } + + @Override + public String getPluginType() { + return "3"; + } + + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + return null; + } + + /** + * 根据单号查询 + * + * @author liuyang + */ + public void startImplement(String code) { + String threadNameStr = StrUtil.format("(代理品牌采购)OFS采购入库单生成U8C采购订单 售后入库单号", code); + logger.info(threadNameStr); + + Thread thread = new Thread(new Runnable() { + @Override + public void run() { + try { + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setCode(code); + queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE"); + queryOfsSoSaleOutVo.setStatus(900L); + queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); + logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + getSet(returnGoodHeaderDetailsDataDtoArrayList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } + } catch (Exception e) { + logger.error("startImplement方法抛出异常", e); + } + } + }, threadNameStr); + thread.start(); + try { + thread.join(); + } catch (Exception e) { + logger.error("thread.join()异常", e); + } + } + + /** + * 查询OFS售后退货入库单 + * + * @param queryOfsSoSaleOutVo 查询参数 + * @param headerDetailsDtoList 查询结果集 + * @param pageNo 从第pageNo页开始查询 + */ + private void queryOfsReturnGoods(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List headerDetailsDtoList, Long pageNo) throws Exception { + Long pageSize = 200L; + queryOfsSoSaleOutVo.setPageNo(pageNo); + queryOfsSoSaleOutVo.setPageSize(pageSize); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.receipt.search"); + interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo)); + StockinOrderSearchResponse rertunGoodsRootBean = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); + if (rertunGoodsRootBean != null) { + if ("false".equals(rertunGoodsRootBean.getError()) && "0".equals(rertunGoodsRootBean.getCode()) && "Success".equals(rertunGoodsRootBean.getMsg())) { + List stockinOrderList = rertunGoodsRootBean.getData(); + if (stockinOrderList != null && stockinOrderList.size() > 0) { + headerDetailsDtoList.addAll(stockinOrderList); + + //TODO OFS没有提供分页字段,等待开发 + } + } else { + logger.error("查询失败,失败原因:{}", JSON.toJSON(interfaceParamDto)); + } + } else { + logger.error("rertunGoodsRootBean为空!interfaceParamDto对象的结果集json:{}", JSON.toJSON(interfaceParamDto)); + } + } + + /** + * 环境预配置 + * + * @param returnGoodHeaderDetailsDataDtoArrayList 采购入库单 + * @author liuyang + */ + private void getSet(List returnGoodHeaderDetailsDataDtoArrayList) throws Exception { + //过滤成功的数据 + List stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList); + //执行推送主逻辑 + implement(stockinOrderList); + } + + /** + * 过滤掉成功的数据 + * + * @author liuyang + */ + private List filterData(List returnGoodHeaderDetailsDataDtoArrayList) { + List headerDetailsDtoList1 = new ArrayList<>(); + if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + //TODO 出库单明细主键,需要O返回,目前没有,已经提需求 + headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoArrayList); + } + return headerDetailsDtoList1; + } + + /** + * 执行主逻辑 + * + * @author liuyang + */ + private void implement(List returnGoodHeaderDetailsDataDtoList) throws Exception { + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { + try { + // 查询基本档案 + List poOrderSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList); + // 代理品牌采购业务流程 + BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow(); + + if (poOrderSonDtos != null && poOrderSonDtos.size() > 0) { + for (int i = 0; i < poOrderSonDtos.size(); i++) { + PoOrderSonDto poOrderSonDto = poOrderSonDtos.get(i); + List details = poOrderSonDto.getDetails(); + + //生成业务日期 + String generateBusinessDate = createGenerateBusinessDate(poOrderSonDto); + + BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司、收货公司 + BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门 + BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织 + BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity(); + BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商档案-供应商 + BdCalbodyEntity bdCalbodyEntity = poOrderSonDto.getBdCalbodyEntity();//收货库存组织 + BdStordocEntity bdStordocEntity = poOrderSonDto.getBdStordocEntity();//收货仓库 + + OfsPoOrderData ofsPoOrderData = poOrderSonDto.getOfsPoOrderData();//OFS采购订单 + OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader(); + List ofsPoOrderDataDetails = ofsPoOrderData.getDetails(); + + //采购订单表头 + PoOrderParentDto poOrderParentDto = new PoOrderParentDto(); + poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程 + poOrderParentDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//采购部门 + poOrderParentDto.setCoperator("0001A110000000000U3D");//制单人 + poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());//采购组织 + poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());//采购公司 + poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());//供应商管理档案 + poOrderParentDto.setDauditdate(generateBusinessDate);//审批日期 + poOrderParentDto.setDorderdate(generateBusinessDate);//订单日期 + poOrderParentDto.setDrevisiondate(generateBusinessDate);//修改日期 + + //采购订单明细行 + List poOrderChildrenDtoList = new ArrayList<>(); + + for (int j = 0; j < details.size(); j++) { + StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j); + OfsPoOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(ofsPoOrderDataDetails, stockinB); + + //2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑 + BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp()); + String receivedQty = stockinB.getReceivedQty();//实收数量 + String fulfillAmount = ofsPoOrderDetail.getFulfillAmount();//实收累计总金额 + + //原币含税单价 + BigDecimal noriginalcurprice = null; + try { + noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP); + } catch (Exception e) { + logger.error("计算采购入库单原币含税单价失败", e); + Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage()); + } + + PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto(); + poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id + poOrderChildrenDto.setNordernum(receivedQty);//订货数量 + poOrderChildrenDto.setNorgtaxprice(noriginalcurprice.stripTrailingZeros().toPlainString());//原币含税单价 + poOrderChildrenDto.setPk_arrvcorp(bdCorpEntity.getPkCorp());//收货公司 + poOrderChildrenDto.setPk_arrvstoorg(bdCalbodyEntity.getPkCalbody());//收货库存组织 + poOrderChildrenDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//收货仓库 + poOrderChildrenDtoList.add(poOrderChildrenDto); + + //2024年8月20日 16:00:03 已经和佳妮总确认,计划到货日期,不用进行传递 + } + + List poOrderParentChildrenDtoList = new ArrayList<>(); + PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto(); + poOrderParentChildrenDto.setParentvo(poOrderParentDto); + poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList); + poOrderParentChildrenDtoList.add(poOrderParentChildrenDto); + + Map> stringStringMap = new HashMap<>(); + stringStringMap.put("puordervo", poOrderParentChildrenDtoList); + sendU8CPoOrder(JSON.toJSONString(stringStringMap)); + logger.info("推送U8C代理品牌采购订单采购!采购订单主键:{} 采购订单编码:{}", null, null); + } + } else { + logger.info("poOrderSonDto.size为0!"); + } + } catch (Exception e) { + logger.error("implement方法抛出异常", e); + } + } + } + + /** + * 档案转换 + * + * @author liuyang + */ + private List queryBasicArchives(List returnGoodHeaderDetailsDataDtoList) { + List poOrderSonDtoArrayList = new ArrayList<>(); + + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { + try { + for (int i = 0; i < returnGoodHeaderDetailsDataDtoList.size(); i++) { + StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoList.get(i); + StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader(); + List details = stockinOrder.getDetails(); + + //采购公司 + String companyCode = header.getCompanyCode(); + Assert.notNull(companyCode, "O表头公司不能为空"); + BdCorpEntity bdCorpEntity = new BdCorpEntity(); + bdCorpEntity.setDr(0); + bdCorpEntity.setDataSourceCode("lets_u8c"); + bdCorpEntity.setUnitcode(companyCode); + List bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); + if (bdCorpEntityList.size() == 0) { + Assert.state(false, "根据O货主编码{},无法匹配到U8C销售公司", companyCode); + } else if (bdCorpEntityList.size() >= 2) { + Assert.state(false, "根据O货主编码{},匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size()); + } + + //采购部门:其他 + String deptName = "其他部门"; + BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); + bdDeptdocEntity.setDataSourceCode("lets_u8c"); + bdDeptdocEntity.setDr(0); + bdDeptdocEntity.setDeptname(deptName); + bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); + List bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); + if (bdDeptdocEntityList.size() == 0) { + Assert.state(false, "根据部门名称:{} 公司id:{},无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp()); + } else if (bdDeptdocEntityList.size() >= 2) { + Assert.state(false, "根据部门名称:{} 公司id:{},匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp()); + } + + //采购组织 + BdPurorgEntity bdPurorgEntity = new BdPurorgEntity(); + bdPurorgEntity.setDr("0"); + bdPurorgEntity.setDataSourceCode("lets_u8c"); + bdPurorgEntity.setOwnercorp(bdCorpEntityList.get(0).getPkCorp()); + List bdPurorgEntityList = iBdPurorgDao.query(bdPurorgEntity); + if (bdPurorgEntityList.size() == 0) { + Assert.state(false, "根据采购公司主键:{} 无法匹配到采购组织", bdCorpEntityList.get(0).getPkCorp()); + } else if (bdPurorgEntityList.size() >= 2) { + Assert.state(false, "根据采购公司主键:{} 匹配到多个采购组织", bdCorpEntityList.get(0).getPkCorp()); + } + + //客商基本档案(供应商类型) + //2024年8月20日 14:47:55 丽知商城、OFS 供应商客商档案、传递到U8C的客商, + //其中自定义项1作为原系统编码,因此统一传到自定义项一,已经和大家确认好了,没有关系的,放心大胆传吧,宝贝 + String shipFromCode = header.getShipFromCode(); + BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); + bdCubasdocEntity.setDataSourceCode("lets_u8c"); + bdCubasdocEntity.setDr(0L); + bdCubasdocEntity.setDef1(shipFromCode); + List bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); + if (bdCubasdocEntityList == null || bdCubasdocEntityList.size() == 0) { + Assert.state(false, "根据OFS供应商业务编码{},无法查询到U8C客商档案信息(供应商)", shipFromCode); + } else if (bdCubasdocEntityList.size() >= 2) { + Assert.state(false, "根据OFS供应商业务编码{},查询到多个U8C客商档案信息(供应商)", shipFromCode); + } + + //客商管理档案 + BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity(); + bdCumandocEntity1.setDataSourceCode("lets_u8c"); + bdCumandocEntity1.setDr(0L); + bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); + bdCumandocEntity1.setCustflags(ProfilesActiveConstant.SUPPLIER); + bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc()); + List bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); + if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) { + Assert.state(false, "根据客商基本档案主键{},无法匹配到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc()); + } else if (bdCumandocEntityList.size() >= 2) { + Assert.state(false, "根据客商基本档案主键{},匹配到多个客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc()); + } + + // 2024年8月20日 23:51:56 收货库存组织,应该是通过收货公司查询得出收货库存组织,目前收货公司和采购公司保持一致,那么就以采购公司带出!这个逻辑已经和佳妮确认 + BdCalbodyEntity bdCalbodyEntity = new BdCalbodyEntity(); + bdCalbodyEntity.setDr(0); + bdCalbodyEntity.setDataSourceCode("lets_u8c"); + bdCalbodyEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); + List bdCalbodyEntities = iBdCalbodyDao.query(bdCalbodyEntity); + if (bdCalbodyEntities.size() == 0) { + Assert.state(false, "根据U8C采购公司{},无法匹配到U8C发货库存组织", bdCorpEntityList.get(0).getPkCorp()); + } else if (bdCalbodyEntities.size() >= 2) { + Assert.state(false, "根据U8C采购公司{},匹配到U8C发货库存组织{}个", bdCorpEntityList.get(0).getPkCorp(), bdCalbodyEntities.size()); + } + + //收货仓库 + String facilityCode = header.getFacilityCode(); + Assert.notNull(facilityCode, "O售后入库单仓库facilityCode字段不能为空"); + BdStordocEntity bdStordocEntity = new BdStordocEntity(); + bdStordocEntity.setDr(0L); + bdStordocEntity.setDataSourceCode("lets_u8c"); + bdStordocEntity.setPkCalbody(bdCalbodyEntities.get(0).getPkCalbody()); + bdStordocEntity.setStorcode(facilityCode); + List bdStordocEntityList = iBdStordocDao.query(bdStordocEntity); + if (bdStordocEntityList.size() == 0) { + Assert.state(false, "根据O仓库编码+U8C收货库存组织主键,无法匹配到U8C仓库", facilityCode, bdCalbodyEntities.get(0).getPkCalbody()); + } else if (bdStordocEntityList.size() >= 2) { + Assert.state(false, "根据O仓库编码+U8C收货库存组织主键,匹配到U8C仓库多个", facilityCode, bdCalbodyEntities.get(0).getPkCalbody()); + } + + //查询OFS采购订单 + OfsPoOrderData ofsPoOrderData = queryOfsPoOrder(header.getRefOrderCode()); + + PoOrderSonDto poOrderSonDto = new PoOrderSonDto(); + poOrderSonDto.setBdCorpEntity(bdCorpEntityList.get(0)); + poOrderSonDto.setBdDeptdocEntity(bdDeptdocEntityList.get(0)); + poOrderSonDto.setBdPurorgEntity(bdPurorgEntityList.get(0)); + poOrderSonDto.setBdCubasdocEntity(bdCubasdocEntityList.get(0)); + poOrderSonDto.setBdCumandocEntity(bdCumandocEntityList.get(0)); + poOrderSonDto.setOfsPoOrderData(ofsPoOrderData); + poOrderSonDto.setBdCalbodyEntity(bdCalbodyEntities.get(0)); + poOrderSonDto.setBdStordocEntity(bdStordocEntityList.get(0)); + + BeanUtil.copyPropertiesV2(poOrderSonDto, header); + poOrderSonDtoArrayList.add(poOrderSonDto); + } + //成功 + } catch (Exception e) { + logger.error("代理品牌采购入库单档案转换失败", e); + //失败 + } + } else { + logger.info("queryBasicArchives对应returnGoodHeaderDetailsDataDtoList.size为0"); + } + return poOrderSonDtoArrayList; + } + + /** + * 2024年8月6日 10:59:03 查询U8C业务流程 + * + * @author liuyang + */ + private BdBusitypeEntity u8cOperationFlow() throws Exception { + //查询业务流程 + //2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供 + String processName = "代理品牌采购"; + BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName); + Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName); + return bdBusitypeEntity; + } + + /** + * 2024年8月20日 15:46:10 + * 生成业务日期,以发货时间作为业务日期 + * + * @author liuyang + */ + private String createGenerateBusinessDate(PoOrderSonDto poOrderSonDto) { + if (poOrderSonDto != null && poOrderSonDto.getShipAt() != null) { + String shipAt = poOrderSonDto.getShipAt(); + String businessFormat = null; + try { + Date dbill = DateUtil.parse(shipAt); + businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); + } catch (Exception e) { + logger.error("业务日期生成失败", e); + } + return businessFormat; + } else { + logger.error("生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + Assert.state(false, "生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + return null; + } + } + + /** + * 查询存货管理档案 + * + * @param pkCorp 发货公司主键 + * @param stockinB 采购入库单明细行 + * @author liuyang + */ + private BdInvmandocEntity queryInventoryMan(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, String pkCorp) throws Exception { + Assert.notNull(stockinB, "sonDetailsDto不能为空"); + Assert.notNull(stockinB.getSkuCode(), "O存货商家编码不能为空"); + Assert.notNull(pkCorp, "发货公司主键不能为空"); + + BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity(); + bdInvmandocEntity.setInvcode(stockinB.getSkuCode()); + bdInvmandocEntity.setPkCorp(pkCorp); + List bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity); + if (bdInvmandocEntity2.size() == 0) { + Assert.state(false, "根据O商家编码:{} U8C发货公司主键:{}没有查询到存货管理档案", stockinB.getSkuCode(), pkCorp); + } else if (bdInvmandocEntity2.size() >= 2) { + Assert.state(false, "根据O商家编码:{} U8C发货公司主键:{}没有查询到存货管理档案", stockinB.getSkuCode(), pkCorp); + } + return bdInvmandocEntity2.get(0); + } + + /** + * 2024年8月20日 16:11:46 + * + * @author liuyang + */ + public OfsPoOrderData queryOfsPoOrder(String code) throws Exception { + if (code != null && !"".equals(code)) { + Long pageSize = 200L; + Long pageNo = 1L; + + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setPageNo(pageNo); + queryOfsSoSaleOutVo.setPageSize(pageSize); + queryOfsSoSaleOutVo.setCode(code); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.purchaseOrder.search"); + interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo)); + OfsPoOrderBean ofsPoOrderBean = (OfsPoOrderBean) ofsUnifiedService.unified(interfaceParamDto); + if (ofsPoOrderBean != null) { + if ("false".equals(ofsPoOrderBean.getError()) && "0".equals(ofsPoOrderBean.getCode()) && "Success".equals(ofsPoOrderBean.getMsg())) { + List data = ofsPoOrderBean.getData(); + if (data != null && data.size() > 0) { + return data.get(0); + } + } else { + logger.error("查询采购订单失败,失败原因:{}", JSON.toJSON(interfaceParamDto)); + } + } else { + logger.error("ofsPoOrderBean为空!interfaceParamDto接口入参:{}", JSON.toJSON(interfaceParamDto)); + } + } else { + Assert.state(false, "采购订单编码不能为空!"); + } + return null; + } + + /** + * 2024年8月20日 16:42:14 + * 查找对应的采购订单明细行 + * 2024年8月20日 17:42:15 + * 应该通过明细行主键匹配,但是只能根据sku匹配目前的实现逻辑 + * 查找OFS采购订单明细行,主要是为了带出实付金额,通过实付金额/实收数量=含税单价 + * + * @param ofsPoOrderDataDetails OFS采购订单明细行所有对象 + * @param stockinB OFS采购入库单明细行对象 + * @author liuyang + */ + private OfsPoOrderDetails findOfsPoOrderDetail(List ofsPoOrderDataDetails, StockinOrderSearchResponse.StockinOrder.StockinB stockinB) { + if (ofsPoOrderDataDetails != null && ofsPoOrderDataDetails.size() > 0 && stockinB != null) { + //TODO 2024年8月20日 23:33:11 先使用sku验证,然后O接口更新明细id,使用明细id匹配! + // 2024年8月20日 23:36:04 使用sku匹配,在某种角度来说是错误的 + for (int i = 0; i < ofsPoOrderDataDetails.size(); i++) { + if (ofsPoOrderDataDetails.get(i).getSkuCode().equals(stockinB.getSkuCode())) { + return ofsPoOrderDataDetails.get(0); + } + } + } else { + logger.error("findOfsPoOrderDetail方法对应的ofsPoOrderDataDetails不能为空!否则业务目标无法完成!"); + } + Assert.state(false, "无法匹配到采购订单明细行,业务逻辑无法完成,根据sku编码:{}查找,但是在采购订单中无法匹配!", stockinB.getSkuCode()); + return null; + } + + /** + * 2024年8月20日 23:58:13 + * 推送U8C采购订单 + * + * @author liuyang + */ + public SoSaleResultRootDto sendU8CPoOrder(String param) throws Exception { + long startLong = System.currentTimeMillis(); + logger.info("代理品牌采购推送开始,推送参数:" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL); + String result = HttpRequest.post(ProfilesActiveConstant.U8C_URL).header("appId", "800037")//头信息,多个头信息多次调用此方法即可 + .header("usercode", "admin").header("password", "21232f297a57a5a743894a0e4a801fc3").header("system", "lz").header("trantype", "PK").header("apiCode", "8000370004")//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(param)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + logger.info("代理品牌采购推送结束,返回参数:" + result); + long endLong = System.currentTimeMillis(); + logger.info("U8C采购订单接口请求耗时:" + (endLong - startLong)); + + JSONObject jsonObject = JSON.parseObject(result); + result = String.valueOf(jsonObject.get("attribute")); + + boolean isSuccess = false; + SoSaleResultRootDto soSaleResultRootDto = null; + if (result != null && !"".equals(result)) { + ReusltStrDto reusltStrDto = JSON.parseObject(result, ReusltStrDto.class); + if ("success".equals(reusltStrDto.getStatus())) { + soSaleResultRootDto = resultDataHandle(reusltStrDto.getData()); + isSuccess = true; + } + } + if (!isSuccess) { + Assert.state(false, "代理品牌采购业务推送U8C采购订单失败 接口返回结果:{}", result); + } + return soSaleResultRootDto; + } + + /** + * 返回结果解析处理,在确认了success后调用 + * + * @author liuyang + */ + private SoSaleResultRootDto resultDataHandle(String resultData) { + try { + if (resultData != null && !"".equals(resultData)) { + if (resultData.contains("[")) { + resultData = resultData.substring(1, resultData.length() - 1); + } + return JSON.parseObject(resultData, SoSaleResultRootDto.class); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("解析返回参数失败的错误", e); + //如果解析失败,记录原因,但是不能影响结果的记录 + } + return null; + } +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java index 9b24ce62..4c64635c 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java @@ -113,10 +113,10 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { @Autowired private IBdSalestruDao iBdSalestruDao; - @Autowired private IBdCumandocDao iBdCumandocDao; + @Autowired private IBdDeptdocDao iBdDeptdocDao; @@ -189,8 +189,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { * * @author liuyang */ - public void startImplement(String date) { - String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单 出库单单号:{}", date); + public void startImplement(String code) { + String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单 出库单单号:{}", code); logger.info(threadNameStr); Thread thread = new Thread(new Runnable() { @@ -203,11 +203,11 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); - queryOfsSoSaleOutVo.setStatus(900L); +// queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setStoreCode(tobShop); - queryOfsSoSaleOutVo.setCode(date); + queryOfsSoSaleOutVo.setCode(code); queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L); logger.info("根据根据号拉群:数据返回行数:{}", headerDetailsDtoList.size()); if (headerDetailsDtoList.size() > 0) { @@ -670,6 +670,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { bdCumandocEntity1.setDr(0L); bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER); + bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc()); List bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) { Assert.state(false, "根据客商基本档案主键{},没有办法查询到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc()); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java index 6b60de3f..2e82136f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java @@ -160,6 +160,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); @@ -208,6 +209,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setStoreCode(tobShop); queryOfsSoSaleOutVo.setCode(code); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java index 7ca0435f..fa25f8b6 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java @@ -136,6 +136,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setStoreCode(tocShop); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001"); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size()); @@ -189,6 +190,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setStoreCode(tocShop); queryOfsSoSaleOutVo.setCode(code); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size()); if (returnGoodHeaderDetailsDataDtoList.size() > 0) { diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderChildrenDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderChildrenDto.java new file mode 100644 index 00000000..cbac68bb --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderChildrenDto.java @@ -0,0 +1,103 @@ +package com.hzya.frame.plugin.lets.u8cdto; + +import lombok.Data; + +/** + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.u8cdto + * @Project:kangarooDataCenterV3 + * @name:PoOrderHaderDto + * @Date:2024/8/20 15:17 + * @Filename:PoOrderHaderDto + */ +@Data +public class PoOrderChildrenDto { + private String blargess; + private String cassistunit; + private String cbaseid; + private String ccurrencytypeid; + private String cmangid; + private String coperator; + private String corder_bid; + private String corderid; + private String cprojectid; + private String crowno; + private String csourcebillid; + private String csourcebilltype; + private String csourcerowid; + private String cupsourcebillid; + private String cupsourcebillrowid; + private String cupsourcebilltype; + private String cusedeptid; + private String cwarehouseid; + private String dplanarrvdate; + private String forderrowstatus; + private String idiscounttaxtype; + private String nassistnum; + private String ndiscountrate; + private String nexchangeotobrate; + private String nmoney; + private String nordernum; + private String norgnettaxprice; + private String norgtaxprice; + private String noriginalcurmny; + private String noriginalcurprice; + private String noriginalnetprice; + private String noriginaltaxmny; + private String noriginaltaxpricemny; + private String ntaxmny; + private String ntaxpricemny; + private String ntaxrate; + private String pk_arrvcorp; + private String pk_arrvstoorg; + private String pk_corp; + private String pk_defdoc1; + private String pk_defdoc10; + private String pk_defdoc11; + private String pk_defdoc12; + private String pk_defdoc13; + private String pk_defdoc14; + private String pk_defdoc15; + private String pk_defdoc16; + private String pk_defdoc17; + private String pk_defdoc18; + private String pk_defdoc19; + private String pk_defdoc2; + private String pk_defdoc20; + private String pk_defdoc3; + private String pk_defdoc4; + private String pk_defdoc5; + private String pk_defdoc6; + private String pk_defdoc7; + private String pk_defdoc8; + private String pk_defdoc9; + private String pk_invoicecorp; + private String vdef1; + private String vdef10; + private String vdef11; + private String vdef12; + private String vdef13; + private String vdef14; + private String vdef15; + private String vdef16; + private String vdef17; + private String vdef18; + private String vdef19; + private String vdef2; + private String vdef20; + private String vdef3; + private String vdef4; + private String vdef5; + private String vdef6; + private String vdef7; + private String vdef8; + private String vdef9; + private String vfree1; + private String vfree2; + private String vfree3; + private String vfree4; + private String vfree5; + private String vmemo; + private String vostatus; + private String vproducenum; +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderParentChildrenDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderParentChildrenDto.java new file mode 100644 index 00000000..1cfb0e54 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderParentChildrenDto.java @@ -0,0 +1,21 @@ +package com.hzya.frame.plugin.lets.u8cdto; + +import lombok.Data; + +import java.util.List; + +/** + * U8C采购订单保存接口,入参实体类 + * + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.u8cdto + * @Project:kangarooDataCenterV3 + * @name:PoOrderHaderDto + * @Date:2024/8/20 15:17 + * @Filename:PoOrderHaderDto + */ +@Data +public class PoOrderParentChildrenDto { + private PoOrderParentDto parentvo; + private List childrenvo; +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderParentDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderParentDto.java new file mode 100644 index 00000000..9447dea6 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderParentDto.java @@ -0,0 +1,94 @@ +package com.hzya.frame.plugin.lets.u8cdto; + +import lombok.Data; + +/** + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.u8cdto + * @Project:kangarooDataCenterV3 + * @name:PoOrderHaderDto + * @Date:2024/8/20 15:17 + * @Filename:PoOrderHaderDto + */ +@Data +public class PoOrderParentDto { + private String bcooptoso; + private String bislatest; + private String bisreplenish; + private String bpubtoec; + private String breturn; + private String bsocooptome; + private String caccountbankid; + private String caccountyear; + private String cauditpsn; + private String cbiztype; + private String ccontracttextpath; + private String ccurrencytypeid; + private String cdeliveraddress; + private String cdeptid; + private String cemployeeid; + private String cfreecustid; + private String cgiveinvoicevendo; + private String coperator; + private String corderid; + private String cpubpsn; + private String cpurorganization; + private String creciever; + private String cresppsn; + private String crevisepsn; + private String ctermprotocolid; + private String ctransmodeid; + private String cunfreeze; + private String cvendormangid; + private String dauditdate; + private String dorderdate; + private String drevisiondate; + private String forderstatus; + private String isSaveWhenOverSto; + private String nexchangeotobrate; + private String pk_corp; + private String pk_defdoc1; + private String pk_defdoc10; + private String pk_defdoc11; + private String pk_defdoc12; + private String pk_defdoc13; + private String pk_defdoc14; + private String pk_defdoc15; + private String pk_defdoc16; + private String pk_defdoc17; + private String pk_defdoc18; + private String pk_defdoc19; + private String pk_defdoc2; + private String pk_defdoc20; + private String pk_defdoc3; + private String pk_defdoc4; + private String pk_defdoc5; + private String pk_defdoc6; + private String pk_defdoc7; + private String pk_defdoc8; + private String pk_defdoc9; + private String tlastmaketime; + private String tmaketime; + private String vdef1; + private String vdef10; + private String vdef11; + private String vdef12; + private String vdef13; + private String vdef14; + private String vdef15; + private String vdef16; + private String vdef17; + private String vdef18; + private String vdef19; + private String vdef2; + private String vdef20; + private String vdef3; + private String vdef4; + private String vdef5; + private String vdef6; + private String vdef7; + private String vdef8; + private String vdef9; + private String vmemo; + private String vordercode; +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderSonDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderSonDto.java new file mode 100644 index 00000000..7fd845f2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/PoOrderSonDto.java @@ -0,0 +1,64 @@ +package com.hzya.frame.plugin.lets.u8cdto; + +import com.hzya.frame.plugin.lets.entity.*; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData; +import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; +import lombok.Data; + +import java.util.List; + +/** + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.u8cdto + * @Project:kangarooDataCenterV3 + * @name:PoOrderSonDto + * @Date:2024/8/20 14:51 + * @Filename:PoOrderSonDto + */ +@Data +public class PoOrderSonDto extends StockinOrderSearchResponse.StockinOrder.StockinH { + /** + * 采购公司 + */ + private BdCorpEntity bdCorpEntity; + + /** + * 采购部门 + */ + private BdDeptdocEntity bdDeptdocEntity; + + /** + * 采购组织 + */ + private BdPurorgEntity bdPurorgEntity; + + /** + * 客商基本档案-供应商 + */ + private BdCubasdocEntity bdCubasdocEntity; + + /** + * 客商管理档案-供应商 + */ + private BdCumandocEntity bdCumandocEntity; + + /** + * 明细行 + */ + private List details; + + /** + * OFS采购订单 + */ + private OfsPoOrderData ofsPoOrderData; + + /** + * 收货库存组织 + */ + private BdCalbodyEntity bdCalbodyEntity; + + /** + * 收货仓库 + */ + private BdStordocEntity bdStordocEntity; +} diff --git a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml index 4ccb3ef3..a1c255ae 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml @@ -47,4 +47,5 @@ + \ No newline at end of file diff --git a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-plugin.xml index 90f3143c..590ff2b0 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-plugin.xml @@ -23,4 +23,7 @@ + + + diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturnTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturnTest.java new file mode 100644 index 00000000..ef9f0a2f --- /dev/null +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturnTest.java @@ -0,0 +1,35 @@ +package com.hzya.frame.plugin.lets.plugin.purchase; + +import com.hzya.frame.WebappApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.junit.Assert.*; + +/** + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.plugin.purchase + * @Project:kangarooDataCenterV3 + * @name:ProxyPurchaseReturnTest + * @Date:2024/8/20 18:19 + * @Filename:ProxyPurchaseReturnTest + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = WebappApplication.class) +public class ProxyPurchaseReturnTest { + + @Autowired + private ProxyPurchaseReturn proxyPurchaseReturn; + + @Test + public void startImplement() { + try { + proxyPurchaseReturn.startImplement("LETS-SH2024082000000006"); + } catch (Exception e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousTest.java new file mode 100644 index 00000000..d56a7ceb --- /dev/null +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousTest.java @@ -0,0 +1,45 @@ +package com.hzya.frame.plugin.lets.plugin.purchase; + +import com.hzya.frame.WebappApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.junit.Assert.*; + +/** + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.plugin.purchase + * @Project:kangarooDataCenterV3 + * @name:ProxyPurchaseWarehousTest + * @Date:2024/8/20 11:05 + * @Filename:ProxyPurchaseWarehousTest + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = WebappApplication.class) +public class ProxyPurchaseWarehousTest { + + @Autowired + private ProxyPurchaseWarehous proxyPurchaseWarehous; + + @Test + public void startImplement() { + try { + proxyPurchaseWarehous.startImplement("LETS-RE2024010200000001"); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Test + public void startImplement2() { + try { + //2024年8月20日 16:17:24 测试查询OFS采购订单 + proxyPurchaseWarehous.queryOfsPoOrder("LETS-PO2024010200000001"); + } catch (Exception e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToBTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToBTest.java index 49c0525e..fd3ce6fa 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToBTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToBTest.java @@ -1,6 +1,8 @@ package com.hzya.frame.plugin.lets.plugin.sales; import com.hzya.frame.WebappApplication; +import com.hzya.frame.plugin.lets.util.AfterSalesOrderUtil; +import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -24,8 +26,19 @@ public class SoSaleOutPluginInitializerToBTest { @Autowired private SoSaleOutPluginInitializerToB soSaleOutPluginInitializerToB; + @Autowired + private AfterSalesOrderUtil afterSalesOrderUtil; + @Test public void startImplement() { - soSaleOutPluginInitializerToB.startImplement(null, null); +// soSaleOutPluginInitializerToB.startImplement(null, null); + soSaleOutPluginInitializerToB.startImplement("LETS-SH2024010900000008"); + +// try { +// SaleOrderMessageDto ofsOrder = afterSalesOrderUtil.getOfsOrder("LETS-SO2024081600000050"); +// System.out.println(ofsOrder); +// } catch (Exception e) { +// e.printStackTrace(); +// } } } \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java b/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java index 60b04ba3..010f5da8 100644 --- a/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java @@ -5,6 +5,7 @@ import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; +import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto; import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean; @@ -40,5 +41,7 @@ public class ApiDtoCacheMap { apiDtoCacheMap.put("ofs.inventory.class.search", new OFSSKUClassSearchResponse());//OFS存货分类查询接口 apiDtoCacheMap.put("ofs.returnOrder.search", new RerturnGoodsOrderSearchJsonRootBean());//售后订单 + + apiDtoCacheMap.put("ofs.purchaseOrder.search", new OfsPoOrderBean());//采购订单 } } diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderBean.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderBean.java new file mode 100644 index 00000000..72630f11 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderBean.java @@ -0,0 +1,11 @@ +package com.hzya.frame.ttxofs.dto.ofspoorder; + +import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; +import lombok.Data; + +import java.util.List; + +@Data +public class OfsPoOrderBean extends ReturnMessageBasics { + private List data; +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderData.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderData.java new file mode 100644 index 00000000..77f75b2b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderData.java @@ -0,0 +1,11 @@ +package com.hzya.frame.ttxofs.dto.ofspoorder; + +import lombok.Data; + +import java.util.List; + +@Data +public class OfsPoOrderData { + private OfsPoOrderHeader header; + private List details; +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderDetails.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderDetails.java new file mode 100644 index 00000000..d140b02b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderDetails.java @@ -0,0 +1,37 @@ +package com.hzya.frame.ttxofs.dto.ofspoorder; + +import lombok.Data; + +@Data +public class OfsPoOrderDetails { + + private String clientCode; + private String id; + private String purchaseOrderId; + private String purchaseOrderCode; + private String skuCode; + private String skuName; + private String requestQty; + private String openQty; + private String fulfillQty; + private String asnPendingQty; + private String returnableQty; + private String quantityUM; + private String buyPrice; + private String discountPrice; + private String discount; + private String totalAmount; + private String totalWeight; + private String totalVolume; + private String totalVolumeWeight; + private String fulfillAmount; + private String fulfillWeight; + private String fulfillVolume; + private String weightUM; + private String volumeUM; + private String inventorySts; + private String created; + private String createdBy; + private String lastUpdated; + private String lastUpdatedBy; +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderHeader.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderHeader.java new file mode 100644 index 00000000..25167dbf --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofspoorder/OfsPoOrderHeader.java @@ -0,0 +1,52 @@ +package com.hzya.frame.ttxofs.dto.ofspoorder; + +import lombok.Data; + +@Data +public class OfsPoOrderHeader { + private String id; + private String clientCode; + private String companyCode; + private String facilityCode; + private String code; + private String internalOrderType; + private String bizChannel; + private String sourceAsnCode; + private String status; + private String vendorName; + private String shipFromAttentionTo; + private String shipFromCountry; + private String shipFromAddress; + private String shipFromPostalCode; + private String shipFromPhone; + private String shipFromMobile; + private String shipFromFax; + private String shipFromEmail; + private String totalAmount; + private String totalLines; + private String totalQty; + private String totalWeight; + private String totalVolume; + private String totalVolumeWeight; + private String totalFulfillQty; + private String totalFulfillAmount; + private String totalFulfillWeight; + private String totalFulfillVolume; + private String totalFulfillVolumeWeight; + private String weightUM; + private String volumeUM; + private String sourcePlatformCode; + private String sourceOrderId; + private String sourceOrderCode; + private String auditBy; + private String auditAt; + private String closedBy; + private String closedAt; + private String errorCode; + private String errorDesc; + private String note; + private String created; + private String createdBy; + private String lastUpdated; + private String lastUpdatedBy; +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java index 3d552ed6..8f349b95 100644 --- a/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java @@ -10,15 +10,15 @@ import java.util.List; */ @Data public class StockinOrderSearchResponse extends ReturnMessageBasics { - private List data; + public List data; @Data - public class StockinOrder { + public static class StockinOrder { private StockinH header; private List details; @Data - public class StockinH { + public static class StockinH { private String id; private String clientCode; @@ -62,10 +62,13 @@ public class StockinOrderSearchResponse extends ReturnMessageBasics { private String lastUpdatedBy; private String sourcePlatformCode; private String storeCode; + private String shipFromCode; + private String shipFromAddressCode; + private String shipAt; } @Data - public class StockinB { + public static class StockinB { private String id; private String receiptId;