20260718黄正国 U8C单据信息同步代码
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.seeyon.apps.src_reportDataSync;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_reportDataSync.constants.U8DataSyncConstants;
|
||||
|
||||
public class ReportDataSyncPluginApi extends APluginInfoApi {
|
||||
|
||||
public ReportDataSyncPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(U8DataSyncConstants.getPluginId());
|
||||
return U8DataSyncConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "U8数据定时同步开发";
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
U8DataSyncConstants[] var2 = U8DataSyncConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
U8DataSyncConstants value = var2[var4];
|
||||
if (value != U8DataSyncConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
|
||||
return configVo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.seeyon.apps.src_reportDataSync.constants;
|
||||
|
||||
public enum U8DataSyncConstants {
|
||||
|
||||
plugin("src_reportDataSync","插件ID"),
|
||||
ipcorp("","U8C环境信息"),
|
||||
icOnhandQuery("/u8cloud/api/ic/onhand/query","库存数据查询接口"),
|
||||
icMaterialoutQuery("/u8cloud/api/ic/materialout/query","材料出库单查询接口"),
|
||||
icPurchaseinQuery("/u8cloud/api/ic/purchasein/query","采购入库单查询接口"),
|
||||
icProductinQuery("/u8cloud/api/ic/productin/query","产成品入库单查询接口"),
|
||||
icOtherinQuery("/u8cloud/api/ic/otherin/query","其他入库单查询接口"),
|
||||
icOtheroutQuery("/u8cloud/api/ic/otherout/query","其他出库单查询接口"),
|
||||
icSaleoutQuery("/u8cloud/api/ic/saleout/query","销售出库单查询接口"),
|
||||
corp("11","U8公司编码"),
|
||||
calbody("XTC001","U8库存组织"),
|
||||
;
|
||||
|
||||
U8DataSyncConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,118 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 材料出库单明细PO
|
||||
*/
|
||||
public class MaterialoutDetailPo {
|
||||
|
||||
private Long id; // 主键ID
|
||||
private String cgeneralbid; // 出库单明细ID
|
||||
private String cgeneralhid; // 出库单主表ID(外键)
|
||||
private String cinventoryid; // 存货ID
|
||||
private String cinventoryidCode; // 存货编码
|
||||
private String cinventoryidName; // 存货名称
|
||||
private String invspec; // 规格型号
|
||||
private BigDecimal noutnum; // 出库数量
|
||||
private String crowno; // 行号
|
||||
private String pkMeasdoc; // 计量单位ID
|
||||
private String pkMeasdocCode; // 计量单位编码
|
||||
private String pkMeasdocName; // 计量单位名称
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
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 getCinventoryid() {
|
||||
return cinventoryid;
|
||||
}
|
||||
|
||||
public void setCinventoryid(String cinventoryid) {
|
||||
this.cinventoryid = cinventoryid;
|
||||
}
|
||||
|
||||
public String getCinventoryidCode() {
|
||||
return cinventoryidCode;
|
||||
}
|
||||
|
||||
public void setCinventoryidCode(String cinventoryidCode) {
|
||||
this.cinventoryidCode = cinventoryidCode;
|
||||
}
|
||||
|
||||
public String getCinventoryidName() {
|
||||
return cinventoryidName;
|
||||
}
|
||||
|
||||
public void setCinventoryidName(String cinventoryidName) {
|
||||
this.cinventoryidName = cinventoryidName;
|
||||
}
|
||||
|
||||
public String getInvspec() {
|
||||
return invspec;
|
||||
}
|
||||
|
||||
public void setInvspec(String invspec) {
|
||||
this.invspec = invspec;
|
||||
}
|
||||
|
||||
public BigDecimal getNoutnum() {
|
||||
return noutnum;
|
||||
}
|
||||
|
||||
public void setNoutnum(BigDecimal noutnum) {
|
||||
this.noutnum = noutnum;
|
||||
}
|
||||
|
||||
public String getCrowno() {
|
||||
return crowno;
|
||||
}
|
||||
|
||||
public void setCrowno(String crowno) {
|
||||
this.crowno = crowno;
|
||||
}
|
||||
|
||||
public String getPkMeasdoc() {
|
||||
return pkMeasdoc;
|
||||
}
|
||||
|
||||
public void setPkMeasdoc(String pkMeasdoc) {
|
||||
this.pkMeasdoc = pkMeasdoc;
|
||||
}
|
||||
|
||||
public String getPkMeasdocCode() {
|
||||
return pkMeasdocCode;
|
||||
}
|
||||
|
||||
public void setPkMeasdocCode(String pkMeasdocCode) {
|
||||
this.pkMeasdocCode = pkMeasdocCode;
|
||||
}
|
||||
|
||||
public String getPkMeasdocName() {
|
||||
return pkMeasdocName;
|
||||
}
|
||||
|
||||
public void setPkMeasdocName(String pkMeasdocName) {
|
||||
this.pkMeasdocName = pkMeasdocName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 材料出库单主表PO
|
||||
*/
|
||||
public class MaterialoutPo {
|
||||
|
||||
private Long id; // 主键ID
|
||||
private String cgeneralhid; // 出库单ID
|
||||
private String vbillcode; // 单据编号
|
||||
private Date dbilldate; // 单据日期
|
||||
private String pkCorp; // 单位ID
|
||||
private String corpCode; // 单位编码
|
||||
private String corpName; // 单位名称
|
||||
private String pkCalbody; // 库存组织ID
|
||||
private String calbodyCode; // 库存组织编码
|
||||
private String calbodyName; // 库存组织名称
|
||||
private String cwarehouseid; // 仓库ID
|
||||
private String cwarehouseidCode; // 仓库编码
|
||||
private String cwarehouseidName; // 仓库名称
|
||||
private String cdispatcherid; // 收发类型ID
|
||||
private String cdispatcheridCode; // 收发类型编码
|
||||
private String cdispatcheridName; // 收发类型名称
|
||||
private String coperatorid; // 制单人ID
|
||||
private String coperatoridCode; // 制单人编码
|
||||
private String coperatoridName; // 制单人名称
|
||||
private String cwhsmanagerid; // 仓库管理员ID
|
||||
|
||||
private List<MaterialoutDetailPo> childrenvo; // 子表数据
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCgeneralhid() {
|
||||
return cgeneralhid;
|
||||
}
|
||||
|
||||
public void setCgeneralhid(String cgeneralhid) {
|
||||
this.cgeneralhid = cgeneralhid;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Date getDbilldate() {
|
||||
return dbilldate;
|
||||
}
|
||||
|
||||
public void setDbilldate(Date dbilldate) {
|
||||
this.dbilldate = dbilldate;
|
||||
}
|
||||
|
||||
public String getPkCorp() {
|
||||
return pkCorp;
|
||||
}
|
||||
|
||||
public void setPkCorp(String pkCorp) {
|
||||
this.pkCorp = pkCorp;
|
||||
}
|
||||
|
||||
public String getCorpCode() {
|
||||
return corpCode;
|
||||
}
|
||||
|
||||
public void setCorpCode(String corpCode) {
|
||||
this.corpCode = corpCode;
|
||||
}
|
||||
|
||||
public String getCorpName() {
|
||||
return corpName;
|
||||
}
|
||||
|
||||
public void setCorpName(String corpName) {
|
||||
this.corpName = corpName;
|
||||
}
|
||||
|
||||
public String getPkCalbody() {
|
||||
return pkCalbody;
|
||||
}
|
||||
|
||||
public void setPkCalbody(String pkCalbody) {
|
||||
this.pkCalbody = pkCalbody;
|
||||
}
|
||||
|
||||
public String getCalbodyCode() {
|
||||
return calbodyCode;
|
||||
}
|
||||
|
||||
public void setCalbodyCode(String calbodyCode) {
|
||||
this.calbodyCode = calbodyCode;
|
||||
}
|
||||
|
||||
public String getCalbodyName() {
|
||||
return calbodyName;
|
||||
}
|
||||
|
||||
public void setCalbodyName(String calbodyName) {
|
||||
this.calbodyName = calbodyName;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getCwarehouseidCode() {
|
||||
return cwarehouseidCode;
|
||||
}
|
||||
|
||||
public void setCwarehouseidCode(String cwarehouseidCode) {
|
||||
this.cwarehouseidCode = cwarehouseidCode;
|
||||
}
|
||||
|
||||
public String getCwarehouseidName() {
|
||||
return cwarehouseidName;
|
||||
}
|
||||
|
||||
public void setCwarehouseidName(String cwarehouseidName) {
|
||||
this.cwarehouseidName = cwarehouseidName;
|
||||
}
|
||||
|
||||
public String getCdispatcherid() {
|
||||
return cdispatcherid;
|
||||
}
|
||||
|
||||
public void setCdispatcherid(String cdispatcherid) {
|
||||
this.cdispatcherid = cdispatcherid;
|
||||
}
|
||||
|
||||
public String getCdispatcheridCode() {
|
||||
return cdispatcheridCode;
|
||||
}
|
||||
|
||||
public void setCdispatcheridCode(String cdispatcheridCode) {
|
||||
this.cdispatcheridCode = cdispatcheridCode;
|
||||
}
|
||||
|
||||
public String getCdispatcheridName() {
|
||||
return cdispatcheridName;
|
||||
}
|
||||
|
||||
public void setCdispatcheridName(String cdispatcheridName) {
|
||||
this.cdispatcheridName = cdispatcheridName;
|
||||
}
|
||||
|
||||
public String getCoperatorid() {
|
||||
return coperatorid;
|
||||
}
|
||||
|
||||
public void setCoperatorid(String coperatorid) {
|
||||
this.coperatorid = coperatorid;
|
||||
}
|
||||
|
||||
public String getCoperatoridCode() {
|
||||
return coperatoridCode;
|
||||
}
|
||||
|
||||
public void setCoperatoridCode(String coperatoridCode) {
|
||||
this.coperatoridCode = coperatoridCode;
|
||||
}
|
||||
|
||||
public String getCoperatoridName() {
|
||||
return coperatoridName;
|
||||
}
|
||||
|
||||
public void setCoperatoridName(String coperatoridName) {
|
||||
this.coperatoridName = coperatoridName;
|
||||
}
|
||||
|
||||
public String getCwhsmanagerid() {
|
||||
return cwhsmanagerid;
|
||||
}
|
||||
|
||||
public void setCwhsmanagerid(String cwhsmanagerid) {
|
||||
this.cwhsmanagerid = cwhsmanagerid;
|
||||
}
|
||||
|
||||
public List<MaterialoutDetailPo> getChildrenvo() {
|
||||
return childrenvo;
|
||||
}
|
||||
|
||||
public void setChildrenvo(List<MaterialoutDetailPo> childrenvo) {
|
||||
this.childrenvo = childrenvo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
//现存量
|
||||
public class OnhandPo {
|
||||
|
||||
private Long id;//主键ID
|
||||
private String pkCorp;//单位ID
|
||||
private String corpCode;//单位编码
|
||||
private String corpName;//单位名称
|
||||
private String ccalbodyid;//库存组织ID
|
||||
private String ccalbodyCode;//库存组织编码
|
||||
private String ccalbodyName;//库存组织名称
|
||||
private String cwarehouseid;//仓库ID
|
||||
private String cwarehouseCode;//仓库编码
|
||||
private String cwarehouseName;//仓库名称
|
||||
private String cinventoryid;//存货ID
|
||||
private String cinventoryCode;//存货编码
|
||||
private String cinventoryName;//存货名称
|
||||
private String invspec;//规格型号
|
||||
private BigDecimal nnum;//数量
|
||||
private BigDecimal nastnum;//在途数量
|
||||
private BigDecimal nfreezenum;//冻结数量
|
||||
private Date dataDate;//数据日期
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getDataDate() {
|
||||
return dataDate;
|
||||
}
|
||||
|
||||
public void setDataDate(Date dataDate) {
|
||||
this.dataDate = dataDate;
|
||||
}
|
||||
|
||||
public String getPkCorp() {
|
||||
return pkCorp;
|
||||
}
|
||||
|
||||
public void setPkCorp(String pkCorp) {
|
||||
this.pkCorp = pkCorp;
|
||||
}
|
||||
|
||||
public String getCorpCode() {
|
||||
return corpCode;
|
||||
}
|
||||
|
||||
public void setCorpCode(String corpCode) {
|
||||
this.corpCode = corpCode;
|
||||
}
|
||||
|
||||
public String getCorpName() {
|
||||
return corpName;
|
||||
}
|
||||
|
||||
public void setCorpName(String corpName) {
|
||||
this.corpName = corpName;
|
||||
}
|
||||
|
||||
public String getCcalbodyid() {
|
||||
return ccalbodyid;
|
||||
}
|
||||
|
||||
public void setCcalbodyid(String ccalbodyid) {
|
||||
this.ccalbodyid = ccalbodyid;
|
||||
}
|
||||
|
||||
public String getCcalbodyCode() {
|
||||
return ccalbodyCode;
|
||||
}
|
||||
|
||||
public void setCcalbodyCode(String ccalbodyCode) {
|
||||
this.ccalbodyCode = ccalbodyCode;
|
||||
}
|
||||
|
||||
public String getCcalbodyName() {
|
||||
return ccalbodyName;
|
||||
}
|
||||
|
||||
public void setCcalbodyName(String ccalbodyName) {
|
||||
this.ccalbodyName = ccalbodyName;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getCwarehouseCode() {
|
||||
return cwarehouseCode;
|
||||
}
|
||||
|
||||
public void setCwarehouseCode(String cwarehouseCode) {
|
||||
this.cwarehouseCode = cwarehouseCode;
|
||||
}
|
||||
|
||||
public String getCwarehouseName() {
|
||||
return cwarehouseName;
|
||||
}
|
||||
|
||||
public void setCwarehouseName(String cwarehouseName) {
|
||||
this.cwarehouseName = cwarehouseName;
|
||||
}
|
||||
|
||||
public String getCinventoryid() {
|
||||
return cinventoryid;
|
||||
}
|
||||
|
||||
public void setCinventoryid(String cinventoryid) {
|
||||
this.cinventoryid = cinventoryid;
|
||||
}
|
||||
|
||||
public String getCinventoryCode() {
|
||||
return cinventoryCode;
|
||||
}
|
||||
|
||||
public void setCinventoryCode(String cinventoryCode) {
|
||||
this.cinventoryCode = cinventoryCode;
|
||||
}
|
||||
|
||||
public String getCinventoryName() {
|
||||
return cinventoryName;
|
||||
}
|
||||
|
||||
public void setCinventoryName(String cinventoryName) {
|
||||
this.cinventoryName = cinventoryName;
|
||||
}
|
||||
|
||||
public String getInvspec() {
|
||||
return invspec;
|
||||
}
|
||||
|
||||
public void setInvspec(String invspec) {
|
||||
this.invspec = invspec;
|
||||
}
|
||||
|
||||
public BigDecimal getNnum() {
|
||||
return nnum;
|
||||
}
|
||||
|
||||
public void setNnum(BigDecimal nnum) {
|
||||
this.nnum = nnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNastnum() {
|
||||
return nastnum;
|
||||
}
|
||||
|
||||
public void setNastnum(BigDecimal nastnum) {
|
||||
this.nastnum = nastnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNfreezenum() {
|
||||
return nfreezenum;
|
||||
}
|
||||
|
||||
public void setNfreezenum(BigDecimal nfreezenum) {
|
||||
this.nfreezenum = nfreezenum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OtherinDetailPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据编号
|
||||
private String inventoryCode;//存货编码
|
||||
private String inventoryName;//存货名称
|
||||
private BigDecimal ninnum;//实入数量
|
||||
private BigDecimal nmny;//金额
|
||||
private String vbatchcode;//批次号
|
||||
|
||||
public String getInventoryCode() {
|
||||
return inventoryCode;
|
||||
}
|
||||
|
||||
public void setInventoryCode(String inventoryCode) {
|
||||
this.inventoryCode = inventoryCode;
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return inventoryName;
|
||||
}
|
||||
|
||||
public void setInventoryName(String inventoryName) {
|
||||
this.inventoryName = inventoryName;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public BigDecimal getNinnum() {
|
||||
return ninnum;
|
||||
}
|
||||
|
||||
public void setNinnum(BigDecimal ninnum) {
|
||||
this.ninnum = ninnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNmny() {
|
||||
return nmny;
|
||||
}
|
||||
|
||||
public void setNmny(BigDecimal nmny) {
|
||||
this.nmny = nmny;
|
||||
}
|
||||
|
||||
public String getVbatchcode() {
|
||||
return vbatchcode;
|
||||
}
|
||||
|
||||
public void setVbatchcode(String vbatchcode) {
|
||||
this.vbatchcode = vbatchcode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class OtherinPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据号
|
||||
private Date dbilldate;//单据日期
|
||||
private String cwarehouseid;//仓库id
|
||||
private String warehouseidCode;//仓库编码
|
||||
private String warehouseidName;//仓库名称
|
||||
private String coperatorid;//制单人id
|
||||
private String operatorCode;//制单人编码
|
||||
private String operatorName;//制单人名称
|
||||
private String cregister;//签字人id
|
||||
private String registerCode;//签字人编码
|
||||
private String registerName;//签字人名称
|
||||
private String cauditorid;//审核人id
|
||||
private String auditorCode;//审核人编码
|
||||
private String auditorName;//审核人名称
|
||||
private String pkCalbody;//库存组织id
|
||||
private String calbodyCode;//库存组织编码
|
||||
private String calbodyName;//库存组织名称
|
||||
private String dr;//删除标志
|
||||
private List<OtherinDetailPo> childrenvo;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Date getDbilldate() {
|
||||
return dbilldate;
|
||||
}
|
||||
|
||||
public void setDbilldate(Date dbilldate) {
|
||||
this.dbilldate = dbilldate;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getWarehouseidCode() {
|
||||
return warehouseidCode;
|
||||
}
|
||||
|
||||
public void setWarehouseidCode(String warehouseidCode) {
|
||||
this.warehouseidCode = warehouseidCode;
|
||||
}
|
||||
|
||||
public String getWarehouseidName() {
|
||||
return warehouseidName;
|
||||
}
|
||||
|
||||
public void setWarehouseidName(String warehouseidName) {
|
||||
this.warehouseidName = warehouseidName;
|
||||
}
|
||||
|
||||
public String getCoperatorid() {
|
||||
return coperatorid;
|
||||
}
|
||||
|
||||
public void setCoperatorid(String coperatorid) {
|
||||
this.coperatorid = coperatorid;
|
||||
}
|
||||
|
||||
public String getOperatorCode() {
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode) {
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getCregister() {
|
||||
return cregister;
|
||||
}
|
||||
|
||||
public void setCregister(String cregister) {
|
||||
this.cregister = cregister;
|
||||
}
|
||||
|
||||
public String getRegisterCode() {
|
||||
return registerCode;
|
||||
}
|
||||
|
||||
public void setRegisterCode(String registerCode) {
|
||||
this.registerCode = registerCode;
|
||||
}
|
||||
|
||||
public String getRegisterName() {
|
||||
return registerName;
|
||||
}
|
||||
|
||||
public void setRegisterName(String registerName) {
|
||||
this.registerName = registerName;
|
||||
}
|
||||
|
||||
public String getCauditorid() {
|
||||
return cauditorid;
|
||||
}
|
||||
|
||||
public void setCauditorid(String cauditorid) {
|
||||
this.cauditorid = cauditorid;
|
||||
}
|
||||
|
||||
public String getAuditorCode() {
|
||||
return auditorCode;
|
||||
}
|
||||
|
||||
public void setAuditorCode(String auditorCode) {
|
||||
this.auditorCode = auditorCode;
|
||||
}
|
||||
|
||||
public String getAuditorName() {
|
||||
return auditorName;
|
||||
}
|
||||
|
||||
public void setAuditorName(String auditorName) {
|
||||
this.auditorName = auditorName;
|
||||
}
|
||||
|
||||
public String getPkCalbody() {
|
||||
return pkCalbody;
|
||||
}
|
||||
|
||||
public void setPkCalbody(String pkCalbody) {
|
||||
this.pkCalbody = pkCalbody;
|
||||
}
|
||||
|
||||
public String getCalbodyCode() {
|
||||
return calbodyCode;
|
||||
}
|
||||
|
||||
public void setCalbodyCode(String calbodyCode) {
|
||||
this.calbodyCode = calbodyCode;
|
||||
}
|
||||
|
||||
public String getCalbodyName() {
|
||||
return calbodyName;
|
||||
}
|
||||
|
||||
public void setCalbodyName(String calbodyName) {
|
||||
this.calbodyName = calbodyName;
|
||||
}
|
||||
|
||||
public String getDr() {
|
||||
return dr;
|
||||
}
|
||||
|
||||
public void setDr(String dr) {
|
||||
this.dr = dr;
|
||||
}
|
||||
|
||||
public List<OtherinDetailPo> getChildrenvo() {
|
||||
return childrenvo;
|
||||
}
|
||||
|
||||
public void setChildrenvo(List<OtherinDetailPo> childrenvo) {
|
||||
this.childrenvo = childrenvo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OtheroutDetailPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据编号
|
||||
private String inventoryCode;//存货编码
|
||||
private String inventoryName;//存货名称
|
||||
private BigDecimal ninnum;//实入数量
|
||||
private BigDecimal nmny;//金额
|
||||
private String vbatchcode;//批次号
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public String getInventoryCode() {
|
||||
return inventoryCode;
|
||||
}
|
||||
|
||||
public void setInventoryCode(String inventoryCode) {
|
||||
this.inventoryCode = inventoryCode;
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return inventoryName;
|
||||
}
|
||||
|
||||
public void setInventoryName(String inventoryName) {
|
||||
this.inventoryName = inventoryName;
|
||||
}
|
||||
|
||||
public BigDecimal getNinnum() {
|
||||
return ninnum;
|
||||
}
|
||||
|
||||
public void setNinnum(BigDecimal ninnum) {
|
||||
this.ninnum = ninnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNmny() {
|
||||
return nmny;
|
||||
}
|
||||
|
||||
public void setNmny(BigDecimal nmny) {
|
||||
this.nmny = nmny;
|
||||
}
|
||||
|
||||
public String getVbatchcode() {
|
||||
return vbatchcode;
|
||||
}
|
||||
|
||||
public void setVbatchcode(String vbatchcode) {
|
||||
this.vbatchcode = vbatchcode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class OtheroutPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据号
|
||||
private Date dbilldate;//单据日期
|
||||
private String cwarehouseid;//仓库id
|
||||
private String warehouseidCode;//仓库编码
|
||||
private String warehouseidName;//仓库名称
|
||||
private String coperatorid;//制单人id
|
||||
private String operatorCode;//制单人编码
|
||||
private String operatorName;//制单人名称
|
||||
private String cregister;//签字人id
|
||||
private String registerCode;//签字人编码
|
||||
private String registerName;//签字人名称
|
||||
private String cauditorid;//审核人id
|
||||
private String auditorCode;//审核人编码
|
||||
private String auditorName;//审核人名称
|
||||
private String pkCalbody;//库存组织id
|
||||
private String calbodyCode;//库存组织编码
|
||||
private String calbodyName;//库存组织名称
|
||||
private String dr;//删除标志
|
||||
private List<OtheroutDetailPo> childrenvo;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Date getDbilldate() {
|
||||
return dbilldate;
|
||||
}
|
||||
|
||||
public void setDbilldate(Date dbilldate) {
|
||||
this.dbilldate = dbilldate;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getWarehouseidCode() {
|
||||
return warehouseidCode;
|
||||
}
|
||||
|
||||
public void setWarehouseidCode(String warehouseidCode) {
|
||||
this.warehouseidCode = warehouseidCode;
|
||||
}
|
||||
|
||||
public String getWarehouseidName() {
|
||||
return warehouseidName;
|
||||
}
|
||||
|
||||
public void setWarehouseidName(String warehouseidName) {
|
||||
this.warehouseidName = warehouseidName;
|
||||
}
|
||||
|
||||
public String getCoperatorid() {
|
||||
return coperatorid;
|
||||
}
|
||||
|
||||
public void setCoperatorid(String coperatorid) {
|
||||
this.coperatorid = coperatorid;
|
||||
}
|
||||
|
||||
public String getOperatorCode() {
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode) {
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getCregister() {
|
||||
return cregister;
|
||||
}
|
||||
|
||||
public void setCregister(String cregister) {
|
||||
this.cregister = cregister;
|
||||
}
|
||||
|
||||
public String getRegisterCode() {
|
||||
return registerCode;
|
||||
}
|
||||
|
||||
public void setRegisterCode(String registerCode) {
|
||||
this.registerCode = registerCode;
|
||||
}
|
||||
|
||||
public String getRegisterName() {
|
||||
return registerName;
|
||||
}
|
||||
|
||||
public void setRegisterName(String registerName) {
|
||||
this.registerName = registerName;
|
||||
}
|
||||
|
||||
public String getCauditorid() {
|
||||
return cauditorid;
|
||||
}
|
||||
|
||||
public void setCauditorid(String cauditorid) {
|
||||
this.cauditorid = cauditorid;
|
||||
}
|
||||
|
||||
public String getAuditorCode() {
|
||||
return auditorCode;
|
||||
}
|
||||
|
||||
public void setAuditorCode(String auditorCode) {
|
||||
this.auditorCode = auditorCode;
|
||||
}
|
||||
|
||||
public String getAuditorName() {
|
||||
return auditorName;
|
||||
}
|
||||
|
||||
public void setAuditorName(String auditorName) {
|
||||
this.auditorName = auditorName;
|
||||
}
|
||||
|
||||
public String getPkCalbody() {
|
||||
return pkCalbody;
|
||||
}
|
||||
|
||||
public void setPkCalbody(String pkCalbody) {
|
||||
this.pkCalbody = pkCalbody;
|
||||
}
|
||||
|
||||
public String getCalbodyCode() {
|
||||
return calbodyCode;
|
||||
}
|
||||
|
||||
public void setCalbodyCode(String calbodyCode) {
|
||||
this.calbodyCode = calbodyCode;
|
||||
}
|
||||
|
||||
public String getCalbodyName() {
|
||||
return calbodyName;
|
||||
}
|
||||
|
||||
public void setCalbodyName(String calbodyName) {
|
||||
this.calbodyName = calbodyName;
|
||||
}
|
||||
|
||||
public String getDr() {
|
||||
return dr;
|
||||
}
|
||||
|
||||
public void setDr(String dr) {
|
||||
this.dr = dr;
|
||||
}
|
||||
|
||||
public List<OtheroutDetailPo> getChildrenvo() {
|
||||
return childrenvo;
|
||||
}
|
||||
|
||||
public void setChildrenvo(List<OtheroutDetailPo> childrenvo) {
|
||||
this.childrenvo = childrenvo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
//产成品入库单表体
|
||||
public class ProductinDetailPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据编号
|
||||
private String inventoryCode;//存货编码
|
||||
private String inventoryName;//存货名称
|
||||
private BigDecimal ninnum;//实入数量
|
||||
private BigDecimal nmny;//金额
|
||||
private String vbatchcode;//批次号
|
||||
|
||||
public String getInventoryCode() {
|
||||
return inventoryCode;
|
||||
}
|
||||
|
||||
public void setInventoryCode(String inventoryCode) {
|
||||
this.inventoryCode = inventoryCode;
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return inventoryName;
|
||||
}
|
||||
|
||||
public void setInventoryName(String inventoryName) {
|
||||
this.inventoryName = inventoryName;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public BigDecimal getNinnum() {
|
||||
return ninnum;
|
||||
}
|
||||
|
||||
public void setNinnum(BigDecimal ninnum) {
|
||||
this.ninnum = ninnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNmny() {
|
||||
return nmny;
|
||||
}
|
||||
|
||||
public void setNmny(BigDecimal nmny) {
|
||||
this.nmny = nmny;
|
||||
}
|
||||
|
||||
public String getVbatchcode() {
|
||||
return vbatchcode;
|
||||
}
|
||||
|
||||
public void setVbatchcode(String vbatchcode) {
|
||||
this.vbatchcode = vbatchcode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
//产成品入库单表头
|
||||
public class ProductinPo {
|
||||
|
||||
private Long id ;
|
||||
private String vbillcode;//单据号
|
||||
private Date dbilldate;//单据日期
|
||||
private String cwarehouseid;//仓库ID
|
||||
private String warehouseidCode;//仓库编码
|
||||
private String warehouseidName;//仓库名称
|
||||
private String coperatorid;//制单人ID
|
||||
private String operatorCode;//制单人编码
|
||||
private String operatorName;//制单人名称
|
||||
private String cregister;//签字人id
|
||||
private String registerCode;//签字人编码
|
||||
private String registerName;//签字人名称
|
||||
private String cauditorid;//审核人ID
|
||||
private String auditorCode;//审核人编码
|
||||
private String auditorName;//审核人名称
|
||||
private String pkCalbody;//库存组织ID
|
||||
private String calbodyCode;//库存组织编码
|
||||
private String calbodyName;//库存组织名称
|
||||
private String dr;
|
||||
private List<ProductinDetailPo> childrenvo;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Date getDbilldate() {
|
||||
return dbilldate;
|
||||
}
|
||||
|
||||
public void setDbilldate(Date dbilldate) {
|
||||
this.dbilldate = dbilldate;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getWarehouseidCode() {
|
||||
return warehouseidCode;
|
||||
}
|
||||
|
||||
public void setWarehouseidCode(String warehouseidCode) {
|
||||
this.warehouseidCode = warehouseidCode;
|
||||
}
|
||||
|
||||
public String getWarehouseidName() {
|
||||
return warehouseidName;
|
||||
}
|
||||
|
||||
public void setWarehouseidName(String warehouseidName) {
|
||||
this.warehouseidName = warehouseidName;
|
||||
}
|
||||
|
||||
public String getCoperatorid() {
|
||||
return coperatorid;
|
||||
}
|
||||
|
||||
public void setCoperatorid(String coperatorid) {
|
||||
this.coperatorid = coperatorid;
|
||||
}
|
||||
|
||||
public String getOperatorCode() {
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode) {
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getCregister() {
|
||||
return cregister;
|
||||
}
|
||||
|
||||
public void setCregister(String cregister) {
|
||||
this.cregister = cregister;
|
||||
}
|
||||
|
||||
public String getRegisterCode() {
|
||||
return registerCode;
|
||||
}
|
||||
|
||||
public void setRegisterCode(String registerCode) {
|
||||
this.registerCode = registerCode;
|
||||
}
|
||||
|
||||
public String getRegisterName() {
|
||||
return registerName;
|
||||
}
|
||||
|
||||
public void setRegisterName(String registerName) {
|
||||
this.registerName = registerName;
|
||||
}
|
||||
|
||||
public String getCauditorid() {
|
||||
return cauditorid;
|
||||
}
|
||||
|
||||
public void setCauditorid(String cauditorid) {
|
||||
this.cauditorid = cauditorid;
|
||||
}
|
||||
|
||||
public String getAuditorCode() {
|
||||
return auditorCode;
|
||||
}
|
||||
|
||||
public void setAuditorCode(String auditorCode) {
|
||||
this.auditorCode = auditorCode;
|
||||
}
|
||||
|
||||
public String getAuditorName() {
|
||||
return auditorName;
|
||||
}
|
||||
|
||||
public void setAuditorName(String auditorName) {
|
||||
this.auditorName = auditorName;
|
||||
}
|
||||
|
||||
public String getPkCalbody() {
|
||||
return pkCalbody;
|
||||
}
|
||||
|
||||
public void setPkCalbody(String pkCalbody) {
|
||||
this.pkCalbody = pkCalbody;
|
||||
}
|
||||
|
||||
public String getCalbodyCode() {
|
||||
return calbodyCode;
|
||||
}
|
||||
|
||||
public void setCalbodyCode(String calbodyCode) {
|
||||
this.calbodyCode = calbodyCode;
|
||||
}
|
||||
|
||||
public String getCalbodyName() {
|
||||
return calbodyName;
|
||||
}
|
||||
|
||||
public void setCalbodyName(String calbodyName) {
|
||||
this.calbodyName = calbodyName;
|
||||
}
|
||||
|
||||
public String getDr() {
|
||||
return dr;
|
||||
}
|
||||
|
||||
public void setDr(String dr) {
|
||||
this.dr = dr;
|
||||
}
|
||||
|
||||
public List<ProductinDetailPo> getChildrenvo() {
|
||||
return childrenvo;
|
||||
}
|
||||
|
||||
public void setChildrenvo(List<ProductinDetailPo> childrenvo) {
|
||||
this.childrenvo = childrenvo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
//采购入库单表体
|
||||
public class PurchaseinDetailPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;
|
||||
private String cinventoryid;//存货ID
|
||||
private String inventoryCode;//存货编码
|
||||
private String inventoryName;//存货名称
|
||||
private String invspec;//规格
|
||||
private String invtype;//型号
|
||||
private BigDecimal ninnum;//实入数量
|
||||
private BigDecimal nprice;//无税单价
|
||||
private BigDecimal nquotentmny;//原币无税金额
|
||||
private BigDecimal ntaxprice;//含税单价
|
||||
private BigDecimal ntaxmny;//含税金额
|
||||
private String vbatchcode;//批次号
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCinventoryid() {
|
||||
return cinventoryid;
|
||||
}
|
||||
|
||||
public void setCinventoryid(String cinventoryid) {
|
||||
this.cinventoryid = cinventoryid;
|
||||
}
|
||||
|
||||
public String getInventoryCode() {
|
||||
return inventoryCode;
|
||||
}
|
||||
|
||||
public void setInventoryCode(String inventoryCode) {
|
||||
this.inventoryCode = inventoryCode;
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return inventoryName;
|
||||
}
|
||||
|
||||
public void setInventoryName(String inventoryName) {
|
||||
this.inventoryName = inventoryName;
|
||||
}
|
||||
|
||||
public String getInvspec() {
|
||||
return invspec;
|
||||
}
|
||||
|
||||
public void setInvspec(String invspec) {
|
||||
this.invspec = invspec;
|
||||
}
|
||||
|
||||
public String getInvtype() {
|
||||
return invtype;
|
||||
}
|
||||
|
||||
public void setInvtype(String invtype) {
|
||||
this.invtype = invtype;
|
||||
}
|
||||
|
||||
public BigDecimal getNinnum() {
|
||||
return ninnum;
|
||||
}
|
||||
|
||||
public void setNinnum(BigDecimal ninnum) {
|
||||
this.ninnum = ninnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNprice() {
|
||||
return nprice;
|
||||
}
|
||||
|
||||
public void setNprice(BigDecimal nprice) {
|
||||
this.nprice = nprice;
|
||||
}
|
||||
|
||||
public BigDecimal getNquotentmny() {
|
||||
return nquotentmny;
|
||||
}
|
||||
|
||||
public void setNquotentmny(BigDecimal nquotentmny) {
|
||||
this.nquotentmny = nquotentmny;
|
||||
}
|
||||
|
||||
public BigDecimal getNtaxprice() {
|
||||
return ntaxprice;
|
||||
}
|
||||
|
||||
public void setNtaxprice(BigDecimal ntaxprice) {
|
||||
this.ntaxprice = ntaxprice;
|
||||
}
|
||||
|
||||
public BigDecimal getNtaxmny() {
|
||||
return ntaxmny;
|
||||
}
|
||||
|
||||
public void setNtaxmny(BigDecimal ntaxmny) {
|
||||
this.ntaxmny = ntaxmny;
|
||||
}
|
||||
|
||||
public String getVbatchcode() {
|
||||
return vbatchcode;
|
||||
}
|
||||
|
||||
public void setVbatchcode(String vbatchcode) {
|
||||
this.vbatchcode = vbatchcode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
//采购入库单表头
|
||||
public class PurchaseinPo {
|
||||
|
||||
private Long id;
|
||||
private String cauditorid;//审核人ID
|
||||
private String auditorCode;//审核人编码
|
||||
private String auditorName;//审核人名称
|
||||
private String pkCalbody;//库存组织ID
|
||||
private String calbodyCode;//库存组织编码
|
||||
private String calbodyName;//库存组织名称
|
||||
private String coperatorid;//制单人ID
|
||||
private String operatorCode;//制单人编码
|
||||
private String operatorName;//制单人名称
|
||||
private String cregister;//签字人ID
|
||||
private String registerCode;//签字人编码
|
||||
private String registerName;//签字人名称
|
||||
private String vbillcode;//单据编号
|
||||
private Date dbilldate;//单据日期
|
||||
private String cwarehouseid;//仓库ID
|
||||
private String warehouseidCode;//仓库编码
|
||||
private String warehouseidName;//仓库名称
|
||||
private String cproviderid;//供应商id
|
||||
private String providerCode;//供应商id
|
||||
private String providerName;//供应商名称
|
||||
private String dr;//删除标识
|
||||
private List<PurchaseinDetailPo> childrenvo;//表体
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCauditorid() {
|
||||
return cauditorid;
|
||||
}
|
||||
|
||||
public void setCauditorid(String cauditorid) {
|
||||
this.cauditorid = cauditorid;
|
||||
}
|
||||
|
||||
public String getAuditorCode() {
|
||||
return auditorCode;
|
||||
}
|
||||
|
||||
public void setAuditorCode(String auditorCode) {
|
||||
this.auditorCode = auditorCode;
|
||||
}
|
||||
|
||||
public String getAuditorName() {
|
||||
return auditorName;
|
||||
}
|
||||
|
||||
public void setAuditorName(String auditorName) {
|
||||
this.auditorName = auditorName;
|
||||
}
|
||||
|
||||
public String getPkCalbody() {
|
||||
return pkCalbody;
|
||||
}
|
||||
|
||||
public void setPkCalbody(String pkCalbody) {
|
||||
this.pkCalbody = pkCalbody;
|
||||
}
|
||||
|
||||
public String getCalbodyCode() {
|
||||
return calbodyCode;
|
||||
}
|
||||
|
||||
public void setCalbodyCode(String calbodyCode) {
|
||||
this.calbodyCode = calbodyCode;
|
||||
}
|
||||
|
||||
public String getCalbodyName() {
|
||||
return calbodyName;
|
||||
}
|
||||
|
||||
public void setCalbodyName(String calbodyName) {
|
||||
this.calbodyName = calbodyName;
|
||||
}
|
||||
|
||||
public String getCoperatorid() {
|
||||
return coperatorid;
|
||||
}
|
||||
|
||||
public void setCoperatorid(String coperatorid) {
|
||||
this.coperatorid = coperatorid;
|
||||
}
|
||||
|
||||
public String getOperatorCode() {
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode) {
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getCregister() {
|
||||
return cregister;
|
||||
}
|
||||
|
||||
public void setCregister(String cregister) {
|
||||
this.cregister = cregister;
|
||||
}
|
||||
|
||||
public String getRegisterCode() {
|
||||
return registerCode;
|
||||
}
|
||||
|
||||
public void setRegisterCode(String registerCode) {
|
||||
this.registerCode = registerCode;
|
||||
}
|
||||
|
||||
public String getRegisterName() {
|
||||
return registerName;
|
||||
}
|
||||
|
||||
public void setRegisterName(String registerName) {
|
||||
this.registerName = registerName;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Date getDbilldate() {
|
||||
return dbilldate;
|
||||
}
|
||||
|
||||
public void setDbilldate(Date dbilldate) {
|
||||
this.dbilldate = dbilldate;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getWarehouseidCode() {
|
||||
return warehouseidCode;
|
||||
}
|
||||
|
||||
public void setWarehouseidCode(String warehouseidCode) {
|
||||
this.warehouseidCode = warehouseidCode;
|
||||
}
|
||||
|
||||
public String getWarehouseidName() {
|
||||
return warehouseidName;
|
||||
}
|
||||
|
||||
public void setWarehouseidName(String warehouseidName) {
|
||||
this.warehouseidName = warehouseidName;
|
||||
}
|
||||
|
||||
public String getCproviderid() {
|
||||
return cproviderid;
|
||||
}
|
||||
|
||||
public void setCproviderid(String cproviderid) {
|
||||
this.cproviderid = cproviderid;
|
||||
}
|
||||
|
||||
public String getProviderCode() {
|
||||
return providerCode;
|
||||
}
|
||||
|
||||
public void setProviderCode(String providerCode) {
|
||||
this.providerCode = providerCode;
|
||||
}
|
||||
|
||||
public String getProviderName() {
|
||||
return providerName;
|
||||
}
|
||||
|
||||
public void setProviderName(String providerName) {
|
||||
this.providerName = providerName;
|
||||
}
|
||||
|
||||
public String getDr() {
|
||||
return dr;
|
||||
}
|
||||
|
||||
public void setDr(String dr) {
|
||||
this.dr = dr;
|
||||
}
|
||||
|
||||
public List<PurchaseinDetailPo> getChildrenvo() {
|
||||
return childrenvo;
|
||||
}
|
||||
|
||||
public void setChildrenvo(List<PurchaseinDetailPo> childrenvo) {
|
||||
this.childrenvo = childrenvo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class SaleoutDetailPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据编号
|
||||
private String inventoryCode;//存货编码
|
||||
private String inventoryName;//存货名称
|
||||
private BigDecimal ninnum;//实入数量
|
||||
private BigDecimal nmny;//金额
|
||||
private String vbatchcode;//批次号
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public String getInventoryCode() {
|
||||
return inventoryCode;
|
||||
}
|
||||
|
||||
public void setInventoryCode(String inventoryCode) {
|
||||
this.inventoryCode = inventoryCode;
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return inventoryName;
|
||||
}
|
||||
|
||||
public void setInventoryName(String inventoryName) {
|
||||
this.inventoryName = inventoryName;
|
||||
}
|
||||
|
||||
public BigDecimal getNinnum() {
|
||||
return ninnum;
|
||||
}
|
||||
|
||||
public void setNinnum(BigDecimal ninnum) {
|
||||
this.ninnum = ninnum;
|
||||
}
|
||||
|
||||
public BigDecimal getNmny() {
|
||||
return nmny;
|
||||
}
|
||||
|
||||
public void setNmny(BigDecimal nmny) {
|
||||
this.nmny = nmny;
|
||||
}
|
||||
|
||||
public String getVbatchcode() {
|
||||
return vbatchcode;
|
||||
}
|
||||
|
||||
public void setVbatchcode(String vbatchcode) {
|
||||
this.vbatchcode = vbatchcode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.seeyon.apps.src_reportDataSync.po;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class SaleoutPo {
|
||||
|
||||
private Long id;
|
||||
private String vbillcode;//单据号
|
||||
private Date dbilldate;//单据日期
|
||||
private String cwarehouseid;//仓库id
|
||||
private String warehouseidCode;//仓库编码
|
||||
private String warehouseidName;//仓库名称
|
||||
private String coperatorid;//制单人id
|
||||
private String operatorCode;//制单人编码
|
||||
private String operatorName;//制单人名称
|
||||
private String cregister;//签字人id
|
||||
private String registerCode;//签字人编码
|
||||
private String registerName;//签字人名称
|
||||
private String cauditorid;//审核人id
|
||||
private String auditorCode;//审核人编码
|
||||
private String auditorName;//审核人名称
|
||||
private String pkCalbody;//库存组织id
|
||||
private String calbodyCode;//库存组织编码
|
||||
private String calbodyName;//库存组织名称
|
||||
private String dr;//删除标志
|
||||
private List<SaleoutDetailPo> childrenvo;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVbillcode() {
|
||||
return vbillcode;
|
||||
}
|
||||
|
||||
public void setVbillcode(String vbillcode) {
|
||||
this.vbillcode = vbillcode;
|
||||
}
|
||||
|
||||
public Date getDbilldate() {
|
||||
return dbilldate;
|
||||
}
|
||||
|
||||
public void setDbilldate(Date dbilldate) {
|
||||
this.dbilldate = dbilldate;
|
||||
}
|
||||
|
||||
public String getCwarehouseid() {
|
||||
return cwarehouseid;
|
||||
}
|
||||
|
||||
public void setCwarehouseid(String cwarehouseid) {
|
||||
this.cwarehouseid = cwarehouseid;
|
||||
}
|
||||
|
||||
public String getWarehouseidCode() {
|
||||
return warehouseidCode;
|
||||
}
|
||||
|
||||
public void setWarehouseidCode(String warehouseidCode) {
|
||||
this.warehouseidCode = warehouseidCode;
|
||||
}
|
||||
|
||||
public String getWarehouseidName() {
|
||||
return warehouseidName;
|
||||
}
|
||||
|
||||
public void setWarehouseidName(String warehouseidName) {
|
||||
this.warehouseidName = warehouseidName;
|
||||
}
|
||||
|
||||
public String getCoperatorid() {
|
||||
return coperatorid;
|
||||
}
|
||||
|
||||
public void setCoperatorid(String coperatorid) {
|
||||
this.coperatorid = coperatorid;
|
||||
}
|
||||
|
||||
public String getOperatorCode() {
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode) {
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getCregister() {
|
||||
return cregister;
|
||||
}
|
||||
|
||||
public void setCregister(String cregister) {
|
||||
this.cregister = cregister;
|
||||
}
|
||||
|
||||
public String getRegisterCode() {
|
||||
return registerCode;
|
||||
}
|
||||
|
||||
public void setRegisterCode(String registerCode) {
|
||||
this.registerCode = registerCode;
|
||||
}
|
||||
|
||||
public String getRegisterName() {
|
||||
return registerName;
|
||||
}
|
||||
|
||||
public void setRegisterName(String registerName) {
|
||||
this.registerName = registerName;
|
||||
}
|
||||
|
||||
public String getCauditorid() {
|
||||
return cauditorid;
|
||||
}
|
||||
|
||||
public void setCauditorid(String cauditorid) {
|
||||
this.cauditorid = cauditorid;
|
||||
}
|
||||
|
||||
public String getAuditorCode() {
|
||||
return auditorCode;
|
||||
}
|
||||
|
||||
public void setAuditorCode(String auditorCode) {
|
||||
this.auditorCode = auditorCode;
|
||||
}
|
||||
|
||||
public String getAuditorName() {
|
||||
return auditorName;
|
||||
}
|
||||
|
||||
public void setAuditorName(String auditorName) {
|
||||
this.auditorName = auditorName;
|
||||
}
|
||||
|
||||
public String getPkCalbody() {
|
||||
return pkCalbody;
|
||||
}
|
||||
|
||||
public void setPkCalbody(String pkCalbody) {
|
||||
this.pkCalbody = pkCalbody;
|
||||
}
|
||||
|
||||
public String getCalbodyCode() {
|
||||
return calbodyCode;
|
||||
}
|
||||
|
||||
public void setCalbodyCode(String calbodyCode) {
|
||||
this.calbodyCode = calbodyCode;
|
||||
}
|
||||
|
||||
public String getCalbodyName() {
|
||||
return calbodyName;
|
||||
}
|
||||
|
||||
public void setCalbodyName(String calbodyName) {
|
||||
this.calbodyName = calbodyName;
|
||||
}
|
||||
|
||||
public String getDr() {
|
||||
return dr;
|
||||
}
|
||||
|
||||
public void setDr(String dr) {
|
||||
this.dr = dr;
|
||||
}
|
||||
|
||||
public List<SaleoutDetailPo> getChildrenvo() {
|
||||
return childrenvo;
|
||||
}
|
||||
|
||||
public void setChildrenvo(List<SaleoutDetailPo> childrenvo) {
|
||||
this.childrenvo = childrenvo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.seeyon.apps.src_reportDataSync.quartz;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.ext.quartz.AbstractQuartzTask;
|
||||
import com.seeyon.apps.src_reportDataSync.constants.U8DataSyncConstants;
|
||||
import com.seeyon.apps.src_reportDataSync.service.U8WarehouseDataSyncService;
|
||||
import com.seeyon.apps.src_reportDataSync.util.SystemTableExecutor;
|
||||
import com.seeyon.cap4.util.StringUtil;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.utils.form.FormWhereCondition;
|
||||
import com.seeyon.utils.form.SqlBuildParam;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class U8WarehouseDataSyncQuartz extends AbstractQuartzTask {
|
||||
|
||||
private static Log log = Log.get(U8WarehouseDataSyncQuartz.class);
|
||||
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Inject
|
||||
private U8WarehouseDataSyncService u8WarehouseDataSyncService ;
|
||||
|
||||
public String getPluginId() {return U8DataSyncConstants.getPluginId();}
|
||||
public ConfigVo getU8DataSyncConfig() {return cstConfigApi.getConfig(getPluginId());}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "U8C数据同步定时任务";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String taskRun(String p) throws Exception {
|
||||
log.info("========== 开始执行U8仓库数据同步任务 ==========");
|
||||
try {
|
||||
String simpleName = this.getClass().getSimpleName();
|
||||
String className = Character.toLowerCase(simpleName.charAt(0)) + simpleName.substring(1);
|
||||
|
||||
SqlBuildParam sqlBuildParam = new SqlBuildParam();
|
||||
sqlBuildParam.setOrderField("id");
|
||||
sqlBuildParam.setTableName("cst_quartz");
|
||||
sqlBuildParam.setQueryColumns(Arrays.asList("id"));
|
||||
List<FormWhereCondition> conditions = new ArrayList<>();
|
||||
conditions.add(FormWhereCondition.build().value(className).fieldName("bean_id"));
|
||||
sqlBuildParam.setConditions(conditions);
|
||||
// 查询
|
||||
List<Map<String, Object>> cstquartzs = SystemTableExecutor.query(sqlBuildParam);
|
||||
Map<String,Object> cstquartz = cstquartzs.get(0);
|
||||
String cstquartzid = cstquartz.get("id").toString();
|
||||
|
||||
sqlBuildParam = new SqlBuildParam();
|
||||
sqlBuildParam.setOrderField("create_date");
|
||||
sqlBuildParam.setTableName("cst_quartz_log");
|
||||
sqlBuildParam.setQueryColumns(Arrays.asList("create_date","message"));
|
||||
sqlBuildParam.setSortType("desc");
|
||||
conditions = new ArrayList<>();
|
||||
conditions.add(FormWhereCondition.build().value(cstquartzid).fieldName("parentid"));
|
||||
sqlBuildParam.setConditions(conditions);
|
||||
// 查询日志
|
||||
List<Map<String, Object>> cstquartzlogs = SystemTableExecutor.query(sqlBuildParam);
|
||||
// 遍历所有日志信息,获取最新的返回结果为同步成功的时间
|
||||
String lastSuccessTime = null;
|
||||
for (Map<String, Object> logEntry : cstquartzlogs) {
|
||||
String message = logEntry.get("message") != null ? logEntry.get("message").toString() : "";
|
||||
if (allCountMatch(message)) {
|
||||
lastSuccessTime = logEntry.get("create_date") != null ? logEntry.get("create_date").toString() : null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
log.info("上次同步成功时间: {}", lastSuccessTime);
|
||||
|
||||
String startTime;
|
||||
if (lastSuccessTime != null && !lastSuccessTime.isEmpty()) {
|
||||
// 提取日期部分(前10位,格式:yyyy-MM-dd)
|
||||
String datePart = lastSuccessTime.substring(0, 10);
|
||||
startTime = datePart + " 00:00:00";
|
||||
} else {
|
||||
// 如果没有找到同步成功记录,默认使用1970-01-01作为开始时间
|
||||
startTime = "1970-01-01 00:00:00";
|
||||
}
|
||||
if(StringUtil.isNotBlank(p)){
|
||||
startTime = p;
|
||||
}
|
||||
// 设置接口调用结束时间:获取当前日期,拼接00:00:00
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currentDate = dateFormat.format(new java.util.Date());
|
||||
String endTime = currentDate + " 00:00:00";
|
||||
|
||||
log.info("接口调用开始时间: {}", startTime);
|
||||
log.info("接口调用结束时间: {}", endTime);
|
||||
|
||||
// 调用同步方法
|
||||
return u8WarehouseDataSyncService.synchronize(startTime,endTime);
|
||||
|
||||
} catch (Exception e) {
|
||||
String errorMsg = "U8仓库数据同步任务执行失败: " + e.getMessage();
|
||||
log.error(errorMsg, e);
|
||||
return errorMsg;
|
||||
} finally {
|
||||
log.info("========== U8仓库数据同步任务结束 ==========");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断所有同步记录的获取条数与保存条数是否全部一致
|
||||
* @param message 同步日志字符串
|
||||
* @return 全部相等返回true,存在不等返回false
|
||||
*/
|
||||
public static boolean allCountMatch(String message) {
|
||||
|
||||
Pattern pattern = Pattern.compile("获取.*?条数:(\\d+).*?保存数据条数:(\\d+)");
|
||||
|
||||
if (message == null || message.trim().length() == 0) {
|
||||
return false;
|
||||
}
|
||||
// 分割每一条同步记录
|
||||
String[] lines = message.split(";");
|
||||
for (String line : lines) {
|
||||
String trimLine = line.trim();
|
||||
if (trimLine.isEmpty()) continue;
|
||||
|
||||
Matcher matcher = pattern.matcher(trimLine);
|
||||
if (!matcher.find()) {
|
||||
// 该行未匹配到条数,格式异常,判定不一致
|
||||
return false;
|
||||
}
|
||||
int getCount = Integer.parseInt(matcher.group(1));
|
||||
int saveCount = Integer.parseInt(matcher.group(2));
|
||||
if (getCount != saveCount) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,943 @@
|
||||
package com.seeyon.apps.src_reportDataSync.service;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_reportDataSync.constants.U8DataSyncConstants;
|
||||
import com.seeyon.apps.src_reportDataSync.dao.U8cSyncDao;
|
||||
import com.seeyon.apps.src_reportDataSync.po.*;
|
||||
import com.seeyon.apps.src_reportDataSync.util.BigDecimalUtil;
|
||||
import com.seeyon.apps.src_reportDataSync.util.U8CHttpClient;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class U8WarehouseDataSyncService {
|
||||
|
||||
private static final Log log = Log.get(U8WarehouseDataSyncService.class);
|
||||
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Inject
|
||||
private U8cSyncDao u8cSyncDao;
|
||||
|
||||
public String getPluginId() {return U8DataSyncConstants.getPluginId();}
|
||||
|
||||
public ConfigVo getU8WarehouseDataSyncConfig() {return cstConfigApi.getConfig(getPluginId());}
|
||||
|
||||
|
||||
public String synchronize(String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String ipcorp = configVo.getParamVal(U8DataSyncConstants.ipcorp.name());
|
||||
StringBuffer res = new StringBuffer();
|
||||
|
||||
// 1. 同步现存量数据
|
||||
try {
|
||||
String icOnhandQuery = configVo.getParamVal(U8DataSyncConstants.icOnhandQuery.name());
|
||||
List<OnhandPo> onhandList = synchronizeOnhandAll(ipcorp+icOnhandQuery, "1000");
|
||||
log.info("======>同步U8C现存量数据完成,获取数据条数:{}", onhandList.size());
|
||||
if (onhandList != null && !onhandList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.onhandBatchSaveOrUpdate(onhandList);
|
||||
log.info("======>保存U8C现存量数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取现存量数据条数:").append(onhandList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步现存量数据异常", e);
|
||||
res.append("同步现存量数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
// 2. 同步材料出库单数据
|
||||
try {
|
||||
String icMaterialoutQuery = configVo.getParamVal(U8DataSyncConstants.icMaterialoutQuery.name());
|
||||
List<MaterialoutPo> materialoutList = synchronizeMaterialoutAll(ipcorp+icMaterialoutQuery, startTime, endTime);
|
||||
log.info("======>同步U8C库存材料出库单数据完成,获取数据条数:{}", materialoutList.size());
|
||||
if (materialoutList != null && !materialoutList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.materialoutSaveOrUpdate(materialoutList);
|
||||
log.info("======>保存U8C库存材料出库单数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取库存材料出库单数据条数:").append(materialoutList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步材料出库单数据异常", e);
|
||||
res.append("同步材料出库单数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
// 3. 同步采购入库单数据
|
||||
try {
|
||||
String icPurchaseinQuery = configVo.getParamVal(U8DataSyncConstants.icPurchaseinQuery.name());
|
||||
List<PurchaseinPo> purchaseinList = synchronizePurchaseinAll(ipcorp+icPurchaseinQuery, startTime, endTime);
|
||||
log.info("======>同步U8C库存采购入库单数据完成,获取数据条数:{}", purchaseinList.size());
|
||||
if (purchaseinList != null && !purchaseinList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.purchaseinSaveOrUpdate(purchaseinList);
|
||||
log.info("======>保存U8C库存采购入库单数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取库存采购入库单数据条数:").append(purchaseinList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步采购入库单数据异常", e);
|
||||
res.append("同步采购入库单数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
// 4. 同步产成品入库单数据
|
||||
try {
|
||||
String icProductinQuery = configVo.getParamVal(U8DataSyncConstants.icProductinQuery.name());
|
||||
List<ProductinPo> productinList = synchronizeProductinAll(ipcorp+icProductinQuery, startTime, endTime);
|
||||
log.info("======>同步U8C库存产成品入库单数据完成,获取数据条数:{}", productinList.size());
|
||||
if (productinList != null && !productinList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.productinSaveOrUpdate(productinList);
|
||||
log.info("======>保存U8C产成品入库单数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取库存产成品入库单数据条数:").append(productinList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步产成品入库单数据异常", e);
|
||||
res.append("同步产成品入库单数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
// 5. 同步其他入库单数据
|
||||
try {
|
||||
String icOtherinQuery = configVo.getParamVal(U8DataSyncConstants.icOtherinQuery.name());
|
||||
List<OtherinPo> otherinList = synchronizeOtherinAll(ipcorp+icOtherinQuery, startTime, endTime);
|
||||
log.info("======>同步U8C库存其他入库单数据完成,获取数据条数:{}", otherinList.size());
|
||||
if (otherinList != null && !otherinList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.otherinSaveOrUpdate(otherinList);
|
||||
log.info("======>保存U8C其他入库单数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取库存其他入库单数据条数:").append(otherinList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步其他入库单数据异常", e);
|
||||
res.append("同步其他入库单数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
// 6. 同步其他出库单数据
|
||||
try {
|
||||
String icOtheroutQuery = configVo.getParamVal(U8DataSyncConstants.icOtheroutQuery.name());
|
||||
List<OtheroutPo> otheroutList = synchronizeOtheroutAll(ipcorp+icOtheroutQuery, startTime, endTime);
|
||||
log.info("======>同步U8C库存其他出库单数据完成,获取数据条数:{}", otheroutList.size());
|
||||
if (otheroutList != null && !otheroutList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.otheroutSaveOrUpdate(otheroutList);
|
||||
log.info("======>保存U8C其他出库单数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取库存其他出库单数据条数:").append(otheroutList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步其他出库单数据异常", e);
|
||||
res.append("同步其他出库单数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
// 7. 同步销售出库单数据
|
||||
try {
|
||||
String icSaleoutQuery = configVo.getParamVal(U8DataSyncConstants.icSaleoutQuery.name());
|
||||
List<SaleoutPo> saleoutList = synchronizeSaleoutAll(ipcorp+icSaleoutQuery, startTime, endTime);
|
||||
log.info("======>同步U8C库存销售出库单数据完成,获取数据条数:{}", saleoutList.size());
|
||||
if (saleoutList != null && !saleoutList.isEmpty()) {
|
||||
int savedCount = u8cSyncDao.saleoutSaveOrUpdate(saleoutList);
|
||||
log.info("======>保存U8C销售出库单数据完成,保存数据条数:{}", savedCount);
|
||||
res.append("同步完成,获取库存销售出库单数据条数:").append(saleoutList.size()).append(",保存数据条数:").append(savedCount).append(";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("======>同步销售出库单数据异常", e);
|
||||
res.append("同步销售出库单数据失败:").append(e.getMessage()).append(";");
|
||||
}
|
||||
|
||||
return res.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动分页查询U8C现存量所有数据并合并
|
||||
* @param pagesize 每页最大数量
|
||||
* @return OnhandPo列表
|
||||
*/
|
||||
public List<OnhandPo> queryOnhandAllData(String pagesize) throws ParseException {
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String ipcorp = configVo.getParamVal(U8DataSyncConstants.ipcorp.name());
|
||||
String icOnhandQuery = configVo.getParamVal(U8DataSyncConstants.icOnhandQuery.name());
|
||||
return synchronizeOnhandAll(ipcorp + icOnhandQuery, pagesize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动分页查询并合并所有数据
|
||||
* @param url 请求地址
|
||||
* @param pagesize 每页最大数量
|
||||
* @return OnhandPo列表
|
||||
*/
|
||||
private List<OnhandPo> synchronizeOnhandAll(String url, String pagesize) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
int pageSize = Integer.parseInt(pagesize);
|
||||
int currentPage = 1;
|
||||
int totalCount = 0;
|
||||
|
||||
try {
|
||||
// 循环查询直到获取所有数据
|
||||
while (true) {
|
||||
JSONObject pageResult = doQueryOnhandPage(url, String.valueOf(currentPage), pagesize);
|
||||
if (!"200".equals(pageResult.getString("code"))) {
|
||||
log.error("======>查询U8C现存量数据失败:{}", pageResult.getString("msg"));
|
||||
return new ArrayList<>();
|
||||
}
|
||||
totalCount = pageResult.getIntValue("allcount");
|
||||
JSONArray datas = pageResult.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取第{}页数据,本页{}条,累计{}条", currentPage, datas.size(), allDatas.size());
|
||||
}
|
||||
// 判断是否已获取全部数据
|
||||
if (allDatas.size() >= totalCount || datas == null || datas.isEmpty() || datas.size() < pageSize) {
|
||||
break;
|
||||
}
|
||||
|
||||
currentPage++;
|
||||
}
|
||||
|
||||
log.info("======>查询U8C现存量数据完成,总数量:{}, 实际获取:{}", totalCount, allDatas.size());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C现存量数据失败", e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
// 转换为List<OnhandPo>
|
||||
return convertToOnhandPoList(allDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<OnhandPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<OnhandPo>
|
||||
*/
|
||||
private List<OnhandPo> convertToOnhandPoList(JSONArray datas) throws ParseException {
|
||||
List<OnhandPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
OnhandPo po = new OnhandPo();
|
||||
po.setPkCorp(obj.getString("pk_corp"));
|
||||
po.setCorpCode(obj.getString("corp_code"));
|
||||
po.setCorpName(obj.getString("corp_name"));
|
||||
po.setCcalbodyid(obj.getString("ccalbodyid"));
|
||||
po.setCcalbodyCode(obj.getString("ccalbody_code"));
|
||||
po.setCcalbodyName(obj.getString("ccalbody_name"));
|
||||
po.setCwarehouseid(obj.getString("cwarehouseid"));
|
||||
po.setCwarehouseCode(obj.getString("cwarehouse_code"));
|
||||
po.setCwarehouseName(obj.getString("cwarehouse_name"));
|
||||
po.setCinventoryid(obj.getString("cinventoryid"));
|
||||
po.setCinventoryCode(obj.getString("cinventory_code"));
|
||||
po.setCinventoryName(obj.getString("cinventory_name"));
|
||||
po.setInvspec(obj.getString("invspec"));
|
||||
po.setNnum(BigDecimalUtil.toBigDecimal(obj.get("nnum")));
|
||||
po.setNastnum(BigDecimalUtil.toBigDecimal(obj.get("nastnum")));
|
||||
po.setNfreezenum(BigDecimalUtil.toBigDecimal(obj.get("nfreezenum")));
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currentDate = dateFormat.format(new Date());
|
||||
po.setDataDate(dateFormat.parse(currentDate));
|
||||
list.add(po);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单页数据
|
||||
* @param url 请求地址
|
||||
* @param pagenow 当前页码
|
||||
* @param pagesize 每页最大数量
|
||||
* @return 单页查询结果
|
||||
*/
|
||||
private JSONObject doQueryOnhandPage(String url, String pagenow, String pagesize){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("warehouse","100");
|
||||
param.put("pagenow", pagenow);
|
||||
param.put("pagesize", pagesize);
|
||||
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("allcount", data.getString("allcount"));
|
||||
result.put("retcount", data.getString("retcount"));
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C现存量第{}页数据失败", pagenow, e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private List<MaterialoutPo> synchronizeMaterialoutAll(String url,String startTime,String endTime) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
JSONObject result = doQueryMaterialout(url,startTime,endTime);
|
||||
JSONArray datas = result.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取{}条", datas.size());
|
||||
}
|
||||
|
||||
// 转换为List<MaterialoutPo>
|
||||
return convertToMaterialoutPoList(allDatas);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询区间内数据
|
||||
* @param url 请求地址
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询结果
|
||||
*/
|
||||
private JSONObject doQueryMaterialout(String url, String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("date_begin",startTime);
|
||||
param.put("date_end", endTime);
|
||||
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C材料出库单数据失败", e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<MaterialoutPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<MaterialoutPo>
|
||||
*/
|
||||
private List<MaterialoutPo> convertToMaterialoutPoList(JSONArray datas) throws ParseException {
|
||||
List<MaterialoutPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
JSONObject parentvo = obj.getJSONObject("parentvo");
|
||||
MaterialoutPo po = new MaterialoutPo();
|
||||
po.setCgeneralhid(parentvo.getString("cgeneralhid"));
|
||||
po.setVbillcode(parentvo.getString("vbillcode"));
|
||||
po.setDbilldate(parentvo.getDate("dbilldate"));
|
||||
po.setPkCorp(parentvo.getString("pk_corp"));
|
||||
po.setCorpCode(parentvo.getString("corp_code"));
|
||||
po.setCorpName(parentvo.getString("corp_name"));
|
||||
po.setPkCalbody(parentvo.getString("pk_calbody"));
|
||||
po.setCalbodyCode(parentvo.getString("calbody_code"));
|
||||
po.setCalbodyName(parentvo.getString("calbody_name"));
|
||||
po.setCwarehouseid(parentvo.getString("cwarehouseid"));
|
||||
po.setCwarehouseidCode(parentvo.getString("cwarehouseid_code"));
|
||||
po.setCwarehouseidName(parentvo.getString("cwarehouseid_name"));
|
||||
po.setCdispatcherid(parentvo.getString("cdispatcherid"));
|
||||
po.setCdispatcheridCode(parentvo.getString("cdispatcherid_code"));
|
||||
po.setCdispatcheridName(parentvo.getString("cdispatcherid_name"));
|
||||
po.setCoperatorid(parentvo.getString("coperatorid"));
|
||||
po.setCoperatoridCode(parentvo.getString("coperatorid_code"));
|
||||
po.setCoperatoridName(parentvo.getString("coperatorid_name"));
|
||||
po.setCwhsmanagerid(parentvo.getString("cwhsmanagerid"));
|
||||
// 解析子表数据
|
||||
List<MaterialoutDetailPo> detailList = new ArrayList<>();
|
||||
JSONArray childrenvo = obj.getJSONArray("childrenvo");
|
||||
if (childrenvo != null && !childrenvo.isEmpty()) {
|
||||
for (int j = 0; j < childrenvo.size(); j++) {
|
||||
JSONObject detailObj = childrenvo.getJSONObject(j);
|
||||
MaterialoutDetailPo detail = new MaterialoutDetailPo();
|
||||
detail.setCgeneralbid(detailObj.getString("cgeneralbid"));
|
||||
detail.setCgeneralhid(parentvo.getString("cgeneralhid"));
|
||||
detail.setCinventoryid(detailObj.getString("cinventoryid"));
|
||||
detail.setCinventoryidCode(detailObj.getString("cinventoryid_code"));
|
||||
detail.setCinventoryidName(detailObj.getString("cinventoryid_name"));
|
||||
detail.setInvspec(detailObj.getString("invspec"));
|
||||
detail.setNoutnum(BigDecimalUtil.toBigDecimal(detailObj.get("noutnum")));
|
||||
detail.setCrowno(detailObj.getString("crowno"));
|
||||
detail.setPkMeasdoc(detailObj.getString("pk_measdoc"));
|
||||
detail.setPkMeasdocCode(detailObj.getString("pk_measdoc_code"));
|
||||
detail.setPkMeasdocName(detailObj.getString("pk_measdoc_name"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
}
|
||||
po.setChildrenvo(detailList);
|
||||
|
||||
list.add(po);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
private List<PurchaseinPo> synchronizePurchaseinAll(String url, String startTime, String endTime) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
JSONObject result = doQueryPurchasein(url,startTime,endTime);
|
||||
JSONArray datas = result.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取{}条", datas.size());
|
||||
}
|
||||
// 转换为List<PurchaseinPo>
|
||||
return convertToPurchaseinPoList(allDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区间内数据
|
||||
* @param url 请求地址
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询结果
|
||||
*/
|
||||
private JSONObject doQueryPurchasein(String url, String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("date_begin",startTime);
|
||||
param.put("date_end", endTime);
|
||||
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C采购入库单数据失败", e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<PurchaseinPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<PurchaseinPo>
|
||||
*/
|
||||
private List<PurchaseinPo> convertToPurchaseinPoList(JSONArray datas) throws ParseException {
|
||||
List<PurchaseinPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
JSONObject parentvo = obj.getJSONObject("parentvo");
|
||||
PurchaseinPo po = new PurchaseinPo();
|
||||
|
||||
po.setCauditorid(parentvo.getString("cauditorid"));
|
||||
po.setAuditorCode(parentvo.getString("auditor_code"));
|
||||
po.setAuditorName(parentvo.getString("auditor_name"));
|
||||
po.setPkCalbody(parentvo.getString("pk_calbody"));
|
||||
po.setCalbodyCode(parentvo.getString("calbody_code"));
|
||||
po.setCalbodyName(parentvo.getString("calbody_name"));
|
||||
po.setCoperatorid(parentvo.getString("coperatorid"));
|
||||
po.setOperatorCode(parentvo.getString("operator_code"));
|
||||
po.setOperatorName(parentvo.getString("operator_name"));
|
||||
po.setCregister(parentvo.getString("cregister"));
|
||||
po.setRegisterCode(parentvo.getString("register_code"));
|
||||
po.setRegisterName(parentvo.getString("register_name"));
|
||||
po.setVbillcode(parentvo.getString("vbillcode"));
|
||||
po.setDbilldate(parentvo.getDate("dbilldate"));
|
||||
po.setCwarehouseid(parentvo.getString("cwarehouseid"));
|
||||
po.setWarehouseidCode(parentvo.getString("warehouseid_code"));
|
||||
po.setWarehouseidName(parentvo.getString("warehouseid_name"));
|
||||
po.setCproviderid(parentvo.getString("cproviderid"));
|
||||
po.setProviderCode(parentvo.getString("provider_code"));
|
||||
po.setProviderName(parentvo.getString("provider_name"));
|
||||
po.setDr(parentvo.getString("dr"));
|
||||
// 解析子表数据
|
||||
List<PurchaseinDetailPo> detailList = new ArrayList<>();
|
||||
JSONArray childrenvo = obj.getJSONArray("childrenvo");
|
||||
if (childrenvo != null && !childrenvo.isEmpty()) {
|
||||
for (int j = 0; j < childrenvo.size(); j++) {
|
||||
JSONObject detailObj = childrenvo.getJSONObject(j);
|
||||
PurchaseinDetailPo detail = new PurchaseinDetailPo();
|
||||
detail.setVbillcode(detailObj.getString("vbillcode"));
|
||||
detail.setCinventoryid(detailObj.getString("cinventoryid"));
|
||||
detail.setInventoryCode(detailObj.getString("inventory_code"));
|
||||
detail.setInventoryName(detailObj.getString("inventory_name"));
|
||||
detail.setInvspec(detailObj.getString("invspec"));
|
||||
detail.setInvtype(detailObj.getString("invtype"));
|
||||
detail.setNinnum(BigDecimalUtil.toBigDecimal(obj.get("ninnum")));
|
||||
detail.setNprice(BigDecimalUtil.toBigDecimal(obj.get("nprice")));
|
||||
detail.setNquotentmny(BigDecimalUtil.toBigDecimal(obj.get("nquotentmny")));
|
||||
detail.setNtaxprice(BigDecimalUtil.toBigDecimal(obj.get("ntaxprice")));
|
||||
detail.setNtaxmny(BigDecimalUtil.toBigDecimal(obj.get("ntaxmny")));
|
||||
detail.setVbatchcode(detailObj.getString("vbatchcode"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
}
|
||||
po.setChildrenvo(detailList);
|
||||
|
||||
list.add(po);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<ProductinPo> synchronizeProductinAll(String url, String startTime, String endTime) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
JSONObject result = doQueryProductin(url,startTime,endTime);
|
||||
JSONArray datas = result.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取{}条", datas.size());
|
||||
}
|
||||
// 转换为List<ProductinPo>
|
||||
return convertToProductinPoList(allDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区间内数据
|
||||
* @param url 请求地址
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询结果
|
||||
*/
|
||||
private JSONObject doQueryProductin(String url, String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("date_begin",startTime);
|
||||
param.put("date_end", endTime);
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C采购入库单数据失败", e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<ProductinPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<ProductinPo>
|
||||
*/
|
||||
private List<ProductinPo> convertToProductinPoList(JSONArray datas) throws ParseException {
|
||||
List<ProductinPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
JSONObject parentvo = obj.getJSONObject("parentvo");
|
||||
ProductinPo po = new ProductinPo();
|
||||
po.setCauditorid(parentvo.getString("cauditorid"));
|
||||
po.setAuditorCode(parentvo.getString("auditor_code"));
|
||||
po.setAuditorName(parentvo.getString("auditor_name"));
|
||||
po.setPkCalbody(parentvo.getString("pk_calbody"));
|
||||
po.setCalbodyCode(parentvo.getString("calbody_code"));
|
||||
po.setCalbodyName(parentvo.getString("calbody_name"));
|
||||
po.setCoperatorid(parentvo.getString("coperatorid"));
|
||||
po.setOperatorCode(parentvo.getString("operator_code"));
|
||||
po.setOperatorName(parentvo.getString("operator_name"));
|
||||
po.setCregister(parentvo.getString("cregister"));
|
||||
po.setRegisterCode(parentvo.getString("register_code"));
|
||||
po.setRegisterName(parentvo.getString("register_name"));
|
||||
po.setVbillcode(parentvo.getString("vbillcode"));
|
||||
po.setDbilldate(parentvo.getDate("dbilldate"));
|
||||
po.setCwarehouseid(parentvo.getString("cwarehouseid"));
|
||||
po.setWarehouseidCode(parentvo.getString("warehouseid_code"));
|
||||
po.setWarehouseidName(parentvo.getString("warehouseid_name"));
|
||||
po.setDr(parentvo.getString("dr"));
|
||||
// 解析子表数据
|
||||
List<ProductinDetailPo> detailList = new ArrayList<>();
|
||||
JSONArray childrenvo = obj.getJSONArray("childrenvo");
|
||||
if (childrenvo != null && !childrenvo.isEmpty()) {
|
||||
for (int j = 0; j < childrenvo.size(); j++) {
|
||||
JSONObject detailObj = childrenvo.getJSONObject(j);
|
||||
ProductinDetailPo detail = new ProductinDetailPo();
|
||||
detail.setVbillcode(detailObj.getString("vbillcode"));
|
||||
detail.setInventoryCode(detailObj.getString("inventory_code"));
|
||||
detail.setInventoryName(detailObj.getString("inventory_name"));
|
||||
detail.setNinnum(BigDecimalUtil.toBigDecimal(obj.get("ninnum")));
|
||||
detail.setNmny(BigDecimalUtil.toBigDecimal(obj.get("nmny")));
|
||||
detail.setVbatchcode(detailObj.getString("vbatchcode"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
}
|
||||
po.setChildrenvo(detailList);
|
||||
|
||||
list.add(po);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private List<OtherinPo> synchronizeOtherinAll(String url, String startTime, String endTime) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
JSONObject result = doQueryOtherin(url,startTime,endTime);
|
||||
JSONArray datas = result.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取{}条", datas.size());
|
||||
}
|
||||
// 转换为List<OtherinPo>
|
||||
return convertToOtherinPoList(allDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区间内数据
|
||||
* @param url 请求地址
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询结果
|
||||
*/
|
||||
private JSONObject doQueryOtherin(String url, String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("date_begin",startTime);
|
||||
param.put("date_end", endTime);
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C其他入库单数据失败", e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<OtherinPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<OtherinPo>
|
||||
*/
|
||||
private List<OtherinPo> convertToOtherinPoList(JSONArray datas) throws ParseException {
|
||||
List<OtherinPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
JSONObject parentvo = obj.getJSONObject("parentvo");
|
||||
OtherinPo po = new OtherinPo();
|
||||
po.setCauditorid(parentvo.getString("cauditorid"));
|
||||
po.setAuditorCode(parentvo.getString("auditor_code"));
|
||||
po.setAuditorName(parentvo.getString("auditor_name"));
|
||||
po.setPkCalbody(parentvo.getString("pk_calbody"));
|
||||
po.setCalbodyCode(parentvo.getString("calbody_code"));
|
||||
po.setCalbodyName(parentvo.getString("calbody_name"));
|
||||
po.setCoperatorid(parentvo.getString("coperatorid"));
|
||||
po.setOperatorCode(parentvo.getString("operator_code"));
|
||||
po.setOperatorName(parentvo.getString("operator_name"));
|
||||
po.setCregister(parentvo.getString("cregister"));
|
||||
po.setRegisterCode(parentvo.getString("register_code"));
|
||||
po.setRegisterName(parentvo.getString("register_name"));
|
||||
po.setVbillcode(parentvo.getString("vbillcode"));
|
||||
po.setDbilldate(parentvo.getDate("dbilldate"));
|
||||
po.setCwarehouseid(parentvo.getString("cwarehouseid"));
|
||||
po.setWarehouseidCode(parentvo.getString("warehouseid_code"));
|
||||
po.setWarehouseidName(parentvo.getString("warehouseid_name"));
|
||||
po.setDr(parentvo.getString("dr"));
|
||||
// 解析子表数据
|
||||
List<OtherinDetailPo> detailList = new ArrayList<>();
|
||||
JSONArray childrenvo = obj.getJSONArray("childrenvo");
|
||||
if (childrenvo != null && !childrenvo.isEmpty()) {
|
||||
for (int j = 0; j < childrenvo.size(); j++) {
|
||||
JSONObject detailObj = childrenvo.getJSONObject(j);
|
||||
OtherinDetailPo detail = new OtherinDetailPo();
|
||||
detail.setVbillcode(detailObj.getString("vbillcode"));
|
||||
detail.setInventoryCode(detailObj.getString("inventory_code"));
|
||||
detail.setInventoryName(detailObj.getString("inventory_name"));
|
||||
detail.setNinnum(BigDecimalUtil.toBigDecimal(obj.get("ninnum")));
|
||||
detail.setNmny(BigDecimalUtil.toBigDecimal(obj.get("nmny")));
|
||||
detail.setVbatchcode(detailObj.getString("vbatchcode"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
}
|
||||
po.setChildrenvo(detailList);
|
||||
list.add(po);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
private List<OtheroutPo> synchronizeOtheroutAll(String url, String startTime, String endTime) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
JSONObject result = doQueryOtherout(url,startTime,endTime);
|
||||
JSONArray datas = result.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取{}条", datas.size());
|
||||
}
|
||||
// 转换为List<OtheroutPo>
|
||||
return convertToOtheroutPoList(allDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区间内数据
|
||||
* @param url 请求地址
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询结果
|
||||
*/
|
||||
private JSONObject doQueryOtherout(String url, String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("date_begin",startTime);
|
||||
param.put("date_end", endTime);
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C其他入库单数据失败", e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<OtheroutPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<OtheroutPo>
|
||||
*/
|
||||
private List<OtheroutPo> convertToOtheroutPoList(JSONArray datas) throws ParseException {
|
||||
List<OtheroutPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
JSONObject parentvo = obj.getJSONObject("parentvo");
|
||||
OtheroutPo po = new OtheroutPo();
|
||||
po.setCauditorid(parentvo.getString("cauditorid"));
|
||||
po.setAuditorCode(parentvo.getString("auditor_code"));
|
||||
po.setAuditorName(parentvo.getString("auditor_name"));
|
||||
po.setPkCalbody(parentvo.getString("pk_calbody"));
|
||||
po.setCalbodyCode(parentvo.getString("calbody_code"));
|
||||
po.setCalbodyName(parentvo.getString("calbody_name"));
|
||||
po.setCoperatorid(parentvo.getString("coperatorid"));
|
||||
po.setOperatorCode(parentvo.getString("operator_code"));
|
||||
po.setOperatorName(parentvo.getString("operator_name"));
|
||||
po.setCregister(parentvo.getString("cregister"));
|
||||
po.setRegisterCode(parentvo.getString("register_code"));
|
||||
po.setRegisterName(parentvo.getString("register_name"));
|
||||
po.setVbillcode(parentvo.getString("vbillcode"));
|
||||
po.setDbilldate(parentvo.getDate("dbilldate"));
|
||||
po.setCwarehouseid(parentvo.getString("cwarehouseid"));
|
||||
po.setWarehouseidCode(parentvo.getString("warehouseid_code"));
|
||||
po.setWarehouseidName(parentvo.getString("warehouseid_name"));
|
||||
po.setDr(parentvo.getString("dr"));
|
||||
// 解析子表数据
|
||||
List<OtheroutDetailPo> detailList = new ArrayList<>();
|
||||
JSONArray childrenvo = obj.getJSONArray("childrenvo");
|
||||
if (childrenvo != null && !childrenvo.isEmpty()) {
|
||||
for (int j = 0; j < childrenvo.size(); j++) {
|
||||
JSONObject detailObj = childrenvo.getJSONObject(j);
|
||||
OtheroutDetailPo detail = new OtheroutDetailPo();
|
||||
detail.setVbillcode(detailObj.getString("vbillcode"));
|
||||
detail.setInventoryCode(detailObj.getString("inventory_code"));
|
||||
detail.setInventoryName(detailObj.getString("inventory_name"));
|
||||
detail.setNinnum(BigDecimalUtil.toBigDecimal(obj.get("ninnum")));
|
||||
detail.setNmny(BigDecimalUtil.toBigDecimal(obj.get("nmny")));
|
||||
detail.setVbatchcode(detailObj.getString("vbatchcode"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
}
|
||||
po.setChildrenvo(detailList);
|
||||
list.add(po);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
private List<SaleoutPo> synchronizeSaleoutAll(String url, String startTime, String endTime) throws ParseException {
|
||||
JSONArray allDatas = new JSONArray();
|
||||
JSONObject result = doQuerySaleout(url,startTime,endTime);
|
||||
JSONArray datas = result.getJSONArray("datas");
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
allDatas.addAll(datas);
|
||||
log.info("======>已获取{}条", datas.size());
|
||||
}
|
||||
// 转换为List<SaleoutPo>
|
||||
return convertToSaleoutPoList(allDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区间内数据
|
||||
* @param url 请求地址
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询结果
|
||||
*/
|
||||
private JSONObject doQuerySaleout(String url, String startTime,String endTime){
|
||||
ConfigVo configVo = getU8WarehouseDataSyncConfig();
|
||||
String calbody = configVo.getParamVal(U8DataSyncConstants.calbody.name());
|
||||
String corp = configVo.getParamVal(U8DataSyncConstants.corp.name());
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("calbody",calbody);
|
||||
param.put("corp",corp);
|
||||
param.put("date_begin",startTime);
|
||||
param.put("date_end", endTime);
|
||||
try {
|
||||
String res = U8CHttpClient.doPost(url, param.toString());
|
||||
JSONObject resjson = JSONObject.parseObject(res);
|
||||
String status = resjson.getString("status");
|
||||
if("success".equals(status)){
|
||||
JSONObject data = resjson.getJSONObject("data");
|
||||
result.put("code", "200");
|
||||
result.put("datas", data.getJSONArray("datas"));
|
||||
}else{
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + resjson);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询U8C销售出库单数据失败", e);
|
||||
result.put("code", "500");
|
||||
result.put("msg", "查询失败,错误信息为:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将JSONArray转换为List<SaleoutPo>
|
||||
* @param datas JSONArray数据
|
||||
* @return List<SaleoutPo>
|
||||
*/
|
||||
private List<SaleoutPo> convertToSaleoutPoList(JSONArray datas) throws ParseException {
|
||||
List<SaleoutPo> list = new ArrayList<>();
|
||||
if (datas == null || datas.isEmpty()) {
|
||||
return list;
|
||||
}
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject obj = datas.getJSONObject(i);
|
||||
JSONObject parentvo = obj.getJSONObject("parentvo");
|
||||
SaleoutPo po = new SaleoutPo();
|
||||
po.setCauditorid(parentvo.getString("cauditorid"));
|
||||
po.setAuditorCode(parentvo.getString("auditor_code"));
|
||||
po.setAuditorName(parentvo.getString("auditor_name"));
|
||||
po.setPkCalbody(parentvo.getString("pk_calbody"));
|
||||
po.setCalbodyCode(parentvo.getString("calbody_code"));
|
||||
po.setCalbodyName(parentvo.getString("calbody_name"));
|
||||
po.setCoperatorid(parentvo.getString("coperatorid"));
|
||||
po.setOperatorCode(parentvo.getString("operator_code"));
|
||||
po.setOperatorName(parentvo.getString("operator_name"));
|
||||
po.setCregister(parentvo.getString("cregister"));
|
||||
po.setRegisterCode(parentvo.getString("register_code"));
|
||||
po.setRegisterName(parentvo.getString("register_name"));
|
||||
po.setVbillcode(parentvo.getString("vbillcode"));
|
||||
po.setDbilldate(parentvo.getDate("dbilldate"));
|
||||
po.setCwarehouseid(parentvo.getString("cwarehouseid"));
|
||||
po.setWarehouseidCode(parentvo.getString("warehouseid_code"));
|
||||
po.setWarehouseidName(parentvo.getString("warehouseid_name"));
|
||||
po.setDr(parentvo.getString("dr"));
|
||||
// 解析子表数据
|
||||
List<SaleoutDetailPo> detailList = new ArrayList<>();
|
||||
JSONArray childrenvo = obj.getJSONArray("childrenvo");
|
||||
if (childrenvo != null && !childrenvo.isEmpty()) {
|
||||
for (int j = 0; j < childrenvo.size(); j++) {
|
||||
JSONObject detailObj = childrenvo.getJSONObject(j);
|
||||
SaleoutDetailPo detail = new SaleoutDetailPo();
|
||||
detail.setVbillcode(detailObj.getString("vbillcode"));
|
||||
detail.setInventoryCode(detailObj.getString("inventory_code"));
|
||||
detail.setInventoryName(detailObj.getString("inventory_name"));
|
||||
detail.setNinnum(BigDecimalUtil.toBigDecimal(obj.get("ninnum")));
|
||||
detail.setNmny(BigDecimalUtil.toBigDecimal(obj.get("nmny")));
|
||||
detail.setVbatchcode(detailObj.getString("vbatchcode"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
}
|
||||
po.setChildrenvo(detailList);
|
||||
list.add(po);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.src_reportDataSync.util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class BigDecimalUtil {
|
||||
/**
|
||||
* Object 转为 BigDecimal,null返回BigDecimal.ZERO
|
||||
*/
|
||||
public static BigDecimal toBigDecimal(Object obj) {
|
||||
if (obj == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (obj instanceof BigDecimal) {
|
||||
return (BigDecimal) obj;
|
||||
}
|
||||
if (obj instanceof BigInteger) {
|
||||
return new BigDecimal((BigInteger) obj);
|
||||
}
|
||||
if (obj instanceof Number) {
|
||||
// Integer/Long/Double/Float/Short/Byte
|
||||
return BigDecimal.valueOf(((Number) obj).doubleValue());
|
||||
}
|
||||
// 字符串、其他对象转字符串再解析
|
||||
String str = obj.toString().trim();
|
||||
if (str.isEmpty()) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return new BigDecimal(str);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.seeyon.apps.src_reportDataSync.util;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.aicloud.common.JsonUtils;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
import com.seeyon.utils.form.SqlBuildParam;
|
||||
import com.seeyon.utils.form.SqlGenerator;
|
||||
import com.seeyon.utils.form.SqlType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SystemTableExecutor {
|
||||
|
||||
private static final Log log = Log.get(SystemTableExecutor.class);
|
||||
|
||||
public static List<Map<String, Object>> query(SqlBuildParam sqlBuildParam) {
|
||||
sqlBuildParam.setSqlType(SqlType.SELECT);
|
||||
Map<String, Object> result = SqlGenerator.generateSql(sqlBuildParam);
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
String sql = (String) result.get("sql");
|
||||
List<Object> params = (List<Object>) result.get("params");
|
||||
agent.execute(sql, params);
|
||||
log.info("执行sql为: " + sql);
|
||||
log.info("执行sql参数为: " + JsonUtils.toJSONString(params));
|
||||
List<Map<String, Object>> rows = agent.resultSetToList();
|
||||
|
||||
// 如果设置了查询列,则只返回指定列的数据
|
||||
List<String> queryColumns = sqlBuildParam.getQueryColumns();
|
||||
if (queryColumns != null && !queryColumns.isEmpty() && rows != null && !rows.isEmpty()) {
|
||||
List<Map<String, Object>> filteredRows = new ArrayList<>();
|
||||
for (Map<String, Object> row : rows) {
|
||||
Map<String, Object> filteredRow = new java.util.LinkedHashMap<>();
|
||||
for (String col : queryColumns) {
|
||||
if (row.containsKey(col)) {
|
||||
filteredRow.put(col, row.get(col));
|
||||
}
|
||||
}
|
||||
filteredRows.add(filteredRow);
|
||||
}
|
||||
return filteredRows;
|
||||
}
|
||||
return rows != null ? rows : new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error("执行sql为: " + result.get("sql"));
|
||||
log.error("执行sql参数为: " + JsonUtils.toJSONString(result.get("params")));
|
||||
log.error(e.getMessage(), e);
|
||||
} finally {
|
||||
agent.close();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.src_reportDataSync.util;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
|
||||
public class U8CHttpClient {
|
||||
|
||||
|
||||
private static final String CONTENT_TYPE = "application/json";
|
||||
private static final String SYSTEM_NAME = "ZQCOA";
|
||||
private static final String USER = "OA";
|
||||
private static final String CONNECTION = "Keep-Alive";
|
||||
private static final String PASSWORD_MD5 = "0411fd12d05765c3019657ae66358733";
|
||||
|
||||
private U8CHttpClient() {
|
||||
|
||||
}
|
||||
|
||||
public static String doPost(String url, String body) throws Exception {
|
||||
|
||||
return HttpRequest.post(url).header("accept", "*/*")
|
||||
.header("connection", CONNECTION)
|
||||
.header("Content-Type", CONTENT_TYPE)
|
||||
.header("system", SYSTEM_NAME)
|
||||
.header("usercode", USER)
|
||||
.header("password", PASSWORD_MD5)
|
||||
.body(body).execute().body();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_reportDataSync</id>
|
||||
<name>U8数据定时同步开发</name>
|
||||
<category>20260715</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="u8cSyncDao" class="com.seeyon.apps.src_reportDataSync.dao.U8cSyncDao" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="u8WarehouseDataSyncQuartz" class="com.seeyon.apps.src_reportDataSync.quartz.U8WarehouseDataSyncQuartz" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="u8WarehouseDataSyncService" class="com.seeyon.apps.src_reportDataSync.service.U8WarehouseDataSyncService" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user