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/base/SKUPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java index bd6a4a1c..dfc4ddf9 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 @@ -150,15 +150,15 @@ public class SKUPluginInitializer extends PluginBaseEntity { queryOfsSKURequestVO.setLastUpdated_start(startTimeStr); queryOfsSKURequestVO.setLastUpdated_end(endTimeStr); List ofsskuList = queryOfsSKUs(queryOfsSKURequestVO); - if (ofsskuList.size() == 0) { - return; + if(ofsskuList.size()==0){ + return; } //分组排序, List sortSkuList = groupAndSort(ofsskuList); //过滤日志 List filterSkus = filterData(sortSkuList); - if (filterSkus.size() == 0) { + if(filterSkus.size()==0){ return; } //具体实现 @@ -182,7 +182,7 @@ public class SKUPluginInitializer extends PluginBaseEntity { QueryOfsSKURequestVO queryOfsSKURequestVO = new QueryOfsSKURequestVO(); queryOfsSKURequestVO.setCode(split[0]); List ofsskuList = queryOfsSKUs(queryOfsSKURequestVO); - if (ofsskuList.size() == 0) { + if(ofsskuList.size()==0){ Assert.state(false, "根据OFS SKU主档编码:{},未查询到SKU主档,请检查入参或者OFS SKU主档。", split[0]); } //分组排序, @@ -190,7 +190,7 @@ public class SKUPluginInitializer extends PluginBaseEntity { //过滤日志 List filterSkus = filterData(sortSkuList); - if (filterSkus.size() == 0) { + if(filterSkus.size()==0){ Assert.state(false, "根据OFS SKU主档编码:{},已被推送成功,请勿重新推送。", split[0]); } //具体实现 @@ -216,16 +216,16 @@ public class SKUPluginInitializer extends PluginBaseEntity { queryOfsSKURequestVO.setLastUpdated_start(start); queryOfsSKURequestVO.setLastUpdated_end(end); List ofsskuList = queryOfsSKUs(queryOfsSKURequestVO); - if (ofsskuList.size() == 0) { - Assert.state(false, "根据期间:{} - {} 内,未查询到OFS系统中SKU主档信息,请检查。"); + if(ofsskuList.size()==0){ + Assert.state(false,"根据期间:{} - {} 内,未查询到OFS系统中SKU主档信息,请检查。"); } //分组排序, List sortSkuList = groupAndSort(ofsskuList); //过滤日志 List filterSkus = filterData(sortSkuList); - if (filterSkus.size() == 0) { - Assert.state(false, "根据期间:{} - {} 内询到OFS系统中SKU主档信息已全部推送,请勿重新推送。"); + if(filterSkus.size()==0){ + Assert.state(false,"根据期间:{} - {} 内询到OFS系统中SKU主档信息已全部推送,请勿重新推送。"); } //具体实现 implement(filterSkus); @@ -239,14 +239,13 @@ public class SKUPluginInitializer extends PluginBaseEntity { * 过滤成功日志 * rootAppPk * [code]_[lastUpdated] - * * @param ofsskuList * @return */ - public List filterData(List ofsskuList) { + public List filterData(List ofsskuList){ List filterSkus = new ArrayList<>(); for (OFSSKUSearchResponse.OFSSKU ofssku : ofsskuList) { - String rootAppPk = ofssku.getCode() + "_" + ofssku.getLastUpdated(); + String rootAppPk = ofssku.getCode()+"_"+ofssku.getLastUpdated(); boolean isExis = true; IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); @@ -269,10 +268,10 @@ public class SKUPluginInitializer extends PluginBaseEntity { * 注意: * 可能一家公司封存则,则取消分配这家公司的存货管理档案 */ - public void implement(List filterSkus) { + public void implement(List filterSkus){ for (OFSSKUSearchResponse.OFSSKU sku : filterSkus) { - String PkInvbasdoc = ""; + String PkInvbasdoc= ""; String url = ""; String mapStr = ""; String format = sku.getLastUpdated(); @@ -285,14 +284,14 @@ public class SKUPluginInitializer extends PluginBaseEntity { //查询是否存在,返回pkInvbasdoc,如果有则是修改,null则为新增 //查询该id再u8c是否有数据,没有则是新增,有则是修改 存货基本档案:def2-》ofs主键 - PkInvbasdoc = queryInvbasDocIsExist(sku); + PkInvbasdoc=queryInvbasDocIsExist(sku); if (PkInvbasdoc != null) { //修改 parentvo.setPk_invbasdoc(PkInvbasdoc); - url = OverallConstant.getOverAllValue("bdinvclUpdateCode"); + url=OverallConstant.getOverAllValue("bdinvclUpdateCode"); } else if (PkInvbasdoc == null) { //新增 - url = OverallConstant.getOverAllValue("bdinvclSaveCode"); + url=OverallConstant.getOverAllValue("bdinvclSaveCode"); } //def2 ofs id @@ -323,17 +322,20 @@ public class SKUPluginInitializer extends PluginBaseEntity { //memo 备注 parentvo.setMemo(sku.getRemark()); + //setpartsflag 成套件,默认都是true + parentvo.setSetpartsflag("true"); + invbasdoc.setParentvo(parentvo); //子表,暂时没有要传的值 String jsonStr = JSONUtil.toJsonStr(invbasdoc); - mapStr = "{\"invbasdoc\":" + jsonStr + "}"; + mapStr= "{\"invbasdoc\":" + jsonStr + "}"; ZTResult ztResult = pushU8CByApiCode.pushByCode(url, mapStr); //两层判断,一层中台转发,一层u8c返回 Attribute attribute = ztResult.getAttribute(); if ("false".equals(ztResult.getFlag())) { //转发失败 - response = JSONUtil.toJsonStr(ztResult.getAttribute()); + response=JSONUtil.toJsonStr(ztResult.getAttribute()); Assert.state(false, "丽知:OFS货品档案--->U8C货品档案,中台转发失败,失败原因:{}", ztResult.getAttribute()); } boolean isSuccess = false; @@ -355,13 +357,13 @@ public class SKUPluginInitializer extends PluginBaseEntity { integrationTaskLivingDetailsEntity.setNewTransmitInfo(attribute.getData()); integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setBusinessDate(format); - integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode() + "_" + sku.getLastUpdated()); + integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode()+"_"+sku.getLastUpdated()); integrationTaskLivingDetailsEntity.setRootAppBill(sku.getCode()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setDef1(sku.getId()); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); - } catch (Exception e) { + }catch (Exception e){ e.printStackTrace(); logger.error("推送U8C,丽知:OFS货品档案--->U8C货品档案失败,失败原因:" + e); //失败 @@ -374,7 +376,7 @@ public class SKUPluginInitializer extends PluginBaseEntity { integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); integrationTaskLivingDetailsEntity.setBusinessDate(format); - integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode() + "_" + sku.getLastUpdated()); + integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode()+"_"+sku.getLastUpdated()); integrationTaskLivingDetailsEntity.setRootAppBill(sku.getCode()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setDef1(sku.getId()); @@ -385,64 +387,65 @@ public class SKUPluginInitializer extends PluginBaseEntity { } } - public String queryInvbasDocIsExist(OFSSKUSearchResponse.OFSSKU sku) { - String PkInvbasdoc = ""; + public String queryInvbasDocIsExist(OFSSKUSearchResponse.OFSSKU sku){ + String PkInvbasdoc=""; BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity(); bdInvbasdocEntity.setDr(0L); bdInvbasdocEntity.setDef2(sku.getId()); bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); List bdInvbasdocEntityList = bdInvbasdocDao.query(bdInvbasdocEntity);//根据ofs id - if (bdInvbasdocEntityList.size() == 0) { + if(bdInvbasdocEntityList.size()==0){ bdInvbasdocEntity.setDef2(null); bdInvbasdocEntity.setInvcode(sku.getCode()); bdInvbasdocEntity.setInvname(sku.getName()); List bdInvbasdocEntityList1 = bdInvbasdocDao.query(bdInvbasdocEntity);//根据编码+名称 - if (bdInvbasdocEntityList1.size() == 0) { + if(bdInvbasdocEntityList1.size()==0){ bdInvbasdocEntity.setInvname(null); List bdInvbasdocEntityList2 = bdInvbasdocDao.query(bdInvbasdocEntity);//进查询编码 if (bdInvbasdocEntityList2.size() == 0) {//编码不存在 return null; } else if (bdInvbasdocEntityList2.size() == 1) {//编码存在 - PkInvbasdoc = bdInvbasdocEntityList2.get(0).getPkInvbasdoc();//主键 + PkInvbasdoc=bdInvbasdocEntityList2.get(0).getPkInvbasdoc();//主键 } - } else if (bdInvbasdocEntityList1.size() == 1) { + }else if(bdInvbasdocEntityList1.size()==1){ //修改 - PkInvbasdoc = bdInvbasdocEntityList1.get(0).getPkInvbasdoc();//主键 + PkInvbasdoc=bdInvbasdocEntityList1.get(0).getPkInvbasdoc();//主键 } - } else if (bdInvbasdocEntityList.size() == 1) { + }else if(bdInvbasdocEntityList.size()==1){ //修改 - PkInvbasdoc = bdInvbasdocEntityList.get(0).getPkInvbasdoc();//主键 - } else { + PkInvbasdoc=bdInvbasdocEntityList.get(0).getPkInvbasdoc();//主键 + }else { //异常,存在多个 - Assert.state(false, "SKU主档编码:{},id:{}。U8C存货基本档案def2(OFS中SKU主档id)存在多个,请检查。", sku.getCode(), sku.getId()); + Assert.state(false,"SKU主档编码:{},id:{}。U8C存货基本档案def2(OFS中SKU主档id)存在多个,请检查。",sku.getCode(),sku.getId()); } - return PkInvbasdoc; + return PkInvbasdoc; } /** * 按code分组,并按lastUpdated排序 - * * @param ofsskuList * @return */ - public List groupAndSort(List ofsskuList) { - List sortSkus = new ArrayList<>(); + public List groupAndSort(List ofsskuList){ + List sortSkus=new ArrayList<>(); //根据code进行分组 - Map> collectMapByCode = ofsskuList.stream().collect(Collectors.groupingBy(OFSSKUSearchResponse.OFSSKU::getCode)); + Map> collectMapByCode = + ofsskuList.stream().collect(Collectors.groupingBy(OFSSKUSearchResponse.OFSSKU::getCode)); - collectMapByCode.forEach((k, v) -> { + collectMapByCode.forEach((k,v)->{ //降序排序 (从新到旧),根据最后修改时间倒排 - List sorted = v.stream().sorted(Comparator.comparing(OFSSKUSearchResponse.OFSSKU::getLastUpdated).reversed()).collect(Collectors.toList()); + List sorted = + v.stream().sorted(Comparator.comparing(OFSSKUSearchResponse.OFSSKU::getLastUpdated).reversed()).collect(Collectors.toList()); //排除status==0的 for (int i = 0; i < sorted.size(); i++) { - if ("0".equals(sorted.get(i).getStatus())) { + if("0".equals(sorted.get(i).getStatus())){ sorted.remove(i); } } - if (sorted.size() != 0) { + if(sorted.size()!=0){ sortSkus.add(sorted.get(0));//只取最后修改的一个 } }); @@ -452,7 +455,7 @@ public class SKUPluginInitializer extends PluginBaseEntity { /** * 封存存货基本档案 */ - public void sealImplement(String code) { + public void sealImplement(String code){ } @@ -493,7 +496,6 @@ public class SKUPluginInitializer extends PluginBaseEntity { } return all; } - private InvBasDocVO resultDataHandle(String resultData) { try { if (resultData != null && !"".equals(resultData)) { 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"); } ////////////////////////////////////////////////////////////////////////////////////调整出库单