diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java index f3850dac..2f31208e 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java @@ -40,6 +40,8 @@ public class OverallConstant { //调拨 prodOverPublic.put("approveqzCode", "8000370009");//调拨订单保存即审批 prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批 + prodOverPublic.put("approveInqzCode", "8000370054");//调拨入库保存并签字 + prodOverPublic.put("approveInqz", "/u8cloud/api/ic/allocationIn/save/sign");//调拨入库保存并签字 //其他出入库 prodOverPublic.put("otherinqzCode", "8000370007");//库存其他入库保存即签字 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/IIcGeneralBDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIcGeneralBDao.java index bb58decf..1f6e4fa1 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIcGeneralBDao.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIcGeneralBDao.java @@ -16,6 +16,7 @@ public interface IIcGeneralBDao extends IBaseDao { * 根据cgeneralhid表头主键查询 */ public List queryByCgeneralhid(String cgeneralhid); + public List queryAndCinvbasCode(String cgeneralhid); } 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/dao/impl/IcGeneralBDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IcGeneralBDaoImpl.java index 43d1791c..91d1bee5 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IcGeneralBDaoImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IcGeneralBDaoImpl.java @@ -1,6 +1,8 @@ package com.hzya.frame.plugin.lets.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; import com.hzya.frame.plugin.lets.dao.IIcGeneralBDao; import com.hzya.frame.plugin.lets.entity.IcGeneralBEntity; @@ -18,5 +20,10 @@ public class IcGeneralBDaoImpl extends MybatisGenericDao queryByCgeneralhid(String cgeneralhid) { return query("com.hzya.frame.plugin.lets.entity.IcGeneralBEntity.queryByCgeneralhid",cgeneralhid); } + @Override + @DS(ProfilesActiveConstant.LETS_DATE_SOURCE) + public List queryAndCinvbasCode(String cgeneralhid) { + return (List)selectList("com.hzya.frame.plugin.lets.entity.IcGeneralBEntity.queryAndCinvbasCode",cgeneralhid); + } } 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/entity/IcGeneralBEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.java index 864bb9d9..5bb1fab2 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.java @@ -1,12 +1,15 @@ package com.hzya.frame.plugin.lets.entity; import com.hzya.frame.web.entity.BaseEntity; +import lombok.Data; + /** * (IcGeneralB)实体类 * * @author makejava * @since 2023-09-05 08:36:02 */ +@Data public class IcGeneralBEntity extends BaseEntity { private Double alrconfincomny; @@ -41,6 +44,8 @@ public class IcGeneralBEntity extends BaseEntity { private String cfreezeid; private String cgeneralbid; private String cgeneralhid; + /** 存货档案code */ + private String cinvbascode; private String cinvbasid; private String cinventoryid; private String corderBb1id; @@ -226,1725 +231,7 @@ public class IcGeneralBEntity extends BaseEntity { private String writeofftype; - public Double getAlrconfincomny() { - return alrconfincomny; - } - public void setAlrconfincomny(Double alrconfincomny) { - this.alrconfincomny = alrconfincomny; - } - - public Double getAlrconfinconum() { - return alrconfinconum; - } - - public void setAlrconfinconum(Double alrconfinconum) { - this.alrconfinconum = alrconfinconum; - } - - public String getBbarcodeclose() { - return bbarcodeclose; - } - - public void setBbarcodeclose(String bbarcodeclose) { - this.bbarcodeclose = bbarcodeclose; - } - - public String getBomversion() { - return bomversion; - } - - public void setBomversion(String bomversion) { - this.bomversion = bomversion; - } - - public String getBonroadflag() { - return bonroadflag; - } - - public void setBonroadflag(String bonroadflag) { - this.bonroadflag = bonroadflag; - } - - public String getBreturnprofit() { - return breturnprofit; - } - - public void setBreturnprofit(String breturnprofit) { - this.breturnprofit = breturnprofit; - } - - public String getBsafeprice() { - return bsafeprice; - } - - public void setBsafeprice(String bsafeprice) { - this.bsafeprice = bsafeprice; - } - - public String getBsourcelargess() { - return bsourcelargess; - } - - public void setBsourcelargess(String bsourcelargess) { - this.bsourcelargess = bsourcelargess; - } - - public String getBsupplyflag() { - return bsupplyflag; - } - - public void setBsupplyflag(String bsupplyflag) { - this.bsupplyflag = bsupplyflag; - } - - public String getBtoinzgflag() { - return btoinzgflag; - } - - public void setBtoinzgflag(String btoinzgflag) { - this.btoinzgflag = btoinzgflag; - } - - public String getBtoouttoiaflag() { - return btoouttoiaflag; - } - - public void setBtoouttoiaflag(String btoouttoiaflag) { - this.btoouttoiaflag = btoouttoiaflag; - } - - public String getBtooutzgflag() { - return btooutzgflag; - } - - public void setBtooutzgflag(String btooutzgflag) { - this.btooutzgflag = btooutzgflag; - } - - public String getBtou8rm() { - return btou8rm; - } - - public void setBtou8rm(String btou8rm) { - this.btou8rm = btou8rm; - } - - public String getBtransasset() { - return btransasset; - } - - public void setBtransasset(String btransasset) { - this.btransasset = btransasset; - } - - public String getBzgflag() { - return bzgflag; - } - - public void setBzgflag(String bzgflag) { - this.bzgflag = bzgflag; - } - - public String getBzgyfflag() { - return bzgyfflag; - } - - public void setBzgyfflag(String bzgyfflag) { - this.bzgyfflag = bzgyfflag; - } - - public String getCastunitid() { - return castunitid; - } - - public void setCastunitid(String castunitid) { - this.castunitid = castunitid; - } - - public String getCbodybilltypecode() { - return cbodybilltypecode; - } - - public void setCbodybilltypecode(String cbodybilltypecode) { - this.cbodybilltypecode = cbodybilltypecode; - } - - public String getCbodywarehouseid() { - return cbodywarehouseid; - } - - public void setCbodywarehouseid(String cbodywarehouseid) { - this.cbodywarehouseid = cbodywarehouseid; - } - - public String getCcheckstateid() { - return ccheckstateid; - } - - public void setCcheckstateid(String ccheckstateid) { - this.ccheckstateid = ccheckstateid; - } - - public String getCcorrespondbid() { - return ccorrespondbid; - } - - public void setCcorrespondbid(String ccorrespondbid) { - this.ccorrespondbid = ccorrespondbid; - } - - public String getCcorrespondcode() { - return ccorrespondcode; - } - - public void setCcorrespondcode(String ccorrespondcode) { - this.ccorrespondcode = ccorrespondcode; - } - - public String getCcorrespondhid() { - return ccorrespondhid; - } - - public void setCcorrespondhid(String ccorrespondhid) { - this.ccorrespondhid = ccorrespondhid; - } - - public String getCcorrespondtype() { - return ccorrespondtype; - } - - public void setCcorrespondtype(String ccorrespondtype) { - this.ccorrespondtype = ccorrespondtype; - } - - public String getCcostobject() { - return ccostobject; - } - - public void setCcostobject(String ccostobject) { - this.ccostobject = ccostobject; - } - - public String getCcurrencytypeid() { - return ccurrencytypeid; - } - - public void setCcurrencytypeid(String ccurrencytypeid) { - this.ccurrencytypeid = ccurrencytypeid; - } - - public String getCfirstbillbid() { - return cfirstbillbid; - } - - public void setCfirstbillbid(String cfirstbillbid) { - this.cfirstbillbid = cfirstbillbid; - } - - public String getCfirstbillhid() { - return cfirstbillhid; - } - - public void setCfirstbillhid(String cfirstbillhid) { - this.cfirstbillhid = cfirstbillhid; - } - - public String getCfirsttype() { - return cfirsttype; - } - - public void setCfirsttype(String cfirsttype) { - this.cfirsttype = cfirsttype; - } - - public String getCfreezeid() { - return cfreezeid; - } - - public void setCfreezeid(String cfreezeid) { - this.cfreezeid = cfreezeid; - } - - public String getCgeneralbid() { - return cgeneralbid; - } - - public void setCgeneralbid(String cgeneralbid) { - this.cgeneralbid = cgeneralbid; - } - - public String getCgeneralhid() { - return cgeneralhid; - } - - public void setCgeneralhid(String cgeneralhid) { - this.cgeneralhid = cgeneralhid; - } - - public String getCinvbasid() { - return cinvbasid; - } - - public void setCinvbasid(String cinvbasid) { - this.cinvbasid = cinvbasid; - } - - public String getCinventoryid() { - return cinventoryid; - } - - public void setCinventoryid(String cinventoryid) { - this.cinventoryid = cinventoryid; - } - - public String getCorderBb1id() { - return corderBb1id; - } - - public void setCorderBb1id(String corderBb1id) { - this.corderBb1id = corderBb1id; - } - - public String getCparentid() { - return cparentid; - } - - public void setCparentid(String cparentid) { - this.cparentid = cparentid; - } - - public String getCprojectid() { - return cprojectid; - } - - public void setCprojectid(String cprojectid) { - this.cprojectid = cprojectid; - } - - public String getCprojectphaseid() { - return cprojectphaseid; - } - - public void setCprojectphaseid(String cprojectphaseid) { - this.cprojectphaseid = cprojectphaseid; - } - - public String getCquotecurrency() { - return cquotecurrency; - } - - public void setCquotecurrency(String cquotecurrency) { - this.cquotecurrency = cquotecurrency; - } - - public String getCquoteunitid() { - return cquoteunitid; - } - - public void setCquoteunitid(String cquoteunitid) { - this.cquoteunitid = cquoteunitid; - } - - public String getCreceieveid() { - return creceieveid; - } - - public void setCreceieveid(String creceieveid) { - this.creceieveid = creceieveid; - } - - public String getCreceiveareaid() { - return creceiveareaid; - } - - public void setCreceiveareaid(String creceiveareaid) { - this.creceiveareaid = creceiveareaid; - } - - public String getCreceivepointid() { - return creceivepointid; - } - - public void setCreceivepointid(String creceivepointid) { - this.creceivepointid = creceivepointid; - } - - public String getCrowno() { - return crowno; - } - - public void setCrowno(String crowno) { - this.crowno = crowno; - } - - public String getCselastunitid() { - return cselastunitid; - } - - public void setCselastunitid(String cselastunitid) { - this.cselastunitid = cselastunitid; - } - - public String getCsignwastbid() { - return csignwastbid; - } - - public void setCsignwastbid(String csignwastbid) { - this.csignwastbid = csignwastbid; - } - - public String getCsignwasthid() { - return csignwasthid; - } - - public void setCsignwasthid(String csignwasthid) { - this.csignwasthid = csignwasthid; - } - - public String getCsignwasttype() { - return csignwasttype; - } - - public void setCsignwasttype(String csignwasttype) { - this.csignwasttype = csignwasttype; - } - - public String getCsourcebillbid() { - return csourcebillbid; - } - - public void setCsourcebillbid(String csourcebillbid) { - this.csourcebillbid = csourcebillbid; - } - - public String getCsourcebillhid() { - return csourcebillhid; - } - - public void setCsourcebillhid(String csourcebillhid) { - this.csourcebillhid = csourcebillhid; - } - - public String getCsourcetype() { - return csourcetype; - } - - public void setCsourcetype(String csourcetype) { - this.csourcetype = csourcetype; - } - - public String getCsourcewastbid() { - return csourcewastbid; - } - - public void setCsourcewastbid(String csourcewastbid) { - this.csourcewastbid = csourcewastbid; - } - - public String getCsourcewasthid() { - return csourcewasthid; - } - - public void setCsourcewasthid(String csourcewasthid) { - this.csourcewasthid = csourcewasthid; - } - - public String getCsourcewasttype() { - return csourcewasttype; - } - - public void setCsourcewasttype(String csourcewasttype) { - this.csourcewasttype = csourcewasttype; - } - - public String getCsrc2billbid() { - return csrc2billbid; - } - - public void setCsrc2billbid(String csrc2billbid) { - this.csrc2billbid = csrc2billbid; - } - - public String getCsrc2billhid() { - return csrc2billhid; - } - - public void setCsrc2billhid(String csrc2billhid) { - this.csrc2billhid = csrc2billhid; - } - - public String getCsrc2billtype() { - return csrc2billtype; - } - - public void setCsrc2billtype(String csrc2billtype) { - this.csrc2billtype = csrc2billtype; - } - - public String getCsumid() { - return csumid; - } - - public void setCsumid(String csumid) { - this.csumid = csumid; - } - - public String getCvendorid() { - return cvendorid; - } - - public void setCvendorid(String cvendorid) { - this.cvendorid = cvendorid; - } - - public String getCworkcenterid() { - return cworkcenterid; - } - - public void setCworkcenterid(String cworkcenterid) { - this.cworkcenterid = cworkcenterid; - } - - public String getCworksiteid() { - return cworksiteid; - } - - public void setCworksiteid(String cworksiteid) { - this.cworksiteid = cworksiteid; - } - - public String getCwp() { - return cwp; - } - - public void setCwp(String cwp) { - this.cwp = cwp; - } - - public String getDbizdate() { - return dbizdate; - } - - public void setDbizdate(String dbizdate) { - this.dbizdate = dbizdate; - } - - public String getDdeliverdate() { - return ddeliverdate; - } - - public void setDdeliverdate(String ddeliverdate) { - this.ddeliverdate = ddeliverdate; - } - - public String getDfirstbilldate() { - return dfirstbilldate; - } - - public void setDfirstbilldate(String dfirstbilldate) { - this.dfirstbilldate = dfirstbilldate; - } - - public Integer getDr() { - return dr; - } - - public void setDr(Integer dr) { - this.dr = dr; - } - - public String getDrequiredate() { - return drequiredate; - } - - public void setDrequiredate(String drequiredate) { - this.drequiredate = drequiredate; - } - - public String getDrequiretime() { - return drequiretime; - } - - public void setDrequiretime(String drequiretime) { - this.drequiretime = drequiretime; - } - - public String getDstandbydate() { - return dstandbydate; - } - - public void setDstandbydate(String dstandbydate) { - this.dstandbydate = dstandbydate; - } - - public String getDvalidate() { - return dvalidate; - } - - public void setDvalidate(String dvalidate) { - this.dvalidate = dvalidate; - } - - public String getDzgdate() { - return dzgdate; - } - - public void setDzgdate(String dzgdate) { - this.dzgdate = dzgdate; - } - - public String getFassertcardflag() { - return fassertcardflag; - } - - public void setFassertcardflag(String fassertcardflag) { - this.fassertcardflag = fassertcardflag; - } - - public Integer getFbillrowflag() { - return fbillrowflag; - } - - public void setFbillrowflag(Integer fbillrowflag) { - this.fbillrowflag = fbillrowflag; - } - - public Integer getFchecked() { - return fchecked; - } - - public void setFchecked(Integer fchecked) { - this.fchecked = fchecked; - } - - public String getFlargess() { - return flargess; - } - - public void setFlargess(String flargess) { - this.flargess = flargess; - } - - public String getFtoouttransflag() { - return ftoouttransflag; - } - - public void setFtoouttransflag(String ftoouttransflag) { - this.ftoouttransflag = ftoouttransflag; - } - - public Double getHsl() { - return hsl; - } - - public void setHsl(Double hsl) { - this.hsl = hsl; - } - - public Integer getIdesatype() { - return idesatype; - } - - public void setIdesatype(Integer idesatype) { - this.idesatype = idesatype; - } - - public String getInccontimepoint() { - return inccontimepoint; - } - - public void setInccontimepoint(String inccontimepoint) { - this.inccontimepoint = inccontimepoint; - } - - public String getInccontimepointname() { - return inccontimepointname; - } - - public void setInccontimepointname(String inccontimepointname) { - this.inccontimepointname = inccontimepointname; - } - - public String getIsok() { - return isok; - } - - public void setIsok(String isok) { - this.isok = isok; - } - - public Double getMaterialcost() { - return materialcost; - } - - public void setMaterialcost(Double materialcost) { - this.materialcost = materialcost; - } - - public Double getNaccumtonum() { - return naccumtonum; - } - - public void setNaccumtonum(Double naccumtonum) { - this.naccumtonum = naccumtonum; - } - - public Double getNaccumwastnum() { - return naccumwastnum; - } - - public void setNaccumwastnum(Double naccumwastnum) { - this.naccumwastnum = naccumwastnum; - } - - public Double getNbarcodenum() { - return nbarcodenum; - } - - public void setNbarcodenum(Double nbarcodenum) { - this.nbarcodenum = nbarcodenum; - } - - public Double getNcorrespondastnum() { - return ncorrespondastnum; - } - - public void setNcorrespondastnum(Double ncorrespondastnum) { - this.ncorrespondastnum = ncorrespondastnum; - } - - public Double getNcorrespondgrsnum() { - return ncorrespondgrsnum; - } - - public void setNcorrespondgrsnum(Double ncorrespondgrsnum) { - this.ncorrespondgrsnum = ncorrespondgrsnum; - } - - public Double getNcorrespondnum() { - return ncorrespondnum; - } - - public void setNcorrespondnum(Double ncorrespondnum) { - this.ncorrespondnum = ncorrespondnum; - } - - public Double getNcountnum() { - return ncountnum; - } - - public void setNcountnum(Double ncountnum) { - this.ncountnum = ncountnum; - } - - public Integer getNfeesettletimes() { - return nfeesettletimes; - } - - public void setNfeesettletimes(Integer nfeesettletimes) { - this.nfeesettletimes = nfeesettletimes; - } - - public Double getNinassistnum() { - return ninassistnum; - } - - public void setNinassistnum(Double ninassistnum) { - this.ninassistnum = ninassistnum; - } - - public Double getNingrossnum() { - return ningrossnum; - } - - public void setNingrossnum(Double ningrossnum) { - this.ningrossnum = ningrossnum; - } - - public Double getNinnum() { - return ninnum; - } - - public void setNinnum(Double ninnum) { - this.ninnum = ninnum; - } - - public Double getNkdnum() { - return nkdnum; - } - - public void setNkdnum(Double nkdnum) { - this.nkdnum = nkdnum; - } - - public Double getNmny() { - return nmny; - } - - public void setNmny(Double nmny) { - this.nmny = nmny; - } - - public Double getNneedinassistnum() { - return nneedinassistnum; - } - - public void setNneedinassistnum(Double nneedinassistnum) { - this.nneedinassistnum = nneedinassistnum; - } - - public Double getNoutassistnum() { - return noutassistnum; - } - - public void setNoutassistnum(Double noutassistnum) { - this.noutassistnum = noutassistnum; - } - - public Double getNoutgrossnum() { - return noutgrossnum; - } - - public void setNoutgrossnum(Double noutgrossnum) { - this.noutgrossnum = noutgrossnum; - } - - public Double getNoutnum() { - return noutnum; - } - - public void setNoutnum(Double noutnum) { - this.noutnum = noutnum; - } - - public Double getNplannedmny() { - return nplannedmny; - } - - public void setNplannedmny(Double nplannedmny) { - this.nplannedmny = nplannedmny; - } - - public Double getNplannedprice() { - return nplannedprice; - } - - public void setNplannedprice(Double nplannedprice) { - this.nplannedprice = nplannedprice; - } - - public Double getNprice() { - return nprice; - } - - public void setNprice(Double nprice) { - this.nprice = nprice; - } - - public Integer getNpricesettlebill() { - return npricesettlebill; - } - - public void setNpricesettlebill(Integer npricesettlebill) { - this.npricesettlebill = npricesettlebill; - } - - public Double getNquotemny() { - return nquotemny; - } - - public void setNquotemny(Double nquotemny) { - this.nquotemny = nquotemny; - } - - public Double getNquotentmny() { - return nquotentmny; - } - - public void setNquotentmny(Double nquotentmny) { - this.nquotentmny = nquotentmny; - } - - public Double getNquotentprice() { - return nquotentprice; - } - - public void setNquotentprice(Double nquotentprice) { - this.nquotentprice = nquotentprice; - } - - public Double getNquoteprice() { - return nquoteprice; - } - - public void setNquoteprice(Double nquoteprice) { - this.nquoteprice = nquoteprice; - } - - public Double getNquoteunitnum() { - return nquoteunitnum; - } - - public void setNquoteunitnum(Double nquoteunitnum) { - this.nquoteunitnum = nquoteunitnum; - } - - public Double getNquoteunitrate() { - return nquoteunitrate; - } - - public void setNquoteunitrate(Double nquoteunitrate) { - this.nquoteunitrate = nquoteunitrate; - } - - public Double getNreplenishedastnum() { - return nreplenishedastnum; - } - - public void setNreplenishedastnum(Double nreplenishedastnum) { - this.nreplenishedastnum = nreplenishedastnum; - } - - public Double getNreplenishednum() { - return nreplenishednum; - } - - public void setNreplenishednum(Double nreplenishednum) { - this.nreplenishednum = nreplenishednum; - } - - public Double getNretastnum() { - return nretastnum; - } - - public void setNretastnum(Double nretastnum) { - this.nretastnum = nretastnum; - } - - public Double getNretgrossnum() { - return nretgrossnum; - } - - public void setNretgrossnum(Double nretgrossnum) { - this.nretgrossnum = nretgrossnum; - } - - public Double getNretnum() { - return nretnum; - } - - public void setNretnum(Double nretnum) { - this.nretnum = nretnum; - } - - public Double getNsalemny() { - return nsalemny; - } - - public void setNsalemny(Double nsalemny) { - this.nsalemny = nsalemny; - } - - public Double getNsaleprice() { - return nsaleprice; - } - - public void setNsaleprice(Double nsaleprice) { - this.nsaleprice = nsaleprice; - } - - public Double getNshouldinnum() { - return nshouldinnum; - } - - public void setNshouldinnum(Double nshouldinnum) { - this.nshouldinnum = nshouldinnum; - } - - public Double getNshouldoutassistnum() { - return nshouldoutassistnum; - } - - public void setNshouldoutassistnum(Double nshouldoutassistnum) { - this.nshouldoutassistnum = nshouldoutassistnum; - } - - public Double getNshouldoutnum() { - return nshouldoutnum; - } - - public void setNshouldoutnum(Double nshouldoutnum) { - this.nshouldoutnum = nshouldoutnum; - } - - public Double getNtarenum() { - return ntarenum; - } - - public void setNtarenum(Double ntarenum) { - this.ntarenum = ntarenum; - } - - public Double getNtaxmny() { - return ntaxmny; - } - - public void setNtaxmny(Double ntaxmny) { - this.ntaxmny = ntaxmny; - } - - public Double getNtaxprice() { - return ntaxprice; - } - - public void setNtaxprice(Double ntaxprice) { - this.ntaxprice = ntaxprice; - } - - public Double getNtotalmatchnum() { - return ntotalmatchnum; - } - - public void setNtotalmatchnum(Double ntotalmatchnum) { - this.ntotalmatchnum = ntotalmatchnum; - } - - public Double getNtotalreasonwastenum() { - return ntotalreasonwastenum; - } - - public void setNtotalreasonwastenum(Double ntotalreasonwastenum) { - this.ntotalreasonwastenum = ntotalreasonwastenum; - } - - public Double getNtranoutastnum() { - return ntranoutastnum; - } - - public void setNtranoutastnum(Double ntranoutastnum) { - this.ntranoutastnum = ntranoutastnum; - } - - public Double getNtranoutnum() { - return ntranoutnum; - } - - public void setNtranoutnum(Double ntranoutnum) { - this.ntranoutnum = ntranoutnum; - } - - public String getPkBodycalbody() { - return pkBodycalbody; - } - - public void setPkBodycalbody(String pkBodycalbody) { - this.pkBodycalbody = pkBodycalbody; - } - - public String getPkCorp() { - return pkCorp; - } - - public void setPkCorp(String pkCorp) { - this.pkCorp = pkCorp; - } - - public String getPkCreqwareid() { - return pkCreqwareid; - } - - public void setPkCreqwareid(String pkCreqwareid) { - this.pkCreqwareid = pkCreqwareid; - } - - public String getPkCubasdoc() { - return pkCubasdoc; - } - - public void setPkCubasdoc(String pkCubasdoc) { - this.pkCubasdoc = pkCubasdoc; - } - - public String getPkDefdoc1() { - return pkDefdoc1; - } - - public void setPkDefdoc1(String pkDefdoc1) { - this.pkDefdoc1 = pkDefdoc1; - } - - public String getPkDefdoc10() { - return pkDefdoc10; - } - - public void setPkDefdoc10(String pkDefdoc10) { - this.pkDefdoc10 = pkDefdoc10; - } - - public String getPkDefdoc11() { - return pkDefdoc11; - } - - public void setPkDefdoc11(String pkDefdoc11) { - this.pkDefdoc11 = pkDefdoc11; - } - - public String getPkDefdoc12() { - return pkDefdoc12; - } - - public void setPkDefdoc12(String pkDefdoc12) { - this.pkDefdoc12 = pkDefdoc12; - } - - public String getPkDefdoc13() { - return pkDefdoc13; - } - - public void setPkDefdoc13(String pkDefdoc13) { - this.pkDefdoc13 = pkDefdoc13; - } - - public String getPkDefdoc14() { - return pkDefdoc14; - } - - public void setPkDefdoc14(String pkDefdoc14) { - this.pkDefdoc14 = pkDefdoc14; - } - - public String getPkDefdoc15() { - return pkDefdoc15; - } - - public void setPkDefdoc15(String pkDefdoc15) { - this.pkDefdoc15 = pkDefdoc15; - } - - public String getPkDefdoc16() { - return pkDefdoc16; - } - - public void setPkDefdoc16(String pkDefdoc16) { - this.pkDefdoc16 = pkDefdoc16; - } - - public String getPkDefdoc17() { - return pkDefdoc17; - } - - public void setPkDefdoc17(String pkDefdoc17) { - this.pkDefdoc17 = pkDefdoc17; - } - - public String getPkDefdoc18() { - return pkDefdoc18; - } - - public void setPkDefdoc18(String pkDefdoc18) { - this.pkDefdoc18 = pkDefdoc18; - } - - public String getPkDefdoc19() { - return pkDefdoc19; - } - - public void setPkDefdoc19(String pkDefdoc19) { - this.pkDefdoc19 = pkDefdoc19; - } - - public String getPkDefdoc2() { - return pkDefdoc2; - } - - public void setPkDefdoc2(String pkDefdoc2) { - this.pkDefdoc2 = pkDefdoc2; - } - - public String getPkDefdoc20() { - return pkDefdoc20; - } - - public void setPkDefdoc20(String pkDefdoc20) { - this.pkDefdoc20 = pkDefdoc20; - } - - public String getPkDefdoc3() { - return pkDefdoc3; - } - - public void setPkDefdoc3(String pkDefdoc3) { - this.pkDefdoc3 = pkDefdoc3; - } - - public String getPkDefdoc4() { - return pkDefdoc4; - } - - public void setPkDefdoc4(String pkDefdoc4) { - this.pkDefdoc4 = pkDefdoc4; - } - - public String getPkDefdoc5() { - return pkDefdoc5; - } - - public void setPkDefdoc5(String pkDefdoc5) { - this.pkDefdoc5 = pkDefdoc5; - } - - public String getPkDefdoc6() { - return pkDefdoc6; - } - - public void setPkDefdoc6(String pkDefdoc6) { - this.pkDefdoc6 = pkDefdoc6; - } - - public String getPkDefdoc7() { - return pkDefdoc7; - } - - public void setPkDefdoc7(String pkDefdoc7) { - this.pkDefdoc7 = pkDefdoc7; - } - - public String getPkDefdoc8() { - return pkDefdoc8; - } - - public void setPkDefdoc8(String pkDefdoc8) { - this.pkDefdoc8 = pkDefdoc8; - } - - public String getPkDefdoc9() { - return pkDefdoc9; - } - - public void setPkDefdoc9(String pkDefdoc9) { - this.pkDefdoc9 = pkDefdoc9; - } - - public String getPkInvoicecorp() { - return pkInvoicecorp; - } - - public void setPkInvoicecorp(String pkInvoicecorp) { - this.pkInvoicecorp = pkInvoicecorp; - } - - public String getPkMeasware() { - return pkMeasware; - } - - public void setPkMeasware(String pkMeasware) { - this.pkMeasware = pkMeasware; - } - - public String getPkPacksort() { - return pkPacksort; - } - - public void setPkPacksort(String pkPacksort) { - this.pkPacksort = pkPacksort; - } - - public String getPkReqcorp() { - return pkReqcorp; - } - - public void setPkReqcorp(String pkReqcorp) { - this.pkReqcorp = pkReqcorp; - } - - public String getPkReqstoorg() { - return pkReqstoorg; - } - - public void setPkReqstoorg(String pkReqstoorg) { - this.pkReqstoorg = pkReqstoorg; - } - - public String getPkReturnreason() { - return pkReturnreason; - } - - public void setPkReturnreason(String pkReturnreason) { - this.pkReturnreason = pkReturnreason; - } - - public String getProcess1() { - return process1; - } - - public void setProcess1(String process1) { - this.process1 = process1; - } - - public String getProcess2() { - return process2; - } - - public void setProcess2(String process2) { - this.process2 = process2; - } - - public String getProcess3() { - return process3; - } - - public void setProcess3(String process3) { - this.process3 = process3; - } - - public String getProcess4() { - return process4; - } - - public void setProcess4(String process4) { - this.process4 = process4; - } - - public String getProcess5() { - return process5; - } - - public void setProcess5(String process5) { - this.process5 = process5; - } - - public Double getProcesscost() { - return processcost; - } - - public void setProcesscost(Double processcost) { - this.processcost = processcost; - } - - public String getProcessmanid() { - return processmanid; - } - - public void setProcessmanid(String processmanid) { - this.processmanid = processmanid; - } - - public Integer getSerialnum() { - return serialnum; - } - - public void setSerialnum(Integer serialnum) { - this.serialnum = serialnum; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getVbatchcode() { - return vbatchcode; - } - - public void setVbatchcode(String vbatchcode) { - this.vbatchcode = vbatchcode; - } - - public String getVbilltypeu8rm() { - return vbilltypeu8rm; - } - - public void setVbilltypeu8rm(String vbilltypeu8rm) { - this.vbilltypeu8rm = vbilltypeu8rm; - } - - public String getVbodynote2() { - return vbodynote2; - } - - public void setVbodynote2(String vbodynote2) { - this.vbodynote2 = vbodynote2; - } - - public String getVcorrespondrowno() { - return vcorrespondrowno; - } - - public void setVcorrespondrowno(String vcorrespondrowno) { - this.vcorrespondrowno = vcorrespondrowno; - } - - public String getVfirstbillcode() { - return vfirstbillcode; - } - - public void setVfirstbillcode(String vfirstbillcode) { - this.vfirstbillcode = vfirstbillcode; - } - - public String getVfirstrowno() { - return vfirstrowno; - } - - public void setVfirstrowno(String vfirstrowno) { - this.vfirstrowno = vfirstrowno; - } - - public String getVfree1() { - return vfree1; - } - - public void setVfree1(String vfree1) { - this.vfree1 = vfree1; - } - - public String getVfree10() { - return vfree10; - } - - public void setVfree10(String vfree10) { - this.vfree10 = vfree10; - } - - public String getVfree2() { - return vfree2; - } - - public void setVfree2(String vfree2) { - this.vfree2 = vfree2; - } - - public String getVfree3() { - return vfree3; - } - - public void setVfree3(String vfree3) { - this.vfree3 = vfree3; - } - - public String getVfree4() { - return vfree4; - } - - public void setVfree4(String vfree4) { - this.vfree4 = vfree4; - } - - public String getVfree5() { - return vfree5; - } - - public void setVfree5(String vfree5) { - this.vfree5 = vfree5; - } - - public String getVfree6() { - return vfree6; - } - - public void setVfree6(String vfree6) { - this.vfree6 = vfree6; - } - - public String getVfree7() { - return vfree7; - } - - public void setVfree7(String vfree7) { - this.vfree7 = vfree7; - } - - public String getVfree8() { - return vfree8; - } - - public void setVfree8(String vfree8) { - this.vfree8 = vfree8; - } - - public String getVfree9() { - return vfree9; - } - - public void setVfree9(String vfree9) { - this.vfree9 = vfree9; - } - - public String getVnotebody() { - return vnotebody; - } - - public void setVnotebody(String vnotebody) { - this.vnotebody = vnotebody; - } - - public String getVproductbatch() { - return vproductbatch; - } - - public void setVproductbatch(String vproductbatch) { - this.vproductbatch = vproductbatch; - } - - public String getVreceiveaddress() { - return vreceiveaddress; - } - - public void setVreceiveaddress(String vreceiveaddress) { - this.vreceiveaddress = vreceiveaddress; - } - - public String getVsignwastcode() { - return vsignwastcode; - } - - public void setVsignwastcode(String vsignwastcode) { - this.vsignwastcode = vsignwastcode; - } - - public String getVsignwastrowno() { - return vsignwastrowno; - } - - public void setVsignwastrowno(String vsignwastrowno) { - this.vsignwastrowno = vsignwastrowno; - } - - public String getVsourcebillcode() { - return vsourcebillcode; - } - - public void setVsourcebillcode(String vsourcebillcode) { - this.vsourcebillcode = vsourcebillcode; - } - - public String getVsourcerowno() { - return vsourcerowno; - } - - public void setVsourcerowno(String vsourcerowno) { - this.vsourcerowno = vsourcerowno; - } - - public String getVsourcewastcode() { - return vsourcewastcode; - } - - public void setVsourcewastcode(String vsourcewastcode) { - this.vsourcewastcode = vsourcewastcode; - } - - public String getVsourcewastrowno() { - return vsourcewastrowno; - } - - public void setVsourcewastrowno(String vsourcewastrowno) { - this.vsourcewastrowno = vsourcewastrowno; - } - - public String getVsrc2billcode() { - return vsrc2billcode; - } - - public void setVsrc2billcode(String vsrc2billcode) { - this.vsrc2billcode = vsrc2billcode; - } - - public String getVsrc2billrowno() { - return vsrc2billrowno; - } - - public void setVsrc2billrowno(String vsrc2billrowno) { - this.vsrc2billrowno = vsrc2billrowno; - } - - public String getVtransfercode() { - return vtransfercode; - } - - public void setVtransfercode(String vtransfercode) { - this.vtransfercode = vtransfercode; - } - - public String getVuserdef1() { - return vuserdef1; - } - - public void setVuserdef1(String vuserdef1) { - this.vuserdef1 = vuserdef1; - } - - public String getVuserdef10() { - return vuserdef10; - } - - public void setVuserdef10(String vuserdef10) { - this.vuserdef10 = vuserdef10; - } - - public String getVuserdef11() { - return vuserdef11; - } - - public void setVuserdef11(String vuserdef11) { - this.vuserdef11 = vuserdef11; - } - - public String getVuserdef12() { - return vuserdef12; - } - - public void setVuserdef12(String vuserdef12) { - this.vuserdef12 = vuserdef12; - } - - public String getVuserdef13() { - return vuserdef13; - } - - public void setVuserdef13(String vuserdef13) { - this.vuserdef13 = vuserdef13; - } - - public String getVuserdef14() { - return vuserdef14; - } - - public void setVuserdef14(String vuserdef14) { - this.vuserdef14 = vuserdef14; - } - - public String getVuserdef15() { - return vuserdef15; - } - - public void setVuserdef15(String vuserdef15) { - this.vuserdef15 = vuserdef15; - } - - public String getVuserdef16() { - return vuserdef16; - } - - public void setVuserdef16(String vuserdef16) { - this.vuserdef16 = vuserdef16; - } - - public String getVuserdef17() { - return vuserdef17; - } - - public void setVuserdef17(String vuserdef17) { - this.vuserdef17 = vuserdef17; - } - - public String getVuserdef18() { - return vuserdef18; - } - - public void setVuserdef18(String vuserdef18) { - this.vuserdef18 = vuserdef18; - } - - public String getVuserdef19() { - return vuserdef19; - } - - public void setVuserdef19(String vuserdef19) { - this.vuserdef19 = vuserdef19; - } - - public String getVuserdef2() { - return vuserdef2; - } - - public void setVuserdef2(String vuserdef2) { - this.vuserdef2 = vuserdef2; - } - - public String getVuserdef20() { - return vuserdef20; - } - - public void setVuserdef20(String vuserdef20) { - this.vuserdef20 = vuserdef20; - } - - public String getVuserdef3() { - return vuserdef3; - } - - public void setVuserdef3(String vuserdef3) { - this.vuserdef3 = vuserdef3; - } - - public String getVuserdef4() { - return vuserdef4; - } - - public void setVuserdef4(String vuserdef4) { - this.vuserdef4 = vuserdef4; - } - - public String getVuserdef5() { - return vuserdef5; - } - - public void setVuserdef5(String vuserdef5) { - this.vuserdef5 = vuserdef5; - } - - public String getVuserdef6() { - return vuserdef6; - } - - public void setVuserdef6(String vuserdef6) { - this.vuserdef6 = vuserdef6; - } - - public String getVuserdef7() { - return vuserdef7; - } - - public void setVuserdef7(String vuserdef7) { - this.vuserdef7 = vuserdef7; - } - - public String getVuserdef8() { - return vuserdef8; - } - - public void setVuserdef8(String vuserdef8) { - this.vuserdef8 = vuserdef8; - } - - public String getVuserdef9() { - return vuserdef9; - } - - public void setVuserdef9(String vuserdef9) { - this.vuserdef9 = vuserdef9; - } - - public String getVvehiclecode() { - return vvehiclecode; - } - - public void setVvehiclecode(String vvehiclecode) { - this.vvehiclecode = vvehiclecode; - } - - public String getWriteofftype() { - return writeofftype; - } - - public void setWriteofftype(String writeofftype) { - this.writeofftype = writeofftype; - } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.xml index 2df420ca..e39e7b03 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IcGeneralBEntity.xml @@ -1,6 +1,6 @@ - + @@ -35,6 +35,7 @@ + @@ -253,8 +254,9 @@ ,cfreezeid ,cgeneralbid ,cgeneralhid - ,cinvbasid - ,cinventoryid + ,cinvbascode + ,cinvbasid + ,cinventoryid ,corder_bb1id ,cparentid ,cprojectid @@ -658,10 +660,240 @@ and vuserdef9 = #{vuserdef9} and vvehiclecode = #{vvehiclecode} and writeofftype = #{writeofftype} + and dr=0 order by ${sort} ${order} + + + + + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryOfsSKURequestVO.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryOfsSKURequestVO.java index 52a7692b..64267b7d 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryOfsSKURequestVO.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryOfsSKURequestVO.java @@ -16,9 +16,13 @@ public class QueryOfsSKURequestVO { /** 组织 */ private String clientCode; + private String lastUpdated_start; + private String lastUpdated_end; + + private String companyCode; - private int status; + private String status; private String code; - private int pageNo; - private int pageSize; + private String pageNo; + private String pageSize; } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java index 6547bba6..92c58702 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java @@ -11,6 +11,7 @@ import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto; +import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse; import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -98,8 +99,8 @@ public class SKUPluginInitializer extends PluginBaseEntity { // queryOfsSKURequestVO.setCreated_start("2023-10-15 00:00:00"); // queryOfsSKURequestVO.setCreated_end("2023-10-21 23:59:59"); // queryOfsSKURequestVO.setCompanyCode(""); - queryOfsSKURequestVO.setPageNo(1); - queryOfsSKURequestVO.setPageSize(500); + queryOfsSKURequestVO.setPageNo("1"); + queryOfsSKURequestVO.setPageSize("500"); queryOfsSKUs(queryOfsSKURequestVO); @@ -134,6 +135,14 @@ public class SKUPluginInitializer extends PluginBaseEntity { Date business_end = DateUtil.parse(endTime); String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00"; String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; + + QueryOfsSKURequestVO queryOfsSKURequestVO = new QueryOfsSKURequestVO(); + queryOfsSKURequestVO.setLastUpdated_start(start); + queryOfsSKURequestVO.setLastUpdated_end(end); + queryOfsSKURequestVO.setPageNo("1"); + queryOfsSKURequestVO.setPageSize("500"); + queryOfsSKUs(queryOfsSKURequestVO); + } catch (Exception e) { logger.error("丽知:丽知:OFS货品档案--->U8C货品档案,start(String startTime, String endTime)方法报错:", e); } @@ -141,13 +150,15 @@ public class SKUPluginInitializer extends PluginBaseEntity { /** * 查询OFS SKU档案 + * status 0禁用 1启用 */ public void queryOfsSKUs(QueryOfsSKURequestVO queryOfsGoodsRequestVO) throws Exception { InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto(); interfaceParamDto.setApi("ofs.sku.search"); queryOfsGoodsRequestVO.setClientCode("LETS"); interfaceParamDto.setData(JSON.toJSONString(queryOfsGoodsRequestVO)); - ReturnMessageBasics returnMessageBasics = ofsUnifiedService.unifiedByU8CApi(interfaceParamDto); + OFSSKUSearchResponse ofsskuSearchResponse =(OFSSKUSearchResponse) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto); + System.out.println(ofsskuSearchResponse); } 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/plugin/transfer/TransferInPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java index 6d14ffed..40d64141 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java @@ -2,18 +2,37 @@ package com.hzya.frame.plugin.lets.plugin.transfer; import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Assert; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.lets.constant.OverallConstant; +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +import com.hzya.frame.plugin.lets.dao.IIcGeneralBDao; +import com.hzya.frame.plugin.lets.dao.IIcGeneralHDao; +import com.hzya.frame.plugin.lets.dao.IToBillDao; +import com.hzya.frame.plugin.lets.entity.IcGeneralBEntity; +import com.hzya.frame.plugin.lets.entity.IcGeneralHEntity; +import com.hzya.frame.plugin.lets.entity.ToBillEntity; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO; +import com.hzya.frame.plugin.lets.u8cdto.BillVO; +import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO; +import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto; import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; +import com.hzya.frame.plugin.lets.util.pushData.Attribute; +import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode; +import com.hzya.frame.plugin.lets.util.pushData.ZTResult; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; +import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; +import com.hzya.frame.ttxofs.dto.stock.StockoutOrderSearchResponse; import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -25,6 +44,9 @@ import java.util.Date; import java.util.List; import java.util.concurrent.locks.ReentrantLock; +/** + * 丽知:OFS调拨入库订单--->U8C调拨入库订单 + */ public class TransferInPluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class); @@ -47,12 +69,12 @@ public class TransferInPluginInitializer extends PluginBaseEntity { @Override public String getPluginName() { - return "丽知:OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库)"; + return "丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单)"; } @Override public String getPluginLabel() { - return "丽知:OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库)"; + return "丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单)"; } @Override @@ -65,13 +87,56 @@ public class TransferInPluginInitializer extends PluginBaseEntity { @Autowired private PushDataByU8cUtil pushDataByU8cUtil; @Autowired + private PushU8CByApiCode pushU8CByApiCode; + @Autowired private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; @Autowired private OfsUnifiedService ofsUnifiedService; + @Autowired + private IToBillDao toBillDao; + + @Autowired + private IIcGeneralHDao icGeneralHDao; + @Autowired + private IIcGeneralBDao icGeneralBDao; + + @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + try { + logger.info("调用:" + getPluginName() + "-插件"); + String prod = "prod"; + String param = String.valueOf(requestJson.get("param")); + if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) { + //按日期 + if (param != null && !"".equals(param)) { + String[] split = param.split("/"); + if (!(split.length == 2)) { + Assert.state(false, "时间格式传递不正确"); + } + Assert.notNull(split[0], "开始时间不能为空"); + Assert.notNull(split[1], "结束时间不能为空"); + start(split[0], split[1]); + } + } else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) { + //按单号 + if (param != null && !"".equals(param)) { + start(param); + } + } else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) { + String integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails); + start(integrationTaskLivingDetailsEntity.getRootAppPk()); + } else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) { + //默认 + start(); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("executeBusiness方法抛出异常", e); + } return null; } @@ -89,24 +154,25 @@ public class TransferInPluginInitializer extends PluginBaseEntity { String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); -// queryOfsStockinOrderRequestVO.setCreated_start("2024-08-05 00:00:00"); -// queryOfsStockinOrderRequestVO.setCreated_end("2024-08-09 23:59:59"); - queryOfsStockinOrderRequestVO.setClosedAt_start("2024-08-05 00:00:00"); - queryOfsStockinOrderRequestVO.setClosedAt_end("2024-08-09 23:59:59"); -// queryOfsStockinOrderRequestVO.setCompanyCode("SHXM"); -// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 - queryOfsStockinOrderRequestVO.setPageNo(1L); - queryOfsStockinOrderRequestVO.setPageSize(500L); - List data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); - System.out.println(data); + queryOfsStockinOrderRequestVO.setClosedAt_start(startTimeStr); + queryOfsStockinOrderRequestVO.setClosedAt_end(endTimeStr); + //状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 + queryOfsStockinOrderRequestVO.setStatus("900"); + List transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); + if (transferInOrder == null || transferInOrder.size() == 0) { + return; + } //过滤日志 - - //推送 + List filterTransferInOrders = filterData(transferInOrder); + if (filterTransferInOrders.size() == 0) { + return; + } + implement(filterTransferInOrders); } catch (Exception e) { - logger.error("丽知:OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库),start()方法报错:", e); + logger.error("丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单),start()方法报错:", e); } } @@ -118,15 +184,23 @@ public class TransferInPluginInitializer extends PluginBaseEntity { QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); queryOfsStockinOrderRequestVO.setCode(stockinNo); - queryOfsStockinOrderRequestVO.setPageNo(1L); - queryOfsStockinOrderRequestVO.setPageSize(500L); - List data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); - System.out.println(data); + //状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 + queryOfsStockinOrderRequestVO.setStatus("900"); + List transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); + if (transferInOrder == null || transferInOrder.size() == 0) { + Assert.state(false, "丽知:OFS调拨入库--->U8C调拨入库根据单据号[入库完成]:{},未查询到调拨入库单", stockinNo); + } + //过滤日志 + List filterTransferInOrders = filterData(transferInOrder); + if (filterTransferInOrders.size() == 0) { + Assert.state(false, "丽知:OFS调拨入库--->U8C调拨入库根据单据号[入库完成]:{},该调拨入库单已被推送成功,请勿重新推送", stockinNo); + } + implement(filterTransferInOrders); } catch (Exception e) { - logger.error("丽知:OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库),start(String goodsName)方法报错:", e); + logger.error("丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单),start(String goodsName)方法报错:", e); } } @@ -142,40 +216,320 @@ public class TransferInPluginInitializer extends PluginBaseEntity { String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); - queryOfsStockinOrderRequestVO.setClosedAt_start("2024-08-05 00:00:00"); - queryOfsStockinOrderRequestVO.setClosedAt_end("2024-08-09 23:59:59"); -// queryOfsStockinOrderRequestVO.setCompanyCode("SHXM"); -// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 - queryOfsStockinOrderRequestVO.setPageNo(1L); - queryOfsStockinOrderRequestVO.setPageSize(500L); - List data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); - System.out.println(data); + queryOfsStockinOrderRequestVO.setClosedAt_start(start); + queryOfsStockinOrderRequestVO.setClosedAt_end(end); + //状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 + queryOfsStockinOrderRequestVO.setStatus("900"); + List transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); + + if (transferInOrder == null || transferInOrder.size() == 0) { + Assert.state(false, "丽知:OFS调拨入库订单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调拨入库单[入库完成]", startTime, endTime); + } + //过滤日志 + List filterTransferInOrders = filterData(transferInOrder); + if (filterTransferInOrders.size() == 0) { + Assert.state(false, "丽知:OFS调拨入库订单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]:{}-{},该调期调拨入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime); + } + implement(filterTransferInOrders); + } catch (Exception e) { - logger.error("丽知:OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库),start(String startTime, String endTime)方法报错:", e); + logger.error("丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单),start(String startTime, String endTime)方法报错:", e); } } + /** + * 过滤成功日志 + * + * @return + */ + public List filterData(List stockinOrders) { + List filterStockinOrders = new ArrayList<>(); + for (StockinOrderSearchResponse.StockinOrder stockinOrder : stockinOrders) { + StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader(); + String rootAppPk = header.getCode(); + boolean isExis = true; + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); + if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { + isExis = false; + } + if (!isExis) { + filterStockinOrders.add(stockinOrder); + } + } + return filterStockinOrders; + } + /** + * ofs调拨入库推送u8c调拨入库,关联调拨订单。 + *

+ * 根据ofs调拨订单,可以查询到u8c调拨订单 + * u8c调拨出库单子表的来源单据号vsourcebillcode(调拨订单号) + * + * @param filterTransferInOrders + */ + public void implement(List filterTransferInOrders) { + for (StockinOrderSearchResponse.StockinOrder transferInOrders : filterTransferInOrders) { + System.out.println(transferInOrders); + String mapStr = ""; + String format = ""; + String response = ""; + String ofsCode = ""; + try { + StockinOrderSearchResponse.StockinOrder.StockinH ofsTransferHeader = transferInOrders.getHeader(); + + //ofs调拨订单号 + String ofsSourceOrderCode = ofsTransferHeader.getSourceOrderCode(); + //ofs调拨入库单单号 + ofsCode = ofsTransferHeader.getCode(); + //ofs最后修改时间,调入时间 + format = ofsTransferHeader.getLastUpdated(); + + GeneralBillVO generalBillVO = new GeneralBillVO(); + //主表 + GeneralBillVO.Parentvo parentvo = new GeneralBillVO.Parentvo(); + //coperatorid 制单人 + parentvo.setCoperatorid("tbadmin"); + //cwarehouseid 仓库 + parentvo.setCwarehouseid(ofsTransferHeader.getFacilityCode()); + //pk_calbody 库存组织 + parentvo.setPk_calbody(ofsTransferHeader.getCompanyCode()); + //pk_corp 公司 + parentvo.setPk_corp(ofsTransferHeader.getCompanyCode()); + //pk_defdoc19 自定义项19(ofs调拨订单号) + parentvo.setPk_defdoc19(ofsSourceOrderCode); + + //U8C调拨订单信息 +// List toBillEntityList = queryToBillByPkVdefdoc19(ofsSourceOrderCode); + //U8C调拨出库单主表信息 + List icGeneralHEntityList = queryIcGeneralHByPkVdefdoc19(ofsSourceOrderCode); + if (icGeneralHEntityList == null) { + Assert.state(false, "在U8C内根据OFS调拨订单号(pk_vdefdoc19):{},没有查询到调拨出库单,请检查。", ofsSourceOrderCode); + } + if (icGeneralHEntityList.size() > 1) { + Assert.state(false, "在U8C内根据OFS调拨订单号(pk_vdefdoc19):{},查询到调拨出库单不唯一,请检查。", ofsSourceOrderCode); + } + IcGeneralHEntity icGeneralHEntity = icGeneralHEntityList.get(0); + + //U8C调拨出库单子表信息 + List icGeneralBEntityList = queryIcGeneralBByCgeneralhid(icGeneralHEntity.getCgeneralhid()); + if (icGeneralBEntityList == null) { + Assert.state(false, "在U8C内根据U8C调拨出库单主表主键:{},调拨出库单单号:{},未查询到调拨出库单子表信息,请检查。", icGeneralHEntity.getCgeneralhid(), icGeneralHEntity.getVbillcode()); + } + + List ChildrenList = new ArrayList<>(); + int i = 1; + for (StockinOrderSearchResponse.StockinOrder.StockinB ofsTransferDetail : transferInOrders.getDetails()) { + GeneralBillVO.Childrenvo childrenvo = new GeneralBillVO.Childrenvo(); + + //cinventoryid 存货 + childrenvo.setCinventoryid(ofsTransferDetail.getSkuCode()); + //ninnum 实收数量 + childrenvo.setNinnum(ofsTransferDetail.getReceivedQty()); + //csourcetype 来源单据类型编码 + childrenvo.setCsourcetype("4Y"); + //vsourcebillcode 来源单据号 + childrenvo.setVsourcebillcode(icGeneralHEntity.getVbillcode()); + + + for (IcGeneralBEntity icGeneralBEntity : icGeneralBEntityList) { + System.out.println(icGeneralBEntity); + //根据存货+行号匹配 + if (ofsTransferDetail.getRefOrderDetailId().equals(icGeneralBEntity.getPkDefdoc20().trim()) && ofsTransferDetail.getSkuCode().equals(icGeneralBEntity.getCinvbascode())) { + //crowno 行号 + childrenvo.setCrowno(i++ + "0"); + //ofs来源单据行行号 + childrenvo.setPk_defdoc20(ofsTransferDetail.getRefOrderDetailId()); + //vsourcerowno 来源单据行号 + childrenvo.setVsourcerowno(icGeneralBEntity.getCrowno()); + break; + } + } + ChildrenList.add(childrenvo); + } + generalBillVO.setParentvo(parentvo); + generalBillVO.setChildrenvo(ChildrenList); + + mapStr = "{\"GeneralBillVO\":[" + JSONUtil.toJsonStr(generalBillVO) + "]}"; + ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveInqzCode"), mapStr); + System.out.println(ztResult); + //两层判断,一层中台转发,一层u8c返回 + if ("false".equals(ztResult.getFlag())) { + //转发失败 + Assert.state(false, "丽知:OFS调拨入库订单--->U8C调拨入库订单.中台转发失败,失败原因:{}", ztResult.getMsg()); + } + Attribute attribute = ztResult.getAttribute(); + System.out.println(attribute); + boolean isSuccess = false; + String vbillcode = ""; + if ("success".equals(attribute.getStatus())) { + isSuccess = true; + String data = attribute.getData(); + GeneralBillVO generalBill = resultDataHandle(data); + System.out.println(generalBill); + vbillcode = generalBill.getParentvo().getVbillcode(); + } + if (!isSuccess) { + Assert.state(false, "推送U8C--> 丽知:OFS调拨入库订单--->U8C调拨入库订单 失败 接口返回结果:{} 接口入参:{}", response, mapStr); + } + + //成功 + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); + integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(response); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(format); + integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); + integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode); + integrationTaskLivingDetailsEntity.setDef1(vbillcode); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + + } catch (Exception e) { + e.printStackTrace(); + logger.error("推送U8C,丽知:OFS调拨入库订单--->U8C调拨入库订单(保存签字,关联U8C调拨出库单)失败,失败原因:" + e); + ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); + String ErrMessage = null; + if (reusltStrDto != null) { + ErrMessage = "推送U8C,丽知:OFS调整入库--->U8C其它入库失败,失败原因:" + reusltStrDto.getErrormsg(); + } else { + ErrMessage = e.getMessage(); + } + //失败 + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); + integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(format); + integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode); + integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + } + } + + } + + private GeneralBillVO resultDataHandle(String resultData) { + try { + if (resultData != null && !"".equals(resultData)) { + if (resultData.contains("[")) { + resultData = resultData.substring(1, resultData.length() - 1); + } + return JSON.parseObject(resultData, GeneralBillVO.class); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("解析返回参数失败的错误", e); + //如果解析失败,记录原因,但是不能影响结果的记录 + } + return null; + } + + + /** + * 查询ofs调拨入库单 + * + * @param queryOfsStockinOrderRequestVO + * @return + * @throws Exception + */ public List queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception { + Long pageNo = 1L; + + List all = new ArrayList<>(); + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); interfaceParamDto.setApi("ofs.receipt.search"); queryOfsStockinOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockinOrderRequestVO.setClientCode("LETS"); + queryOfsStockinOrderRequestVO.setPageNo(pageNo); + queryOfsStockinOrderRequestVO.setPageSize(500L); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); - System.out.println(stockinOrderSearchResponse); - if(stockinOrderSearchResponse.getData()==null||stockinOrderSearchResponse.getData().size()==0){ + + all.addAll(stockinOrderSearchResponse.getData()); + + int count = stockinOrderSearchResponse.getData().size(); + while (count >= 500) {//>=500,可能还有下一页。 + //还有下一页 + pageNo++; + queryOfsStockinOrderRequestVO.setPageNo(pageNo); + interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); + StockinOrderSearchResponse stockinOrderSearchResponse1 = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); + + all.addAll(stockinOrderSearchResponse1.getData()); + + count=stockinOrderSearchResponse1.getData().size(); + } + if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) { return null; } - //过滤ADJUST调整 - List adjustList=new ArrayList<>(); - for (StockinOrderSearchResponse.StockinOrder datum : stockinOrderSearchResponse.getData()) { - StockinOrderSearchResponse.StockinOrder.StockinH header = datum.getHeader(); - if("ADJUST".equals(header.getInternalInstructionType())){ - adjustList.add(datum); - } - } - return adjustList; + return stockinOrderSearchResponse.getData(); } + + /** + * 根据单号查询调拨单 to_bill 单据主表 单据 + * + * @param vcode + */ + public List queryToBillByVCode(String vcode) { + ToBillEntity toBillEntity = new ToBillEntity(); + toBillEntity.setVcode(vcode); + toBillEntity.setCbilltype("5X"); + List toBillEntityList = toBillDao.queryToBillEntity(toBillEntity); + return toBillEntityList; + } + + /** + * 根据自定义项19(ofs调拨订单单号),查询u8c调拨订单 + * + * @param pkDefdoc19 + * @return + */ + public List queryToBillByPkVdefdoc19(String pkDefdoc19) { + ToBillEntity toBillEntity = new ToBillEntity(); + toBillEntity.setPkDefdoc19(pkDefdoc19); + toBillEntity.setCbilltype("5X"); + toBillEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List toBillEntityList = toBillDao.query(toBillEntity); + return toBillEntityList; + } + + /** + * 根据调拨出库单主表自定义项19(ofs调拨订单号)查询调拨出库单主表 + */ + public List queryIcGeneralHByPkVdefdoc19(String pkDefdoc19) { + IcGeneralHEntity icGeneralHEntity = new IcGeneralHEntity(); + icGeneralHEntity.setDr(0); + icGeneralHEntity.setPkDefdoc19(pkDefdoc19); + icGeneralHEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List icGeneralHEntityList = icGeneralHDao.query(icGeneralHEntity); + if (icGeneralHEntityList == null || icGeneralHEntityList.size() == 0) { + return null; + } + return icGeneralHEntityList; + } + + /** + * 根据调拨出库单主表主键,查询调拨出库单子表 + */ + public List queryIcGeneralBByCgeneralhid(String cgeneralhid) { +// IcGeneralBEntity icGeneralBEntity = new IcGeneralBEntity(); +// icGeneralBEntity.setDr(0); +// icGeneralBEntity.setCgeneralhid(cgeneralhid); +// icGeneralBEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List icGeneralBEntityList = icGeneralBDao.queryAndCinvbasCode(cgeneralhid); + if (icGeneralBEntityList == null || icGeneralBEntityList.size() == 0) { + return null; + } + return icGeneralBEntityList; + } + } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java index 5d30cd72..d08138ec 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java @@ -96,6 +96,38 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + try { + logger.info("调用:" + getPluginName() + "-插件"); + String prod = "prod"; + String param = String.valueOf(requestJson.get("param")); + if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) { + //按日期 + if (param != null && !"".equals(param)) { + String[] split = param.split("/"); + if (!(split.length == 2)) { + Assert.state(false, "时间格式传递不正确"); + } + Assert.notNull(split[0], "开始时间不能为空"); + Assert.notNull(split[1], "结束时间不能为空"); + start(split[0], split[1]); + } + } else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) { + //按单号 + if (param != null && !"".equals(param)) { + start(param); + } + } else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) { + String integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails); + start(integrationTaskLivingDetailsEntity.getRootAppPk()); + } else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) { + //默认 + start(); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("executeBusiness方法抛出异常", e); + } return null; } @@ -115,18 +147,18 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); queryOfsStockoutOrderRequestVO.setClosedAt_start(startTimeStr); queryOfsStockoutOrderRequestVO.setClosedAt_end(endTimeStr); -// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); -// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 - queryOfsStockoutOrderRequestVO.setPageNo(1L); - queryOfsStockoutOrderRequestVO.setPageSize(500L); - List data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); - System.out.println(data); - - //过滤日志 - - //推送 - - + queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 + List transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); + if(transferOutOrder.size()==0){ + return; + } + //过滤成功日志 + List filterTransferOutOrders = filterData(transferOutOrder); + if(filterTransferOutOrders.size()==0){ + return; + } + //推送U8C + implement(filterTransferOutOrders); } catch (Exception e) { logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start()方法报错:", e); } @@ -139,16 +171,16 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { try { QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); queryOfsStockoutOrderRequestVO.setCode(stockoutNo); -// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); -// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 - queryOfsStockoutOrderRequestVO.setPageNo(1L); - queryOfsStockoutOrderRequestVO.setPageSize(500L); + queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 List transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); - System.out.println(transferOutOrder); - + if(transferOutOrder.size()==0){ + Assert.state(false, "丽知:OFS调拨出库订单[出库完成]--->U8C调拨订单,自动生成调拨出库单(保存签字),未查询到调拨出库单", stockoutNo); + } //过滤成功日志 List filterTransferOutOrders = filterData(transferOutOrder); - + if(filterTransferOutOrders.size()==0){ + Assert.state(false, "丽知:OFS调拨出库订单[出库完成]--->U8C调拨订单,自动生成调拨出库单(保存签字),该调拨出库单已被推送成功,请勿重新推送", stockoutNo); + } //推送U8C implement(filterTransferOutOrders); @@ -170,13 +202,19 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); queryOfsStockoutOrderRequestVO.setClosedAt_start(start); queryOfsStockoutOrderRequestVO.setClosedAt_end(end); -// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); -// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 - queryOfsStockoutOrderRequestVO.setPageNo(1L); - queryOfsStockoutOrderRequestVO.setPageSize(500L); - List data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); - System.out.println(data); + queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 + List transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); + if(transferOutOrder.size()==0){ + Assert.state(false, "丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调拨出库单[出库完成]", startTime, endTime); + } + //过滤成功日志 + List filterTransferOutOrders = filterData(transferOutOrder); + if(filterTransferOutOrders.size()==0){ + Assert.state(false, "丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)根据日期期间[开始时间]-[结束时间]:{}-{},该调期调拨出库单[出库完成]已被推送成功,请勿重新推送", startTime, endTime); + } + //推送U8C + implement(filterTransferOutOrders); } catch (Exception e) { logger.error("丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字),start(String startTime, String endTime)方法报错:", e); } @@ -204,7 +242,6 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { } } return filterTransferOutOrders; - } /** @@ -215,7 +252,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { public void implement(List filterTransferOutOrders) { for (StockoutOrderSearchResponse.StockoutOrder transferOutOrder : filterTransferOutOrders) { System.out.println(transferOutOrder); - BillVO billVO = new BillVO(); + BillVO billVO = new BillVO(); String mapStr = ""; String format = ""; @@ -227,18 +264,16 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { BillVO.Parentvo parentvo = new BillVO.Parentvo(); ofsCode = stockoutH.getCode(); - ////////////////////////////////////////////////////////////////////////////////ofs调拨订单 List ofsTranseferOrders = queryOfsTransderOrder(stockoutH.getSourceOrderCode()); - if(ofsTranseferOrders==null||ofsTranseferOrders.size()==0||ofsTranseferOrders.size()>1){ - Assert.state(false,"根据调拨出库单:{},的来源单据号:{},查询OFS调拨订单为空或不唯一。请检查。",ofsCode,stockoutH.getSourceOrderCode()); + if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0 || ofsTranseferOrders.size() > 1) { + Assert.state(false, "根据调拨出库单:{},的来源单据号:{},查询OFS调拨订单为空或不唯一。请检查。", ofsCode, stockoutH.getSourceOrderCode()); } OFSTranseferOrderSearchResponse.OFSTranseferOrder ofsTranseferOrder = ofsTranseferOrders.get(0); System.out.println(ofsTranseferOrder); ////////////////////////////////////////////////////////////////////////////////ofs调拨订单 - - //创建日期 + //创建日期,调拨出库创建时间 String created = stockoutH.getCreated(); format = created; //dbilldate 单据日期 @@ -270,8 +305,8 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { //vnote 备注 parentvo.setVnote(ofsTranseferOrder.getHeader().getNotes()); - //pk_defdoc19 - parentvo.setPk_defdoc19(StringUtils.substring(ofsTranseferOrder.getHeader().getCode(),5)); + //pk_defdoc19 OFS调拨订单号 + parentvo.setPk_defdoc19(ofsTranseferOrder.getHeader().getCode()); //子表 List ofsDetails = ofsTranseferOrder.getDetails(); @@ -285,11 +320,14 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { //nnum 数量 children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty())); childrenvo.add(children); + //ofs行id + children.setPk_defdoc20(ofsDetail.getId()); + } billVO.setParentvo(parentvo); billVO.setChildrenvo(childrenvo); String jsonStr = JSONUtil.toJsonStr(billVO); - mapStr = "{\"billvo\":"+jsonStr+"}"; + mapStr = "{\"billvo\":" + jsonStr + "}"; ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveqzCode"), mapStr); System.out.println(ztResult); //两层判断,一层中台转发,一层u8c返回 @@ -325,14 +363,18 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); - } catch (Exception e) { e.printStackTrace(); logger.error("推送U8C,丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)失败,失败原因:" + e); //失败 ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); - String ErrMessage = "推送U8C,丽知:OFS调整出库--->U8C其它出库失败,失败原因:" + reusltStrDto.getErrormsg(); + String ErrMessage=null; + if (reusltStrDto != null) { + ErrMessage = "推送U8C,丽知:OFS调整出库--->U8C其它出库失败,失败原因:" + reusltStrDto.getErrormsg(); + }else { + ErrMessage=e.getMessage(); + } IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); @@ -359,19 +401,38 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { * @throws Exception */ public List queryOfsStockoutOrder(QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO) throws Exception { + Long pageNo = 1L; + + List all = new ArrayList<>(); + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); interfaceParamDto.setApi("ofs.shipment.search"); queryOfsStockoutOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockoutOrderRequestVO.setClientCode("LETS"); + queryOfsStockoutOrderRequestVO.setPageNo(pageNo); + queryOfsStockoutOrderRequestVO.setPageSize(500L); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO)); SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); - System.out.println(saleOutReturnMessageDto); StockoutOrderSearchResponse stockoutOrderSearchResponse = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto); - System.out.println(stockoutOrderSearchResponse); + + all.addAll(stockoutOrderSearchResponse.getData()); + + int count = stockoutOrderSearchResponse.getData().size(); + while (count >= 500) {//>=500,可能还有下一页。 + //还有下一页 + pageNo++; + queryOfsStockoutOrderRequestVO.setPageNo(pageNo); + interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO)); + SaleOutReturnMessageDto saleOutReturnMessageDto1 = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); + StockoutOrderSearchResponse stockoutOrderSearchResponse1 = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto1); + + all.addAll(stockoutOrderSearchResponse1.getData()); + count=stockoutOrderSearchResponse1.getData().size(); + } if (stockoutOrderSearchResponse.getData() == null || stockoutOrderSearchResponse.getData().size() == 0) { return null; } - return stockoutOrderSearchResponse.getData(); + return all; } /** diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GeneralBillVO.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GeneralBillVO.java index 9d551669..2bed5099 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GeneralBillVO.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GeneralBillVO.java @@ -1,17 +1,22 @@ package com.hzya.frame.plugin.lets.u8cdto; +import lombok.Data; + import java.util.List; /** * 出入库单实体 + * * @Author zyd */ +@Data public class GeneralBillVO { private Parentvo parentvo; private List childrenvo; - public static class Parentvo{ + @Data + public static class Parentvo { /** * 单据号 */ @@ -49,80 +54,30 @@ public class GeneralBillVO { * 备注 */ private String vnote; - - public String getVbillcode() { - return vbillcode; - } - - public void setVbillcode(String vbillcode) { - this.vbillcode = vbillcode; - } - - public String getCbilltypecode() { - return cbilltypecode; - } - - public void setCbilltypecode(String cbilltypecode) { - this.cbilltypecode = cbilltypecode; - } - - public String getPk_calbody() { - return pk_calbody; - } - - public void setPk_calbody(String pk_calbody) { - this.pk_calbody = pk_calbody; - } - - public String getIsautopick() { - return isautopick; - } - - public void setIsautopick(String isautopick) { - this.isautopick = isautopick; - } - - public String getPk_corp() { - return pk_corp; - } - - public void setPk_corp(String pk_corp) { - this.pk_corp = pk_corp; - } - - public String getCoperatorid() { - return coperatorid; - } - - public void setCoperatorid(String coperatorid) { - this.coperatorid = coperatorid; - } - - public String getCdispatcherid() { - return cdispatcherid; - } - - public void setCdispatcherid(String cdispatcherid) { - this.cdispatcherid = cdispatcherid; - } - - public String getCwarehouseid() { - return cwarehouseid; - } - - public void setCwarehouseid(String cwarehouseid) { - this.cwarehouseid = cwarehouseid; - } - - public String getVnote() { - return vnote; - } - - public void setVnote(String vnote) { - this.vnote = vnote; - } + 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; } - public static class Childrenvo{ + + @Data + public static class Childrenvo { /** * 存货ID */ @@ -175,126 +130,11 @@ public class GeneralBillVO { * 行备注 */ private String vnotebody; + /** + * ofs来源行号 + */ + private String pk_defdoc20; - public String getNshouldinnum() { - return nshouldinnum; - } - - public void setNshouldinnum(String nshouldinnum) { - this.nshouldinnum = nshouldinnum; - } - - public String getCsourcebillhid() { - return csourcebillhid; - } - - public void setCsourcebillhid(String csourcebillhid) { - this.csourcebillhid = csourcebillhid; - } - - public String getCsourcebillbid() { - return csourcebillbid; - } - - public void setCsourcebillbid(String csourcebillbid) { - this.csourcebillbid = csourcebillbid; - } - - public String getVbatchcode() { - return vbatchcode; - } - - public void setVbatchcode(String vbatchcode) { - this.vbatchcode = vbatchcode; - } - - public String getNoutnum() { - return noutnum; - } - - public void setNoutnum(String noutnum) { - this.noutnum = noutnum; - } - - public String getCinventoryid() { - return cinventoryid; - } - - public String getCrowno() { - return crowno; - } - - public String getVsourcerowno() { - return vsourcerowno; - } - - public void setVsourcerowno(String vsourcerowno) { - this.vsourcerowno = vsourcerowno; - } - - public String getNinnum() { - return ninnum; - } - - public void setNinnum(String ninnum) { - this.ninnum = ninnum; - } - - public void setCrowno(String crowno) { - this.crowno = crowno; - - } - - public void setCinventoryid(String cinventoryid) { - this.cinventoryid = cinventoryid; - } - - public String getVsourcebillcode() { - return vsourcebillcode; - } - - public void setVsourcebillcode(String vsourcebillcode) { - this.vsourcebillcode = vsourcebillcode; - } - - public String getCsourcetype() { - return csourcetype; - } - - public void setCsourcetype(String csourcetype) { - this.csourcetype = csourcetype; - } - - public String getNshouldoutnum() { - return nshouldoutnum; - } - - public void setNshouldoutnum(String nshouldoutnum) { - this.nshouldoutnum = nshouldoutnum; - } - - public String getVnotebody() { - return vnotebody; - } - - public void setVnotebody(String vnotebody) { - this.vnotebody = vnotebody; - } } - public Parentvo getParentvo() { - return parentvo; - } - - public void setParentvo(Parentvo parentvo) { - this.parentvo = parentvo; - } - - public List getChildrenvo() { - return childrenvo; - } - - public void setChildrenvo(List childrenvo) { - this.childrenvo = childrenvo; - } } 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/base/BaseTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java index 939c830d..29628233 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java @@ -23,6 +23,10 @@ public class BaseTest { public void t00(){ skuPluginInitializer.start(); } + @Test + public void t01(){ + skuPluginInitializer.start("2024-08-20","2024-08-20"); + } ////////////////////////////////////////////////////////////////////////////////////SKU自动分配 @Test public void t10(){ 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/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java index bb9bcc84..6ec4aa37 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java @@ -40,7 +40,7 @@ public class TransferTest { @Test public void t10(){ - transferOutPluginInitializer.start("LETS-SH2024081400000001"); + transferOutPluginInitializer.start("LETS-SH2024082200000005"); } @Test @@ -55,7 +55,7 @@ public class TransferTest { } @Test public void t21(){ - transferInPluginInitializer.start("LETS-RE2024081900000002"); + transferInPluginInitializer.start("LETS-RE2024082200000001"); } 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/ofsBaseSearch/OFSSKUSearchResponse.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsBaseSearch/OFSSKUSearchResponse.java index 6cf3be98..6c5ef83c 100644 --- a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsBaseSearch/OFSSKUSearchResponse.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsBaseSearch/OFSSKUSearchResponse.java @@ -3,7 +3,6 @@ package com.hzya.frame.ttxofs.dto.ofsBaseSearch; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import lombok.Data; -import java.util.Date; import java.util.List; /** @@ -15,19 +14,19 @@ public class OFSSKUSearchResponse extends ReturnMessageBasics { @Data public static class OFSSKU{ - private int id; + private String id; private String clientCode; private String companyCode; private String code; private String name; - private int listPrice; - private int netPrice; - private int msrPrice; - private int buyPrice; - private int status; - private Date created; + private String listPrice; + private String netPrice; + private String msrPrice; + private String buyPrice; + private String status; + private String created; private String createdBy; - private Date lastUpdated; + private String lastUpdated; private String lastUpdatedBy; } } diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSTranseferOrderSearchResponse.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSTranseferOrderSearchResponse.java index e5f4be1f..4848e6eb 100644 --- a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSTranseferOrderSearchResponse.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSTranseferOrderSearchResponse.java @@ -84,7 +84,7 @@ public class OFSTranseferOrderSearchResponse extends ReturnMessageBasics { @Data public class OFSTranseferB{ /** id */ - private Integer id; + private String id; /** 订单ID */ private Integer transferOrderId; /** 订单编号 */ 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;