diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaMonthledgerDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaMonthledgerDao.java new file mode 100644 index 00000000..ebce39e1 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaMonthledgerDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.lets.dao; + +import com.hzya.frame.plugin.lets.entity.IaMonthledgerEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * (IA_MONTHLEDGER: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-03 11:16:01 + */ +public interface IIaMonthledgerDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaMonthledgerDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaMonthledgerDaoImpl.java new file mode 100644 index 00000000..7ff19ad2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaMonthledgerDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.lets.dao.impl; + +import com.hzya.frame.plugin.lets.entity.IaMonthledgerEntity; +import com.hzya.frame.plugin.lets.dao.IIaMonthledgerDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * (IaMonthledger)表数据库访问层 + * + * @author makejava + * @since 2024-09-03 11:16:01 + */ +public class IaMonthledgerDaoImpl extends MybatisGenericDao implements IIaMonthledgerDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaMonthledgerEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaMonthledgerEntity.java new file mode 100644 index 00000000..ca8f4497 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaMonthledgerEntity.java @@ -0,0 +1,339 @@ +package com.hzya.frame.plugin.lets.entity; + +import com.hzya.frame.web.entity.BaseEntity; +/** + * (IaMonthledger)实体类 + * + * @author makejava + * @since 2024-09-03 11:16:01 + */ +public class IaMonthledgerEntity extends BaseEntity { + + private String btryflag; + private String caccountmonth; + private String caccountyear; + private String cinventoryid; + private String cmonthledgerid; + private String crdcenterid; + private String cvendorid; + private String dr; + private String fpricemodeflag; + private String frecordtypeflag; + private String nabmny; + private String nabnum; + private String nabprice; + private String nabvarymny; + private String ninmny; + private String ninnum; + private String ninvarymny; + private String nmonthprice; + private String noutmny; + private String noutnum; + private String noutvarymny; + private String nplanedprice; + private String nvariancerate; + private String pkCorp; + private String ts; + private String vbatch; + private String vfree1; + private String vfree10; + private String vfree2; + private String vfree3; + private String vfree4; + private String vfree5; + private String vfree6; + private String vfree7; + private String vfree8; + private String vfree9; + + + public String getBtryflag() { + return btryflag; + } + + public void setBtryflag(String btryflag) { + this.btryflag = btryflag; + } + + public String getCaccountmonth() { + return caccountmonth; + } + + public void setCaccountmonth(String caccountmonth) { + this.caccountmonth = caccountmonth; + } + + public String getCaccountyear() { + return caccountyear; + } + + public void setCaccountyear(String caccountyear) { + this.caccountyear = caccountyear; + } + + public String getCinventoryid() { + return cinventoryid; + } + + public void setCinventoryid(String cinventoryid) { + this.cinventoryid = cinventoryid; + } + + public String getCmonthledgerid() { + return cmonthledgerid; + } + + public void setCmonthledgerid(String cmonthledgerid) { + this.cmonthledgerid = cmonthledgerid; + } + + public String getCrdcenterid() { + return crdcenterid; + } + + public void setCrdcenterid(String crdcenterid) { + this.crdcenterid = crdcenterid; + } + + public String getCvendorid() { + return cvendorid; + } + + public void setCvendorid(String cvendorid) { + this.cvendorid = cvendorid; + } + + public String getDr() { + return dr; + } + + public void setDr(String dr) { + this.dr = dr; + } + + public String getFpricemodeflag() { + return fpricemodeflag; + } + + public void setFpricemodeflag(String fpricemodeflag) { + this.fpricemodeflag = fpricemodeflag; + } + + public String getFrecordtypeflag() { + return frecordtypeflag; + } + + public void setFrecordtypeflag(String frecordtypeflag) { + this.frecordtypeflag = frecordtypeflag; + } + + public String getNabmny() { + return nabmny; + } + + public void setNabmny(String nabmny) { + this.nabmny = nabmny; + } + + public String getNabnum() { + return nabnum; + } + + public void setNabnum(String nabnum) { + this.nabnum = nabnum; + } + + public String getNabprice() { + return nabprice; + } + + public void setNabprice(String nabprice) { + this.nabprice = nabprice; + } + + public String getNabvarymny() { + return nabvarymny; + } + + public void setNabvarymny(String nabvarymny) { + this.nabvarymny = nabvarymny; + } + + public String getNinmny() { + return ninmny; + } + + public void setNinmny(String ninmny) { + this.ninmny = ninmny; + } + + public String getNinnum() { + return ninnum; + } + + public void setNinnum(String ninnum) { + this.ninnum = ninnum; + } + + public String getNinvarymny() { + return ninvarymny; + } + + public void setNinvarymny(String ninvarymny) { + this.ninvarymny = ninvarymny; + } + + public String getNmonthprice() { + return nmonthprice; + } + + public void setNmonthprice(String nmonthprice) { + this.nmonthprice = nmonthprice; + } + + public String getNoutmny() { + return noutmny; + } + + public void setNoutmny(String noutmny) { + this.noutmny = noutmny; + } + + public String getNoutnum() { + return noutnum; + } + + public void setNoutnum(String noutnum) { + this.noutnum = noutnum; + } + + public String getNoutvarymny() { + return noutvarymny; + } + + public void setNoutvarymny(String noutvarymny) { + this.noutvarymny = noutvarymny; + } + + public String getNplanedprice() { + return nplanedprice; + } + + public void setNplanedprice(String nplanedprice) { + this.nplanedprice = nplanedprice; + } + + public String getNvariancerate() { + return nvariancerate; + } + + public void setNvariancerate(String nvariancerate) { + this.nvariancerate = nvariancerate; + } + + public String getPkCorp() { + return pkCorp; + } + + public void setPkCorp(String pkCorp) { + this.pkCorp = pkCorp; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getVbatch() { + return vbatch; + } + + public void setVbatch(String vbatch) { + this.vbatch = vbatch; + } + + 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; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaMonthledgerEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaMonthledgerEntity.xml new file mode 100644 index 00000000..dea3ac8e --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaMonthledgerEntity.xml @@ -0,0 +1,503 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BTRYFLAG + ,CACCOUNTMONTH + ,CACCOUNTYEAR + ,CINVENTORYID + ,CMONTHLEDGERID + ,CRDCENTERID + ,CVENDORID + ,DR + ,FPRICEMODEFLAG + ,FRECORDTYPEFLAG + ,NABMNY + ,NABNUM + ,NABPRICE + ,NABVARYMNY + ,NINMNY + ,NINNUM + ,NINVARYMNY + ,NMONTHPRICE + ,NOUTMNY + ,NOUTNUM + ,NOUTVARYMNY + ,NPLANEDPRICE + ,NVARIANCERATE + ,PK_CORP + ,TS + ,VBATCH + ,VFREE1 + ,VFREE10 + ,VFREE2 + ,VFREE3 + ,VFREE4 + ,VFREE5 + ,VFREE6 + ,VFREE7 + ,VFREE8 + ,VFREE9 + + + + + + + + + + + + + + + + insert into IA_MONTHLEDGER( + + BTRYFLAG , + CACCOUNTMONTH , + CACCOUNTYEAR , + CINVENTORYID , + CMONTHLEDGERID , + CRDCENTERID , + CVENDORID , + DR , + FPRICEMODEFLAG , + FRECORDTYPEFLAG , + NABMNY , + NABNUM , + NABPRICE , + NABVARYMNY , + NINMNY , + NINNUM , + NINVARYMNY , + NMONTHPRICE , + NOUTMNY , + NOUTNUM , + NOUTVARYMNY , + NPLANEDPRICE , + NVARIANCERATE , + PK_CORP , + TS , + VBATCH , + VFREE1 , + VFREE10 , + VFREE2 , + VFREE3 , + VFREE4 , + VFREE5 , + VFREE6 , + VFREE7 , + VFREE8 , + VFREE9 , + sorts, + sts, + + )values( + + #{btryflag} , + #{caccountmonth} , + #{caccountyear} , + #{cinventoryid} , + #{cmonthledgerid} , + #{crdcenterid} , + #{cvendorid} , + #{dr} , + #{fpricemodeflag} , + #{frecordtypeflag} , + #{nabmny} , + #{nabnum} , + #{nabprice} , + #{nabvarymny} , + #{ninmny} , + #{ninnum} , + #{ninvarymny} , + #{nmonthprice} , + #{noutmny} , + #{noutnum} , + #{noutvarymny} , + #{nplanedprice} , + #{nvariancerate} , + #{pkCorp} , + #{ts} , + #{vbatch} , + #{vfree1} , + #{vfree10} , + #{vfree2} , + #{vfree3} , + #{vfree4} , + #{vfree5} , + #{vfree6} , + #{vfree7} , + #{vfree8} , + #{vfree9} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from IA_MONTHLEDGER a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into IA_MONTHLEDGER(BTRYFLAG, CACCOUNTMONTH, CACCOUNTYEAR, CINVENTORYID, CRDCENTERID, CVENDORID, DR, FPRICEMODEFLAG, FRECORDTYPEFLAG, NABMNY, NABNUM, NABPRICE, NABVARYMNY, NINMNY, NINNUM, NINVARYMNY, NMONTHPRICE, NOUTMNY, NOUTNUM, NOUTVARYMNY, NPLANEDPRICE, NVARIANCERATE, PK_CORP, TS, VBATCH, VFREE1, VFREE10, VFREE2, VFREE3, VFREE4, VFREE5, VFREE6, VFREE7, VFREE8, VFREE9, sts) + values + + (#{entity.btryflag},#{entity.caccountmonth},#{entity.caccountyear},#{entity.cinventoryid},#{entity.crdcenterid},#{entity.cvendorid},#{entity.dr},#{entity.fpricemodeflag},#{entity.frecordtypeflag},#{entity.nabmny},#{entity.nabnum},#{entity.nabprice},#{entity.nabvarymny},#{entity.ninmny},#{entity.ninnum},#{entity.ninvarymny},#{entity.nmonthprice},#{entity.noutmny},#{entity.noutnum},#{entity.noutvarymny},#{entity.nplanedprice},#{entity.nvariancerate},#{entity.pkCorp},#{entity.ts},#{entity.vbatch},#{entity.vfree1},#{entity.vfree10},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vfree6},#{entity.vfree7},#{entity.vfree8},#{entity.vfree9}, 'Y') + + + + + insert into IA_MONTHLEDGER(BTRYFLAG, CACCOUNTMONTH, CACCOUNTYEAR, CINVENTORYID, CRDCENTERID, CVENDORID, DR, FPRICEMODEFLAG, FRECORDTYPEFLAG, NABMNY, NABNUM, NABPRICE, NABVARYMNY, NINMNY, NINNUM, NINVARYMNY, NMONTHPRICE, NOUTMNY, NOUTNUM, NOUTVARYMNY, NPLANEDPRICE, NVARIANCERATE, PK_CORP, TS, VBATCH, VFREE1, VFREE10, VFREE2, VFREE3, VFREE4, VFREE5, VFREE6, VFREE7, VFREE8, VFREE9) + values + + (#{entity.btryflag},#{entity.caccountmonth},#{entity.caccountyear},#{entity.cinventoryid},#{entity.crdcenterid},#{entity.cvendorid},#{entity.dr},#{entity.fpricemodeflag},#{entity.frecordtypeflag},#{entity.nabmny},#{entity.nabnum},#{entity.nabprice},#{entity.nabvarymny},#{entity.ninmny},#{entity.ninnum},#{entity.ninvarymny},#{entity.nmonthprice},#{entity.noutmny},#{entity.noutnum},#{entity.noutvarymny},#{entity.nplanedprice},#{entity.nvariancerate},#{entity.pkCorp},#{entity.ts},#{entity.vbatch},#{entity.vfree1},#{entity.vfree10},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vfree6},#{entity.vfree7},#{entity.vfree8},#{entity.vfree9}) + + on duplicate key update + BTRYFLAG = values(BTRYFLAG), + CACCOUNTMONTH = values(CACCOUNTMONTH), + CACCOUNTYEAR = values(CACCOUNTYEAR), + CINVENTORYID = values(CINVENTORYID), + CRDCENTERID = values(CRDCENTERID), + CVENDORID = values(CVENDORID), + DR = values(DR), + FPRICEMODEFLAG = values(FPRICEMODEFLAG), + FRECORDTYPEFLAG = values(FRECORDTYPEFLAG), + NABMNY = values(NABMNY), + NABNUM = values(NABNUM), + NABPRICE = values(NABPRICE), + NABVARYMNY = values(NABVARYMNY), + NINMNY = values(NINMNY), + NINNUM = values(NINNUM), + NINVARYMNY = values(NINVARYMNY), + NMONTHPRICE = values(NMONTHPRICE), + NOUTMNY = values(NOUTMNY), + NOUTNUM = values(NOUTNUM), + NOUTVARYMNY = values(NOUTVARYMNY), + NPLANEDPRICE = values(NPLANEDPRICE), + NVARIANCERATE = values(NVARIANCERATE), + PK_CORP = values(PK_CORP), + TS = values(TS), + VBATCH = values(VBATCH), + VFREE1 = values(VFREE1), + VFREE10 = values(VFREE10), + VFREE2 = values(VFREE2), + VFREE3 = values(VFREE3), + VFREE4 = values(VFREE4), + VFREE5 = values(VFREE5), + VFREE6 = values(VFREE6), + VFREE7 = values(VFREE7), + VFREE8 = values(VFREE8), + VFREE9 = values(VFREE9) + + +update IA_MONTHLEDGER set + + BTRYFLAG = #{btryflag}, + CACCOUNTMONTH = #{caccountmonth}, + CACCOUNTYEAR = #{caccountyear}, + CINVENTORYID = #{cinventoryid}, + CRDCENTERID = #{crdcenterid}, + CVENDORID = #{cvendorid}, + DR = #{dr}, + FPRICEMODEFLAG = #{fpricemodeflag}, + FRECORDTYPEFLAG = #{frecordtypeflag}, + NABMNY = #{nabmny}, + NABNUM = #{nabnum}, + NABPRICE = #{nabprice}, + NABVARYMNY = #{nabvarymny}, + NINMNY = #{ninmny}, + NINNUM = #{ninnum}, + NINVARYMNY = #{ninvarymny}, + NMONTHPRICE = #{nmonthprice}, + NOUTMNY = #{noutmny}, + NOUTNUM = #{noutnum}, + NOUTVARYMNY = #{noutvarymny}, + NPLANEDPRICE = #{nplanedprice}, + NVARIANCERATE = #{nvariancerate}, + PK_CORP = #{pkCorp}, + TS = #{ts}, + VBATCH = #{vbatch}, + VFREE1 = #{vfree1}, + VFREE10 = #{vfree10}, + VFREE2 = #{vfree2}, + VFREE3 = #{vfree3}, + VFREE4 = #{vfree4}, + VFREE5 = #{vfree5}, + VFREE6 = #{vfree6}, + VFREE7 = #{vfree7}, + VFREE8 = #{vfree8}, + VFREE9 = #{vfree9}, + +where CMONTHLEDGERID = #{cmonthledgerid} + + + +update IA_MONTHLEDGER set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where CMONTHLEDGERID = #{cmonthledgerid} + + + +update IA_MONTHLEDGER set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and BTRYFLAG = #{btryflag} + and CACCOUNTMONTH = #{caccountmonth} + and CACCOUNTYEAR = #{caccountyear} + and CINVENTORYID = #{cinventoryid} + and CMONTHLEDGERID = #{cmonthledgerid} + and CRDCENTERID = #{crdcenterid} + and CVENDORID = #{cvendorid} + and DR = #{dr} + and FPRICEMODEFLAG = #{fpricemodeflag} + and FRECORDTYPEFLAG = #{frecordtypeflag} + and NABMNY = #{nabmny} + and NABNUM = #{nabnum} + and NABPRICE = #{nabprice} + and NABVARYMNY = #{nabvarymny} + and NINMNY = #{ninmny} + and NINNUM = #{ninnum} + and NINVARYMNY = #{ninvarymny} + and NMONTHPRICE = #{nmonthprice} + and NOUTMNY = #{noutmny} + and NOUTNUM = #{noutnum} + and NOUTVARYMNY = #{noutvarymny} + and NPLANEDPRICE = #{nplanedprice} + and NVARIANCERATE = #{nvariancerate} + and PK_CORP = #{pkCorp} + and TS = #{ts} + and VBATCH = #{vbatch} + and VFREE1 = #{vfree1} + and VFREE10 = #{vfree10} + and VFREE2 = #{vfree2} + and VFREE3 = #{vfree3} + and VFREE4 = #{vfree4} + and VFREE5 = #{vfree5} + and VFREE6 = #{vfree6} + and VFREE7 = #{vfree7} + and VFREE8 = #{vfree8} + and VFREE9 = #{vfree9} + and sts='Y' + + + + + delete from IA_MONTHLEDGER where CMONTHLEDGERID = #{cmonthledgerid} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java index 969e1401..0aad9c8f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java @@ -203,8 +203,8 @@ public class AdjustInPluginInitializer extends PluginBaseEntity { String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); - queryOfsStockinOrderRequestVO.setCreated_start(start); - queryOfsStockinOrderRequestVO.setCreated_end(end); + queryOfsStockinOrderRequestVO.setClosedAt_start(start); + queryOfsStockinOrderRequestVO.setClosedAt_end(end); List stockinOrders = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); System.out.println(stockinOrders); 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 5b9afd21..00c013ec 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 @@ -9,6 +9,11 @@ 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.IIaMonthledgerDao; +import com.hzya.frame.plugin.lets.entity.BdCorpEntity; +import com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity; +import com.hzya.frame.plugin.lets.entity.BdInvmandocEntity; +import com.hzya.frame.plugin.lets.entity.IaMonthledgerEntity; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockoutOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO; @@ -16,6 +21,7 @@ import com.hzya.frame.plugin.lets.u8cdto.BillVO; import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4IDto; import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto; import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; +import com.hzya.frame.plugin.lets.util.QueryU8CEntityUtil; 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; @@ -94,6 +100,12 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { @Autowired private OfsUnifiedService ofsUnifiedService; + + @Autowired + private IIaMonthledgerDao iaMonthledgerDao; + @Autowired + private QueryU8CEntityUtil queryU8CEntityUtil; + @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { try { @@ -332,6 +344,14 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { //ofs行id children.setPk_defdoc20(ofsDetail.getId()); + //nprice 单价,取上一次结账的单价 + IaMonthledgerEntity iaMonthledgerEntity = queryIaMonthledger(ofsDetail, ofsTranseferOrder.getHeader().getCompanyCode()); + System.out.println(iaMonthledgerEntity); + if(iaMonthledgerEntity==null){ + children.setNprice("0"); + } + children.setNprice(iaMonthledgerEntity.getNabprice()); + } billVO.setParentvo(parentvo); billVO.setChildrenvo(childrenvo); @@ -524,4 +544,42 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { } return null; } + + + /** + * 根据存货管理档案档案,查询最后一次结算的单价,已根据ts 倒排,get(0)为最近一次核算价格 + */ + public IaMonthledgerEntity queryIaMonthledger(OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB sku,String companyCode){ + + //查询公司 + BdCorpEntity bdCorpEntity = queryU8CEntityUtil.queryBdCorpByUnitCode(companyCode); + if(bdCorpEntity==null){ + Assert.state(false,"根据OFS公司编码:{},查询U8C公司不存在。请检查U8C档案",companyCode); + } + + //查询存货基本档案主键 + BdInvbasdocEntity bdInvbasdocEntity = queryU8CEntityUtil.queryBdInvbasdocByCode(sku.getSkuCode()); + if(bdInvbasdocEntity==null){ + Assert.state(false,"根据OFS SKU CODE:{},查询U8C存货基本档案不存在。请检查U8C档案",sku.getSkuCode()); + } + + //查询存货管理档案 + BdInvmandocEntity bdInvmandocEntity = queryU8CEntityUtil.queryBdInvmandocByPkInvbasdocAndPkCorp(bdInvbasdocEntity.getPkInvbasdoc(), bdCorpEntity.getPkCorp()); + if(bdInvmandocEntity==null){ + Assert.state(false,"根据U8C存货基本档案主键:{},U8C公司主键:{},查询U8C存货管理档案不存在。请检查U8C档案",bdInvbasdocEntity.getPkInvbasdoc(),bdCorpEntity.getPkCorp()); + } + + IaMonthledgerEntity iaMonthledgerEntity = new IaMonthledgerEntity(); + iaMonthledgerEntity.setPkCorp(bdCorpEntity.getPkCorp()); + iaMonthledgerEntity.setCinventoryid(bdInvmandocEntity.getPkInvmandoc()); + iaMonthledgerEntity.setFrecordtypeflag("3"); + iaMonthledgerEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List iaMonthledgerEntityList = iaMonthledgerDao.query(iaMonthledgerEntity); + if (iaMonthledgerEntityList.size() == 0) {//没有也没事 + return null; +// Assert.state(false, "该存货名称:{},编码:{},U8C基本档案主键:{},没有进行过结算,请检查",sku.getSkuName(),sku.getSkuCode(),bdInvbasdocEntity.getPkInvbasdoc()); + } + return iaMonthledgerEntityList.get(0); + + } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryU8CEntityUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryU8CEntityUtil.java new file mode 100644 index 00000000..ed0f5f38 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/QueryU8CEntityUtil.java @@ -0,0 +1,82 @@ +package com.hzya.frame.plugin.lets.util; + +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +import com.hzya.frame.plugin.lets.dao.IBdCorpDao; +import com.hzya.frame.plugin.lets.dao.IBdInvbasdocDao; +import com.hzya.frame.plugin.lets.dao.IBdInvmandocDao; +import com.hzya.frame.plugin.lets.entity.BdCorpEntity; +import com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity; +import com.hzya.frame.plugin.lets.entity.BdInvmandocEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 查询U8C实体工具类,返回对象 + */ +@Component +public class QueryU8CEntityUtil { + + ////////////////////////////////////////////////////////////////////////////////////////公司 + @Autowired + private IBdCorpDao iBdCorpDao; + /** 根据公司编码UNITCode查询公司 */ + public BdCorpEntity queryBdCorpByUnitCode(String unitCode){ + BdCorpEntity entity = new BdCorpEntity(); + entity.setUnitcode(unitCode); + entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List query = iBdCorpDao.query(entity); + return query.get(0); + } + /** 根据公司主键pk_corp查询公司 */ + public BdCorpEntity queryBdCorpByPkCorp(String pkCorp){ + BdCorpEntity entity = new BdCorpEntity(); + entity.setPkCorp(pkCorp); + entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List query = iBdCorpDao.query(entity); + return query.get(0); + } + ////////////////////////////////////////////////////////////////////////////////////////公司 + + ////////////////////////////////////////////////////////////////////////////////////////存货基本档案 + @Autowired + private IBdInvbasdocDao iBdInvbasdocDao; + /** 根据存货编码查询存货基本档案 */ + public BdInvbasdocEntity queryBdInvbasdocByCode(String invcode){ + BdInvbasdocEntity entity = new BdInvbasdocEntity(); + entity.setInvcode(invcode); + entity.setDr(0L); + entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List query = iBdInvbasdocDao.query(entity); + return query.get(0); + } + /** 根据存货基本档案主键查询存货基本档案 */ + public BdInvbasdocEntity queryBdInvbasdocByPkInvbasdoc(String pkInvbasdoc){ + BdInvbasdocEntity entity = new BdInvbasdocEntity(); + entity.setPkInvbasdoc(pkInvbasdoc); + entity.setDr(0L); + entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List query = iBdInvbasdocDao.query(entity); + return query.get(0); + } + ////////////////////////////////////////////////////////////////////////////////////////存货基本档案 + + ////////////////////////////////////////////////////////////////////////////////////////存货管理档案 + @Autowired + private IBdInvmandocDao iBdInvmandocDao; + + /** 根据存货基本档案主键+公司主键查询存货管理档案 */ + public BdInvmandocEntity queryBdInvmandocByPkInvbasdocAndPkCorp(String pkInvbasdoc,String pkCorp){ + BdInvmandocEntity entity = new BdInvmandocEntity(); + entity.setPkCorp(pkCorp); + entity.setPkInvbasdoc(pkInvbasdoc); + entity.setDr(0L); + entity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List query = iBdInvmandocDao.query(entity); + return query.get(0); + } + + ////////////////////////////////////////////////////////////////////////////////////////存货管理档案 + +} 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 9811a987..79b1a627 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 @@ -53,4 +53,6 @@ + + \ 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 9aa0f6d4..a7969101 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 @@ -9,6 +9,10 @@ + + + + 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 38763324..8d81944a 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 @@ -25,7 +25,7 @@ public class BaseTest { } @Test public void t01(){ - skuPluginInitializer.start("6970872643657"); + skuPluginInitializer.start("6971898450656"); } @Test public void t02(){ @@ -48,7 +48,7 @@ public class BaseTest { } @Test public void t22(){ - skuClassPluginInitializer.start("2024-08-23","2024-08-25"); + skuClassPluginInitializer.start("2024-08-23","2024-08-29"); } 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 e4ac1c6a..50fb29bf 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 @@ -76,7 +76,7 @@ public class TransferTest { } @Test public void t32(){ - adjustInPluginInitializer.start("2024-08-14","2024-08-14"); + adjustInPluginInitializer.start("2024-08-14","2024-08-20"); } ////////////////////////////////////////////////////////////////////////////////////调整出库单