优化插件性能
This commit is contained in:
parent
3cad1b92db
commit
480cefba68
|
@ -0,0 +1,22 @@
|
|||
package com.hzya.frame.plugin.lets.dao;
|
||||
|
||||
import com.hzya.frame.plugin.lets.entity.BdBomEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (BD_BOM: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-02 14:56:24
|
||||
*/
|
||||
public interface IBdBomDao extends IBaseDao<BdBomEntity, String> {
|
||||
/**
|
||||
* 查询BOM版本
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
List<BdBomEntity> queryBomVersion(BdBomEntity bdBomEntity) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.hzya.frame.plugin.lets.dao.impl;
|
||||
|
||||
import com.hzya.frame.plugin.lets.entity.BdBomEntity;
|
||||
import com.hzya.frame.plugin.lets.dao.IBdBomDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (BdBom)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-02 14:56:24
|
||||
*/
|
||||
public class BdBomDaoImpl extends MybatisGenericDao<BdBomEntity, String> implements IBdBomDao {
|
||||
@Override
|
||||
public List<BdBomEntity> queryBomVersion(BdBomEntity bdBomEntity) throws Exception {
|
||||
return query("com.hzya.frame.plugin.lets.dao.impl.BdBomDaoImpl.queryBomVersion", bdBomEntity);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,610 @@
|
|||
package com.hzya.frame.plugin.lets.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* (BdBom)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-02 14:57:03
|
||||
*/
|
||||
public class BdBomEntity extends BaseEntity {
|
||||
|
||||
private String bblx;
|
||||
private String bomlx;
|
||||
private String clf;
|
||||
private String creat;
|
||||
private String dr;
|
||||
private String fsl;
|
||||
private String fslsx;
|
||||
private String fslxx;
|
||||
private String gcbm;
|
||||
private String gdfsl;
|
||||
private String gdsl;
|
||||
private String hsl;
|
||||
private String jldwid;
|
||||
private String memo;
|
||||
private String mver;
|
||||
private String pkBomid;
|
||||
private String pkCorp;
|
||||
private String pkProduce;
|
||||
private String rgf;
|
||||
private String sfmr;
|
||||
private String sftpmr;
|
||||
private String sl;
|
||||
private String slsx;
|
||||
private String slxx;
|
||||
private String ts;
|
||||
private String version;
|
||||
private String wlbmid;
|
||||
private String zdy1;
|
||||
private String zdy10;
|
||||
private String zdy11;
|
||||
private String zdy12;
|
||||
private String zdy13;
|
||||
private String zdy14;
|
||||
private String zdy15;
|
||||
private String zdy16;
|
||||
private String zdy17;
|
||||
private String zdy18;
|
||||
private String zdy19;
|
||||
private String zdy2;
|
||||
private String zdy20;
|
||||
private String zdy3;
|
||||
private String zdy4;
|
||||
private String zdy5;
|
||||
private String zdy6;
|
||||
private String zdy7;
|
||||
private String zdy8;
|
||||
private String zdy9;
|
||||
private String zt;
|
||||
private String zyx1;
|
||||
private String zyx2;
|
||||
private String zyx3;
|
||||
private String zyx4;
|
||||
private String zyx5;
|
||||
private String zzf;
|
||||
private String bomtypeFrom;
|
||||
private String cjrq;
|
||||
private String cjsj;
|
||||
private String createtype;
|
||||
private String gcbmFrom;
|
||||
private String modifiedtime;
|
||||
private String modifier;
|
||||
private String pkBomidFrom;
|
||||
private String pkCorpFrom;
|
||||
private String qrrid;
|
||||
private String qrrq;
|
||||
private String qrsj;
|
||||
|
||||
|
||||
public String getBblx() {
|
||||
return bblx;
|
||||
}
|
||||
|
||||
public void setBblx(String bblx) {
|
||||
this.bblx = bblx;
|
||||
}
|
||||
|
||||
public String getBomlx() {
|
||||
return bomlx;
|
||||
}
|
||||
|
||||
public void setBomlx(String bomlx) {
|
||||
this.bomlx = bomlx;
|
||||
}
|
||||
|
||||
public String getClf() {
|
||||
return clf;
|
||||
}
|
||||
|
||||
public void setClf(String clf) {
|
||||
this.clf = clf;
|
||||
}
|
||||
|
||||
public String getCreat() {
|
||||
return creat;
|
||||
}
|
||||
|
||||
public void setCreat(String creat) {
|
||||
this.creat = creat;
|
||||
}
|
||||
|
||||
public String getDr() {
|
||||
return dr;
|
||||
}
|
||||
|
||||
public void setDr(String dr) {
|
||||
this.dr = dr;
|
||||
}
|
||||
|
||||
public String getFsl() {
|
||||
return fsl;
|
||||
}
|
||||
|
||||
public void setFsl(String fsl) {
|
||||
this.fsl = fsl;
|
||||
}
|
||||
|
||||
public String getFslsx() {
|
||||
return fslsx;
|
||||
}
|
||||
|
||||
public void setFslsx(String fslsx) {
|
||||
this.fslsx = fslsx;
|
||||
}
|
||||
|
||||
public String getFslxx() {
|
||||
return fslxx;
|
||||
}
|
||||
|
||||
public void setFslxx(String fslxx) {
|
||||
this.fslxx = fslxx;
|
||||
}
|
||||
|
||||
public String getGcbm() {
|
||||
return gcbm;
|
||||
}
|
||||
|
||||
public void setGcbm(String gcbm) {
|
||||
this.gcbm = gcbm;
|
||||
}
|
||||
|
||||
public String getGdfsl() {
|
||||
return gdfsl;
|
||||
}
|
||||
|
||||
public void setGdfsl(String gdfsl) {
|
||||
this.gdfsl = gdfsl;
|
||||
}
|
||||
|
||||
public String getGdsl() {
|
||||
return gdsl;
|
||||
}
|
||||
|
||||
public void setGdsl(String gdsl) {
|
||||
this.gdsl = gdsl;
|
||||
}
|
||||
|
||||
public String getHsl() {
|
||||
return hsl;
|
||||
}
|
||||
|
||||
public void setHsl(String hsl) {
|
||||
this.hsl = hsl;
|
||||
}
|
||||
|
||||
public String getJldwid() {
|
||||
return jldwid;
|
||||
}
|
||||
|
||||
public void setJldwid(String jldwid) {
|
||||
this.jldwid = jldwid;
|
||||
}
|
||||
|
||||
public String getMemo() {
|
||||
return memo;
|
||||
}
|
||||
|
||||
public void setMemo(String memo) {
|
||||
this.memo = memo;
|
||||
}
|
||||
|
||||
public String getMver() {
|
||||
return mver;
|
||||
}
|
||||
|
||||
public void setMver(String mver) {
|
||||
this.mver = mver;
|
||||
}
|
||||
|
||||
public String getPkBomid() {
|
||||
return pkBomid;
|
||||
}
|
||||
|
||||
public void setPkBomid(String pkBomid) {
|
||||
this.pkBomid = pkBomid;
|
||||
}
|
||||
|
||||
public String getPkCorp() {
|
||||
return pkCorp;
|
||||
}
|
||||
|
||||
public void setPkCorp(String pkCorp) {
|
||||
this.pkCorp = pkCorp;
|
||||
}
|
||||
|
||||
public String getPkProduce() {
|
||||
return pkProduce;
|
||||
}
|
||||
|
||||
public void setPkProduce(String pkProduce) {
|
||||
this.pkProduce = pkProduce;
|
||||
}
|
||||
|
||||
public String getRgf() {
|
||||
return rgf;
|
||||
}
|
||||
|
||||
public void setRgf(String rgf) {
|
||||
this.rgf = rgf;
|
||||
}
|
||||
|
||||
public String getSfmr() {
|
||||
return sfmr;
|
||||
}
|
||||
|
||||
public void setSfmr(String sfmr) {
|
||||
this.sfmr = sfmr;
|
||||
}
|
||||
|
||||
public String getSftpmr() {
|
||||
return sftpmr;
|
||||
}
|
||||
|
||||
public void setSftpmr(String sftpmr) {
|
||||
this.sftpmr = sftpmr;
|
||||
}
|
||||
|
||||
public String getSl() {
|
||||
return sl;
|
||||
}
|
||||
|
||||
public void setSl(String sl) {
|
||||
this.sl = sl;
|
||||
}
|
||||
|
||||
public String getSlsx() {
|
||||
return slsx;
|
||||
}
|
||||
|
||||
public void setSlsx(String slsx) {
|
||||
this.slsx = slsx;
|
||||
}
|
||||
|
||||
public String getSlxx() {
|
||||
return slxx;
|
||||
}
|
||||
|
||||
public void setSlxx(String slxx) {
|
||||
this.slxx = slxx;
|
||||
}
|
||||
|
||||
public String getTs() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTs(String ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getWlbmid() {
|
||||
return wlbmid;
|
||||
}
|
||||
|
||||
public void setWlbmid(String wlbmid) {
|
||||
this.wlbmid = wlbmid;
|
||||
}
|
||||
|
||||
public String getZdy1() {
|
||||
return zdy1;
|
||||
}
|
||||
|
||||
public void setZdy1(String zdy1) {
|
||||
this.zdy1 = zdy1;
|
||||
}
|
||||
|
||||
public String getZdy10() {
|
||||
return zdy10;
|
||||
}
|
||||
|
||||
public void setZdy10(String zdy10) {
|
||||
this.zdy10 = zdy10;
|
||||
}
|
||||
|
||||
public String getZdy11() {
|
||||
return zdy11;
|
||||
}
|
||||
|
||||
public void setZdy11(String zdy11) {
|
||||
this.zdy11 = zdy11;
|
||||
}
|
||||
|
||||
public String getZdy12() {
|
||||
return zdy12;
|
||||
}
|
||||
|
||||
public void setZdy12(String zdy12) {
|
||||
this.zdy12 = zdy12;
|
||||
}
|
||||
|
||||
public String getZdy13() {
|
||||
return zdy13;
|
||||
}
|
||||
|
||||
public void setZdy13(String zdy13) {
|
||||
this.zdy13 = zdy13;
|
||||
}
|
||||
|
||||
public String getZdy14() {
|
||||
return zdy14;
|
||||
}
|
||||
|
||||
public void setZdy14(String zdy14) {
|
||||
this.zdy14 = zdy14;
|
||||
}
|
||||
|
||||
public String getZdy15() {
|
||||
return zdy15;
|
||||
}
|
||||
|
||||
public void setZdy15(String zdy15) {
|
||||
this.zdy15 = zdy15;
|
||||
}
|
||||
|
||||
public String getZdy16() {
|
||||
return zdy16;
|
||||
}
|
||||
|
||||
public void setZdy16(String zdy16) {
|
||||
this.zdy16 = zdy16;
|
||||
}
|
||||
|
||||
public String getZdy17() {
|
||||
return zdy17;
|
||||
}
|
||||
|
||||
public void setZdy17(String zdy17) {
|
||||
this.zdy17 = zdy17;
|
||||
}
|
||||
|
||||
public String getZdy18() {
|
||||
return zdy18;
|
||||
}
|
||||
|
||||
public void setZdy18(String zdy18) {
|
||||
this.zdy18 = zdy18;
|
||||
}
|
||||
|
||||
public String getZdy19() {
|
||||
return zdy19;
|
||||
}
|
||||
|
||||
public void setZdy19(String zdy19) {
|
||||
this.zdy19 = zdy19;
|
||||
}
|
||||
|
||||
public String getZdy2() {
|
||||
return zdy2;
|
||||
}
|
||||
|
||||
public void setZdy2(String zdy2) {
|
||||
this.zdy2 = zdy2;
|
||||
}
|
||||
|
||||
public String getZdy20() {
|
||||
return zdy20;
|
||||
}
|
||||
|
||||
public void setZdy20(String zdy20) {
|
||||
this.zdy20 = zdy20;
|
||||
}
|
||||
|
||||
public String getZdy3() {
|
||||
return zdy3;
|
||||
}
|
||||
|
||||
public void setZdy3(String zdy3) {
|
||||
this.zdy3 = zdy3;
|
||||
}
|
||||
|
||||
public String getZdy4() {
|
||||
return zdy4;
|
||||
}
|
||||
|
||||
public void setZdy4(String zdy4) {
|
||||
this.zdy4 = zdy4;
|
||||
}
|
||||
|
||||
public String getZdy5() {
|
||||
return zdy5;
|
||||
}
|
||||
|
||||
public void setZdy5(String zdy5) {
|
||||
this.zdy5 = zdy5;
|
||||
}
|
||||
|
||||
public String getZdy6() {
|
||||
return zdy6;
|
||||
}
|
||||
|
||||
public void setZdy6(String zdy6) {
|
||||
this.zdy6 = zdy6;
|
||||
}
|
||||
|
||||
public String getZdy7() {
|
||||
return zdy7;
|
||||
}
|
||||
|
||||
public void setZdy7(String zdy7) {
|
||||
this.zdy7 = zdy7;
|
||||
}
|
||||
|
||||
public String getZdy8() {
|
||||
return zdy8;
|
||||
}
|
||||
|
||||
public void setZdy8(String zdy8) {
|
||||
this.zdy8 = zdy8;
|
||||
}
|
||||
|
||||
public String getZdy9() {
|
||||
return zdy9;
|
||||
}
|
||||
|
||||
public void setZdy9(String zdy9) {
|
||||
this.zdy9 = zdy9;
|
||||
}
|
||||
|
||||
public String getZt() {
|
||||
return zt;
|
||||
}
|
||||
|
||||
public void setZt(String zt) {
|
||||
this.zt = zt;
|
||||
}
|
||||
|
||||
public String getZyx1() {
|
||||
return zyx1;
|
||||
}
|
||||
|
||||
public void setZyx1(String zyx1) {
|
||||
this.zyx1 = zyx1;
|
||||
}
|
||||
|
||||
public String getZyx2() {
|
||||
return zyx2;
|
||||
}
|
||||
|
||||
public void setZyx2(String zyx2) {
|
||||
this.zyx2 = zyx2;
|
||||
}
|
||||
|
||||
public String getZyx3() {
|
||||
return zyx3;
|
||||
}
|
||||
|
||||
public void setZyx3(String zyx3) {
|
||||
this.zyx3 = zyx3;
|
||||
}
|
||||
|
||||
public String getZyx4() {
|
||||
return zyx4;
|
||||
}
|
||||
|
||||
public void setZyx4(String zyx4) {
|
||||
this.zyx4 = zyx4;
|
||||
}
|
||||
|
||||
public String getZyx5() {
|
||||
return zyx5;
|
||||
}
|
||||
|
||||
public void setZyx5(String zyx5) {
|
||||
this.zyx5 = zyx5;
|
||||
}
|
||||
|
||||
public String getZzf() {
|
||||
return zzf;
|
||||
}
|
||||
|
||||
public void setZzf(String zzf) {
|
||||
this.zzf = zzf;
|
||||
}
|
||||
|
||||
public String getBomtypeFrom() {
|
||||
return bomtypeFrom;
|
||||
}
|
||||
|
||||
public void setBomtypeFrom(String bomtypeFrom) {
|
||||
this.bomtypeFrom = bomtypeFrom;
|
||||
}
|
||||
|
||||
public String getCjrq() {
|
||||
return cjrq;
|
||||
}
|
||||
|
||||
public void setCjrq(String cjrq) {
|
||||
this.cjrq = cjrq;
|
||||
}
|
||||
|
||||
public String getCjsj() {
|
||||
return cjsj;
|
||||
}
|
||||
|
||||
public void setCjsj(String cjsj) {
|
||||
this.cjsj = cjsj;
|
||||
}
|
||||
|
||||
public String getCreatetype() {
|
||||
return createtype;
|
||||
}
|
||||
|
||||
public void setCreatetype(String createtype) {
|
||||
this.createtype = createtype;
|
||||
}
|
||||
|
||||
public String getGcbmFrom() {
|
||||
return gcbmFrom;
|
||||
}
|
||||
|
||||
public void setGcbmFrom(String gcbmFrom) {
|
||||
this.gcbmFrom = gcbmFrom;
|
||||
}
|
||||
|
||||
public String getModifiedtime() {
|
||||
return modifiedtime;
|
||||
}
|
||||
|
||||
public void setModifiedtime(String modifiedtime) {
|
||||
this.modifiedtime = modifiedtime;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier;
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public String getPkBomidFrom() {
|
||||
return pkBomidFrom;
|
||||
}
|
||||
|
||||
public void setPkBomidFrom(String pkBomidFrom) {
|
||||
this.pkBomidFrom = pkBomidFrom;
|
||||
}
|
||||
|
||||
public String getPkCorpFrom() {
|
||||
return pkCorpFrom;
|
||||
}
|
||||
|
||||
public void setPkCorpFrom(String pkCorpFrom) {
|
||||
this.pkCorpFrom = pkCorpFrom;
|
||||
}
|
||||
|
||||
public String getQrrid() {
|
||||
return qrrid;
|
||||
}
|
||||
|
||||
public void setQrrid(String qrrid) {
|
||||
this.qrrid = qrrid;
|
||||
}
|
||||
|
||||
public String getQrrq() {
|
||||
return qrrq;
|
||||
}
|
||||
|
||||
public void setQrrq(String qrrq) {
|
||||
this.qrrq = qrrq;
|
||||
}
|
||||
|
||||
public String getQrsj() {
|
||||
return qrsj;
|
||||
}
|
||||
|
||||
public void setQrsj(String qrsj) {
|
||||
this.qrsj = qrsj;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,927 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.plugin.lets.dao.impl.BdBomDaoImpl">
|
||||
|
||||
<resultMap id="get-BdBomEntity-result" type="com.hzya.frame.plugin.lets.entity.BdBomEntity" >
|
||||
<result property="bblx" column="BBLX" jdbcType="VARCHAR"/>
|
||||
<result property="bomlx" column="BOMLX" jdbcType="VARCHAR"/>
|
||||
<result property="clf" column="CLF" jdbcType="VARCHAR"/>
|
||||
<result property="creat" column="CREAT" jdbcType="VARCHAR"/>
|
||||
<result property="dr" column="DR" jdbcType="VARCHAR"/>
|
||||
<result property="fsl" column="FSL" jdbcType="VARCHAR"/>
|
||||
<result property="fslsx" column="FSLSX" jdbcType="VARCHAR"/>
|
||||
<result property="fslxx" column="FSLXX" jdbcType="VARCHAR"/>
|
||||
<result property="gcbm" column="GCBM" jdbcType="VARCHAR"/>
|
||||
<result property="gdfsl" column="GDFSL" jdbcType="VARCHAR"/>
|
||||
<result property="gdsl" column="GDSL" jdbcType="VARCHAR"/>
|
||||
<result property="hsl" column="HSL" jdbcType="VARCHAR"/>
|
||||
<result property="jldwid" column="JLDWID" jdbcType="VARCHAR"/>
|
||||
<result property="memo" column="MEMO" jdbcType="VARCHAR"/>
|
||||
<result property="mver" column="MVER" jdbcType="VARCHAR"/>
|
||||
<result property="pkBomid" column="PK_BOMID" jdbcType="VARCHAR"/>
|
||||
<result property="pkCorp" column="PK_CORP" jdbcType="VARCHAR"/>
|
||||
<result property="pkProduce" column="PK_PRODUCE" jdbcType="VARCHAR"/>
|
||||
<result property="rgf" column="RGF" jdbcType="VARCHAR"/>
|
||||
<result property="sfmr" column="SFMR" jdbcType="VARCHAR"/>
|
||||
<result property="sftpmr" column="SFTPMR" jdbcType="VARCHAR"/>
|
||||
<result property="sl" column="SL" jdbcType="VARCHAR"/>
|
||||
<result property="slsx" column="SLSX" jdbcType="VARCHAR"/>
|
||||
<result property="slxx" column="SLXX" jdbcType="VARCHAR"/>
|
||||
<result property="ts" column="TS" jdbcType="VARCHAR"/>
|
||||
<result property="version" column="VERSION" jdbcType="VARCHAR"/>
|
||||
<result property="wlbmid" column="WLBMID" jdbcType="VARCHAR"/>
|
||||
<result property="zdy1" column="ZDY1" jdbcType="VARCHAR"/>
|
||||
<result property="zdy10" column="ZDY10" jdbcType="VARCHAR"/>
|
||||
<result property="zdy11" column="ZDY11" jdbcType="VARCHAR"/>
|
||||
<result property="zdy12" column="ZDY12" jdbcType="VARCHAR"/>
|
||||
<result property="zdy13" column="ZDY13" jdbcType="VARCHAR"/>
|
||||
<result property="zdy14" column="ZDY14" jdbcType="VARCHAR"/>
|
||||
<result property="zdy15" column="ZDY15" jdbcType="VARCHAR"/>
|
||||
<result property="zdy16" column="ZDY16" jdbcType="VARCHAR"/>
|
||||
<result property="zdy17" column="ZDY17" jdbcType="VARCHAR"/>
|
||||
<result property="zdy18" column="ZDY18" jdbcType="VARCHAR"/>
|
||||
<result property="zdy19" column="ZDY19" jdbcType="VARCHAR"/>
|
||||
<result property="zdy2" column="ZDY2" jdbcType="VARCHAR"/>
|
||||
<result property="zdy20" column="ZDY20" jdbcType="VARCHAR"/>
|
||||
<result property="zdy3" column="ZDY3" jdbcType="VARCHAR"/>
|
||||
<result property="zdy4" column="ZDY4" jdbcType="VARCHAR"/>
|
||||
<result property="zdy5" column="ZDY5" jdbcType="VARCHAR"/>
|
||||
<result property="zdy6" column="ZDY6" jdbcType="VARCHAR"/>
|
||||
<result property="zdy7" column="ZDY7" jdbcType="VARCHAR"/>
|
||||
<result property="zdy8" column="ZDY8" jdbcType="VARCHAR"/>
|
||||
<result property="zdy9" column="ZDY9" jdbcType="VARCHAR"/>
|
||||
<result property="zt" column="ZT" jdbcType="VARCHAR"/>
|
||||
<result property="zyx1" column="ZYX1" jdbcType="VARCHAR"/>
|
||||
<result property="zyx2" column="ZYX2" jdbcType="VARCHAR"/>
|
||||
<result property="zyx3" column="ZYX3" jdbcType="VARCHAR"/>
|
||||
<result property="zyx4" column="ZYX4" jdbcType="VARCHAR"/>
|
||||
<result property="zyx5" column="ZYX5" jdbcType="VARCHAR"/>
|
||||
<result property="zzf" column="ZZF" jdbcType="VARCHAR"/>
|
||||
<result property="bomtypeFrom" column="BOMTYPE_FROM" jdbcType="VARCHAR"/>
|
||||
<result property="cjrq" column="CJRQ" jdbcType="VARCHAR"/>
|
||||
<result property="cjsj" column="CJSJ" jdbcType="VARCHAR"/>
|
||||
<result property="createtype" column="CREATETYPE" jdbcType="VARCHAR"/>
|
||||
<result property="gcbmFrom" column="GCBM_FROM" jdbcType="VARCHAR"/>
|
||||
<result property="modifiedtime" column="MODIFIEDTIME" jdbcType="VARCHAR"/>
|
||||
<result property="modifier" column="MODIFIER" jdbcType="VARCHAR"/>
|
||||
<result property="pkBomidFrom" column="PK_BOMID_FROM" jdbcType="VARCHAR"/>
|
||||
<result property="pkCorpFrom" column="PK_CORP_FROM" jdbcType="VARCHAR"/>
|
||||
<result property="qrrid" column="QRRID" jdbcType="VARCHAR"/>
|
||||
<result property="qrrq" column="QRRQ" jdbcType="VARCHAR"/>
|
||||
<result property="qrsj" column="QRSJ" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "BdBomEntity_Base_Column_List">
|
||||
BBLX
|
||||
,BOMLX
|
||||
,CLF
|
||||
,CREAT
|
||||
,DR
|
||||
,FSL
|
||||
,FSLSX
|
||||
,FSLXX
|
||||
,GCBM
|
||||
,GDFSL
|
||||
,GDSL
|
||||
,HSL
|
||||
,JLDWID
|
||||
,MEMO
|
||||
,MVER
|
||||
,PK_BOMID
|
||||
,PK_CORP
|
||||
,PK_PRODUCE
|
||||
,RGF
|
||||
,SFMR
|
||||
,SFTPMR
|
||||
,SL
|
||||
,SLSX
|
||||
,SLXX
|
||||
,TS
|
||||
,VERSION
|
||||
,WLBMID
|
||||
,ZDY1
|
||||
,ZDY10
|
||||
,ZDY11
|
||||
,ZDY12
|
||||
,ZDY13
|
||||
,ZDY14
|
||||
,ZDY15
|
||||
,ZDY16
|
||||
,ZDY17
|
||||
,ZDY18
|
||||
,ZDY19
|
||||
,ZDY2
|
||||
,ZDY20
|
||||
,ZDY3
|
||||
,ZDY4
|
||||
,ZDY5
|
||||
,ZDY6
|
||||
,ZDY7
|
||||
,ZDY8
|
||||
,ZDY9
|
||||
,ZT
|
||||
,ZYX1
|
||||
,ZYX2
|
||||
,ZYX3
|
||||
,ZYX4
|
||||
,ZYX5
|
||||
,ZZF
|
||||
,BOMTYPE_FROM
|
||||
,CJRQ
|
||||
,CJSJ
|
||||
,CREATETYPE
|
||||
,GCBM_FROM
|
||||
,MODIFIEDTIME
|
||||
,MODIFIER
|
||||
,PK_BOMID_FROM
|
||||
,PK_CORP_FROM
|
||||
,QRRID
|
||||
,QRRQ
|
||||
,QRSJ
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-BdBomEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
|
||||
select
|
||||
<include refid="BdBomEntity_Base_Column_List" />
|
||||
from BD_BOM
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="bblx != null and bblx != ''"> and BBLX = #{bblx} </if>
|
||||
<if test="bomlx != null and bomlx != ''"> and BOMLX = #{bomlx} </if>
|
||||
<if test="clf != null and clf != ''"> and CLF = #{clf} </if>
|
||||
<if test="creat != null and creat != ''"> and CREAT = #{creat} </if>
|
||||
<if test="dr != null and dr != ''"> and DR = #{dr} </if>
|
||||
<if test="fsl != null and fsl != ''"> and FSL = #{fsl} </if>
|
||||
<if test="fslsx != null and fslsx != ''"> and FSLSX = #{fslsx} </if>
|
||||
<if test="fslxx != null and fslxx != ''"> and FSLXX = #{fslxx} </if>
|
||||
<if test="gcbm != null and gcbm != ''"> and GCBM = #{gcbm} </if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> and GDFSL = #{gdfsl} </if>
|
||||
<if test="gdsl != null and gdsl != ''"> and GDSL = #{gdsl} </if>
|
||||
<if test="hsl != null and hsl != ''"> and HSL = #{hsl} </if>
|
||||
<if test="jldwid != null and jldwid != ''"> and JLDWID = #{jldwid} </if>
|
||||
<if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
|
||||
<if test="mver != null and mver != ''"> and MVER = #{mver} </if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> and PK_BOMID = #{pkBomid} </if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE = #{pkProduce} </if>
|
||||
<if test="rgf != null and rgf != ''"> and RGF = #{rgf} </if>
|
||||
<if test="sfmr != null and sfmr != ''"> and SFMR = #{sfmr} </if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> and SFTPMR = #{sftpmr} </if>
|
||||
<if test="sl != null and sl != ''"> and SL = #{sl} </if>
|
||||
<if test="slsx != null and slsx != ''"> and SLSX = #{slsx} </if>
|
||||
<if test="slxx != null and slxx != ''"> and SLXX = #{slxx} </if>
|
||||
<if test="ts != null and ts != ''"> and TS = #{ts} </if>
|
||||
<if test="version != null and version != ''"> and VERSION = #{version} </if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> and WLBMID = #{wlbmid} </if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> and ZDY1 = #{zdy1} </if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> and ZDY10 = #{zdy10} </if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> and ZDY11 = #{zdy11} </if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> and ZDY12 = #{zdy12} </if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> and ZDY13 = #{zdy13} </if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> and ZDY14 = #{zdy14} </if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> and ZDY15 = #{zdy15} </if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> and ZDY16 = #{zdy16} </if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> and ZDY17 = #{zdy17} </if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> and ZDY18 = #{zdy18} </if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> and ZDY19 = #{zdy19} </if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> and ZDY2 = #{zdy2} </if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> and ZDY20 = #{zdy20} </if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> and ZDY3 = #{zdy3} </if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> and ZDY4 = #{zdy4} </if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> and ZDY5 = #{zdy5} </if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> and ZDY6 = #{zdy6} </if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> and ZDY7 = #{zdy7} </if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> and ZDY8 = #{zdy8} </if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> and ZDY9 = #{zdy9} </if>
|
||||
<if test="zt != null and zt != ''"> and ZT = #{zt} </if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> and ZYX1 = #{zyx1} </if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> and ZYX2 = #{zyx2} </if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> and ZYX3 = #{zyx3} </if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> and ZYX4 = #{zyx4} </if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> and ZYX5 = #{zyx5} </if>
|
||||
<if test="zzf != null and zzf != ''"> and ZZF = #{zzf} </if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM = #{bomtypeFrom} </if>
|
||||
<if test="cjrq != null and cjrq != ''"> and CJRQ = #{cjrq} </if>
|
||||
<if test="cjsj != null and cjsj != ''"> and CJSJ = #{cjsj} </if>
|
||||
<if test="createtype != null and createtype != ''"> and CREATETYPE = #{createtype} </if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM = #{gcbmFrom} </if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME = #{modifiedtime} </if>
|
||||
<if test="modifier != null and modifier != ''"> and MODIFIER = #{modifier} </if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM = #{pkBomidFrom} </if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM = #{pkCorpFrom} </if>
|
||||
<if test="qrrid != null and qrrid != ''"> and QRRID = #{qrrid} </if>
|
||||
<if test="qrrq != null and qrrq != ''"> and QRRQ = #{qrrq} </if>
|
||||
<if test="qrsj != null and qrsj != ''"> and QRSJ = #{qrsj} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
|
||||
select count(1) from BD_BOM
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="bblx != null and bblx != ''"> and BBLX = #{bblx} </if>
|
||||
<if test="bomlx != null and bomlx != ''"> and BOMLX = #{bomlx} </if>
|
||||
<if test="clf != null and clf != ''"> and CLF = #{clf} </if>
|
||||
<if test="creat != null and creat != ''"> and CREAT = #{creat} </if>
|
||||
<if test="dr != null and dr != ''"> and DR = #{dr} </if>
|
||||
<if test="fsl != null and fsl != ''"> and FSL = #{fsl} </if>
|
||||
<if test="fslsx != null and fslsx != ''"> and FSLSX = #{fslsx} </if>
|
||||
<if test="fslxx != null and fslxx != ''"> and FSLXX = #{fslxx} </if>
|
||||
<if test="gcbm != null and gcbm != ''"> and GCBM = #{gcbm} </if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> and GDFSL = #{gdfsl} </if>
|
||||
<if test="gdsl != null and gdsl != ''"> and GDSL = #{gdsl} </if>
|
||||
<if test="hsl != null and hsl != ''"> and HSL = #{hsl} </if>
|
||||
<if test="jldwid != null and jldwid != ''"> and JLDWID = #{jldwid} </if>
|
||||
<if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
|
||||
<if test="mver != null and mver != ''"> and MVER = #{mver} </if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> and PK_BOMID = #{pkBomid} </if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE = #{pkProduce} </if>
|
||||
<if test="rgf != null and rgf != ''"> and RGF = #{rgf} </if>
|
||||
<if test="sfmr != null and sfmr != ''"> and SFMR = #{sfmr} </if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> and SFTPMR = #{sftpmr} </if>
|
||||
<if test="sl != null and sl != ''"> and SL = #{sl} </if>
|
||||
<if test="slsx != null and slsx != ''"> and SLSX = #{slsx} </if>
|
||||
<if test="slxx != null and slxx != ''"> and SLXX = #{slxx} </if>
|
||||
<if test="ts != null and ts != ''"> and TS = #{ts} </if>
|
||||
<if test="version != null and version != ''"> and VERSION = #{version} </if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> and WLBMID = #{wlbmid} </if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> and ZDY1 = #{zdy1} </if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> and ZDY10 = #{zdy10} </if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> and ZDY11 = #{zdy11} </if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> and ZDY12 = #{zdy12} </if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> and ZDY13 = #{zdy13} </if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> and ZDY14 = #{zdy14} </if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> and ZDY15 = #{zdy15} </if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> and ZDY16 = #{zdy16} </if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> and ZDY17 = #{zdy17} </if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> and ZDY18 = #{zdy18} </if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> and ZDY19 = #{zdy19} </if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> and ZDY2 = #{zdy2} </if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> and ZDY20 = #{zdy20} </if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> and ZDY3 = #{zdy3} </if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> and ZDY4 = #{zdy4} </if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> and ZDY5 = #{zdy5} </if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> and ZDY6 = #{zdy6} </if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> and ZDY7 = #{zdy7} </if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> and ZDY8 = #{zdy8} </if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> and ZDY9 = #{zdy9} </if>
|
||||
<if test="zt != null and zt != ''"> and ZT = #{zt} </if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> and ZYX1 = #{zyx1} </if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> and ZYX2 = #{zyx2} </if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> and ZYX3 = #{zyx3} </if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> and ZYX4 = #{zyx4} </if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> and ZYX5 = #{zyx5} </if>
|
||||
<if test="zzf != null and zzf != ''"> and ZZF = #{zzf} </if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM = #{bomtypeFrom} </if>
|
||||
<if test="cjrq != null and cjrq != ''"> and CJRQ = #{cjrq} </if>
|
||||
<if test="cjsj != null and cjsj != ''"> and CJSJ = #{cjsj} </if>
|
||||
<if test="createtype != null and createtype != ''"> and CREATETYPE = #{createtype} </if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM = #{gcbmFrom} </if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME = #{modifiedtime} </if>
|
||||
<if test="modifier != null and modifier != ''"> and MODIFIER = #{modifier} </if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM = #{pkBomidFrom} </if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM = #{pkCorpFrom} </if>
|
||||
<if test="qrrid != null and qrrid != ''"> and QRRID = #{qrrid} </if>
|
||||
<if test="qrrq != null and qrrq != ''"> and QRRQ = #{qrrq} </if>
|
||||
<if test="qrsj != null and qrsj != ''"> and QRSJ = #{qrsj} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-BdBomEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
|
||||
select
|
||||
<include refid="BdBomEntity_Base_Column_List" />
|
||||
from BD_BOM
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="bblx != null and bblx != ''"> and BBLX like concat('%',#{bblx},'%') </if>
|
||||
<if test="bomlx != null and bomlx != ''"> and BOMLX like concat('%',#{bomlx},'%') </if>
|
||||
<if test="clf != null and clf != ''"> and CLF like concat('%',#{clf},'%') </if>
|
||||
<if test="creat != null and creat != ''"> and CREAT like concat('%',#{creat},'%') </if>
|
||||
<if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
|
||||
<if test="fsl != null and fsl != ''"> and FSL like concat('%',#{fsl},'%') </if>
|
||||
<if test="fslsx != null and fslsx != ''"> and FSLSX like concat('%',#{fslsx},'%') </if>
|
||||
<if test="fslxx != null and fslxx != ''"> and FSLXX like concat('%',#{fslxx},'%') </if>
|
||||
<if test="gcbm != null and gcbm != ''"> and GCBM like concat('%',#{gcbm},'%') </if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> and GDFSL like concat('%',#{gdfsl},'%') </if>
|
||||
<if test="gdsl != null and gdsl != ''"> and GDSL like concat('%',#{gdsl},'%') </if>
|
||||
<if test="hsl != null and hsl != ''"> and HSL like concat('%',#{hsl},'%') </if>
|
||||
<if test="jldwid != null and jldwid != ''"> and JLDWID like concat('%',#{jldwid},'%') </if>
|
||||
<if test="memo != null and memo != ''"> and MEMO like concat('%',#{memo},'%') </if>
|
||||
<if test="mver != null and mver != ''"> and MVER like concat('%',#{mver},'%') </if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> and PK_BOMID like concat('%',#{pkBomid},'%') </if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> and PK_CORP like concat('%',#{pkCorp},'%') </if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE like concat('%',#{pkProduce},'%') </if>
|
||||
<if test="rgf != null and rgf != ''"> and RGF like concat('%',#{rgf},'%') </if>
|
||||
<if test="sfmr != null and sfmr != ''"> and SFMR like concat('%',#{sfmr},'%') </if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> and SFTPMR like concat('%',#{sftpmr},'%') </if>
|
||||
<if test="sl != null and sl != ''"> and SL like concat('%',#{sl},'%') </if>
|
||||
<if test="slsx != null and slsx != ''"> and SLSX like concat('%',#{slsx},'%') </if>
|
||||
<if test="slxx != null and slxx != ''"> and SLXX like concat('%',#{slxx},'%') </if>
|
||||
<if test="ts != null and ts != ''"> and TS like concat('%',#{ts},'%') </if>
|
||||
<if test="version != null and version != ''"> and VERSION like concat('%',#{version},'%') </if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> and WLBMID like concat('%',#{wlbmid},'%') </if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> and ZDY1 like concat('%',#{zdy1},'%') </if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> and ZDY10 like concat('%',#{zdy10},'%') </if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> and ZDY11 like concat('%',#{zdy11},'%') </if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> and ZDY12 like concat('%',#{zdy12},'%') </if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> and ZDY13 like concat('%',#{zdy13},'%') </if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> and ZDY14 like concat('%',#{zdy14},'%') </if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> and ZDY15 like concat('%',#{zdy15},'%') </if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> and ZDY16 like concat('%',#{zdy16},'%') </if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> and ZDY17 like concat('%',#{zdy17},'%') </if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> and ZDY18 like concat('%',#{zdy18},'%') </if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> and ZDY19 like concat('%',#{zdy19},'%') </if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> and ZDY2 like concat('%',#{zdy2},'%') </if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> and ZDY20 like concat('%',#{zdy20},'%') </if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> and ZDY3 like concat('%',#{zdy3},'%') </if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> and ZDY4 like concat('%',#{zdy4},'%') </if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> and ZDY5 like concat('%',#{zdy5},'%') </if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> and ZDY6 like concat('%',#{zdy6},'%') </if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> and ZDY7 like concat('%',#{zdy7},'%') </if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> and ZDY8 like concat('%',#{zdy8},'%') </if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> and ZDY9 like concat('%',#{zdy9},'%') </if>
|
||||
<if test="zt != null and zt != ''"> and ZT like concat('%',#{zt},'%') </if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> and ZYX1 like concat('%',#{zyx1},'%') </if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> and ZYX2 like concat('%',#{zyx2},'%') </if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> and ZYX3 like concat('%',#{zyx3},'%') </if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> and ZYX4 like concat('%',#{zyx4},'%') </if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> and ZYX5 like concat('%',#{zyx5},'%') </if>
|
||||
<if test="zzf != null and zzf != ''"> and ZZF like concat('%',#{zzf},'%') </if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM like concat('%',#{bomtypeFrom},'%') </if>
|
||||
<if test="cjrq != null and cjrq != ''"> and CJRQ like concat('%',#{cjrq},'%') </if>
|
||||
<if test="cjsj != null and cjsj != ''"> and CJSJ like concat('%',#{cjsj},'%') </if>
|
||||
<if test="createtype != null and createtype != ''"> and CREATETYPE like concat('%',#{createtype},'%') </if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM like concat('%',#{gcbmFrom},'%') </if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME like concat('%',#{modifiedtime},'%') </if>
|
||||
<if test="modifier != null and modifier != ''"> and MODIFIER like concat('%',#{modifier},'%') </if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM like concat('%',#{pkBomidFrom},'%') </if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM like concat('%',#{pkCorpFrom},'%') </if>
|
||||
<if test="qrrid != null and qrrid != ''"> and QRRID like concat('%',#{qrrid},'%') </if>
|
||||
<if test="qrrq != null and qrrq != ''"> and QRRQ like concat('%',#{qrrq},'%') </if>
|
||||
<if test="qrsj != null and qrsj != ''"> and QRSJ like concat('%',#{qrsj},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="BdBomentity_list_or" resultMap="get-BdBomEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
|
||||
select
|
||||
<include refid="BdBomEntity_Base_Column_List" />
|
||||
from BD_BOM
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="bblx != null and bblx != ''"> or BBLX = #{bblx} </if>
|
||||
<if test="bomlx != null and bomlx != ''"> or BOMLX = #{bomlx} </if>
|
||||
<if test="clf != null and clf != ''"> or CLF = #{clf} </if>
|
||||
<if test="creat != null and creat != ''"> or CREAT = #{creat} </if>
|
||||
<if test="dr != null and dr != ''"> or DR = #{dr} </if>
|
||||
<if test="fsl != null and fsl != ''"> or FSL = #{fsl} </if>
|
||||
<if test="fslsx != null and fslsx != ''"> or FSLSX = #{fslsx} </if>
|
||||
<if test="fslxx != null and fslxx != ''"> or FSLXX = #{fslxx} </if>
|
||||
<if test="gcbm != null and gcbm != ''"> or GCBM = #{gcbm} </if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> or GDFSL = #{gdfsl} </if>
|
||||
<if test="gdsl != null and gdsl != ''"> or GDSL = #{gdsl} </if>
|
||||
<if test="hsl != null and hsl != ''"> or HSL = #{hsl} </if>
|
||||
<if test="jldwid != null and jldwid != ''"> or JLDWID = #{jldwid} </if>
|
||||
<if test="memo != null and memo != ''"> or MEMO = #{memo} </if>
|
||||
<if test="mver != null and mver != ''"> or MVER = #{mver} </if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> or PK_BOMID = #{pkBomid} </if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> or PK_CORP = #{pkCorp} </if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> or PK_PRODUCE = #{pkProduce} </if>
|
||||
<if test="rgf != null and rgf != ''"> or RGF = #{rgf} </if>
|
||||
<if test="sfmr != null and sfmr != ''"> or SFMR = #{sfmr} </if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> or SFTPMR = #{sftpmr} </if>
|
||||
<if test="sl != null and sl != ''"> or SL = #{sl} </if>
|
||||
<if test="slsx != null and slsx != ''"> or SLSX = #{slsx} </if>
|
||||
<if test="slxx != null and slxx != ''"> or SLXX = #{slxx} </if>
|
||||
<if test="ts != null and ts != ''"> or TS = #{ts} </if>
|
||||
<if test="version != null and version != ''"> or VERSION = #{version} </if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> or WLBMID = #{wlbmid} </if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> or ZDY1 = #{zdy1} </if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> or ZDY10 = #{zdy10} </if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> or ZDY11 = #{zdy11} </if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> or ZDY12 = #{zdy12} </if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> or ZDY13 = #{zdy13} </if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> or ZDY14 = #{zdy14} </if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> or ZDY15 = #{zdy15} </if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> or ZDY16 = #{zdy16} </if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> or ZDY17 = #{zdy17} </if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> or ZDY18 = #{zdy18} </if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> or ZDY19 = #{zdy19} </if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> or ZDY2 = #{zdy2} </if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> or ZDY20 = #{zdy20} </if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> or ZDY3 = #{zdy3} </if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> or ZDY4 = #{zdy4} </if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> or ZDY5 = #{zdy5} </if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> or ZDY6 = #{zdy6} </if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> or ZDY7 = #{zdy7} </if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> or ZDY8 = #{zdy8} </if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> or ZDY9 = #{zdy9} </if>
|
||||
<if test="zt != null and zt != ''"> or ZT = #{zt} </if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> or ZYX1 = #{zyx1} </if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> or ZYX2 = #{zyx2} </if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> or ZYX3 = #{zyx3} </if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> or ZYX4 = #{zyx4} </if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> or ZYX5 = #{zyx5} </if>
|
||||
<if test="zzf != null and zzf != ''"> or ZZF = #{zzf} </if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> or BOMTYPE_FROM = #{bomtypeFrom} </if>
|
||||
<if test="cjrq != null and cjrq != ''"> or CJRQ = #{cjrq} </if>
|
||||
<if test="cjsj != null and cjsj != ''"> or CJSJ = #{cjsj} </if>
|
||||
<if test="createtype != null and createtype != ''"> or CREATETYPE = #{createtype} </if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> or GCBM_FROM = #{gcbmFrom} </if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> or MODIFIEDTIME = #{modifiedtime} </if>
|
||||
<if test="modifier != null and modifier != ''"> or MODIFIER = #{modifier} </if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> or PK_BOMID_FROM = #{pkBomidFrom} </if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> or PK_CORP_FROM = #{pkCorpFrom} </if>
|
||||
<if test="qrrid != null and qrrid != ''"> or QRRID = #{qrrid} </if>
|
||||
<if test="qrrq != null and qrrq != ''"> or QRRQ = #{qrrq} </if>
|
||||
<if test="qrsj != null and qrsj != ''"> or QRSJ = #{qrsj} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" keyProperty="pkBomid" useGeneratedKeys="true">
|
||||
insert into BD_BOM(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="bblx != null and bblx != ''"> BBLX , </if>
|
||||
<if test="bomlx != null and bomlx != ''"> BOMLX , </if>
|
||||
<if test="clf != null and clf != ''"> CLF , </if>
|
||||
<if test="creat != null and creat != ''"> CREAT , </if>
|
||||
<if test="dr != null and dr != ''"> DR , </if>
|
||||
<if test="fsl != null and fsl != ''"> FSL , </if>
|
||||
<if test="fslsx != null and fslsx != ''"> FSLSX , </if>
|
||||
<if test="fslxx != null and fslxx != ''"> FSLXX , </if>
|
||||
<if test="gcbm != null and gcbm != ''"> GCBM , </if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> GDFSL , </if>
|
||||
<if test="gdsl != null and gdsl != ''"> GDSL , </if>
|
||||
<if test="hsl != null and hsl != ''"> HSL , </if>
|
||||
<if test="jldwid != null and jldwid != ''"> JLDWID , </if>
|
||||
<if test="memo != null and memo != ''"> MEMO , </if>
|
||||
<if test="mver != null and mver != ''"> MVER , </if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> PK_BOMID , </if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> PK_CORP , </if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> PK_PRODUCE , </if>
|
||||
<if test="rgf != null and rgf != ''"> RGF , </if>
|
||||
<if test="sfmr != null and sfmr != ''"> SFMR , </if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> SFTPMR , </if>
|
||||
<if test="sl != null and sl != ''"> SL , </if>
|
||||
<if test="slsx != null and slsx != ''"> SLSX , </if>
|
||||
<if test="slxx != null and slxx != ''"> SLXX , </if>
|
||||
<if test="ts != null and ts != ''"> TS , </if>
|
||||
<if test="version != null and version != ''"> VERSION , </if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> WLBMID , </if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> ZDY1 , </if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> ZDY10 , </if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> ZDY11 , </if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> ZDY12 , </if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> ZDY13 , </if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> ZDY14 , </if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> ZDY15 , </if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> ZDY16 , </if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> ZDY17 , </if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> ZDY18 , </if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> ZDY19 , </if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> ZDY2 , </if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> ZDY20 , </if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> ZDY3 , </if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> ZDY4 , </if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> ZDY5 , </if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> ZDY6 , </if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> ZDY7 , </if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> ZDY8 , </if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> ZDY9 , </if>
|
||||
<if test="zt != null and zt != ''"> ZT , </if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> ZYX1 , </if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> ZYX2 , </if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> ZYX3 , </if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> ZYX4 , </if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> ZYX5 , </if>
|
||||
<if test="zzf != null and zzf != ''"> ZZF , </if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> BOMTYPE_FROM , </if>
|
||||
<if test="cjrq != null and cjrq != ''"> CJRQ , </if>
|
||||
<if test="cjsj != null and cjsj != ''"> CJSJ , </if>
|
||||
<if test="createtype != null and createtype != ''"> CREATETYPE , </if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> GCBM_FROM , </if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> MODIFIEDTIME , </if>
|
||||
<if test="modifier != null and modifier != ''"> MODIFIER , </if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> PK_BOMID_FROM , </if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> PK_CORP_FROM , </if>
|
||||
<if test="qrrid != null and qrrid != ''"> QRRID , </if>
|
||||
<if test="qrrq != null and qrrq != ''"> QRRQ , </if>
|
||||
<if test="qrsj != null and qrsj != ''"> QRSJ , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="bblx != null and bblx != ''"> #{bblx} ,</if>
|
||||
<if test="bomlx != null and bomlx != ''"> #{bomlx} ,</if>
|
||||
<if test="clf != null and clf != ''"> #{clf} ,</if>
|
||||
<if test="creat != null and creat != ''"> #{creat} ,</if>
|
||||
<if test="dr != null and dr != ''"> #{dr} ,</if>
|
||||
<if test="fsl != null and fsl != ''"> #{fsl} ,</if>
|
||||
<if test="fslsx != null and fslsx != ''"> #{fslsx} ,</if>
|
||||
<if test="fslxx != null and fslxx != ''"> #{fslxx} ,</if>
|
||||
<if test="gcbm != null and gcbm != ''"> #{gcbm} ,</if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> #{gdfsl} ,</if>
|
||||
<if test="gdsl != null and gdsl != ''"> #{gdsl} ,</if>
|
||||
<if test="hsl != null and hsl != ''"> #{hsl} ,</if>
|
||||
<if test="jldwid != null and jldwid != ''"> #{jldwid} ,</if>
|
||||
<if test="memo != null and memo != ''"> #{memo} ,</if>
|
||||
<if test="mver != null and mver != ''"> #{mver} ,</if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> #{pkBomid} ,</if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> #{pkProduce} ,</if>
|
||||
<if test="rgf != null and rgf != ''"> #{rgf} ,</if>
|
||||
<if test="sfmr != null and sfmr != ''"> #{sfmr} ,</if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> #{sftpmr} ,</if>
|
||||
<if test="sl != null and sl != ''"> #{sl} ,</if>
|
||||
<if test="slsx != null and slsx != ''"> #{slsx} ,</if>
|
||||
<if test="slxx != null and slxx != ''"> #{slxx} ,</if>
|
||||
<if test="ts != null and ts != ''"> #{ts} ,</if>
|
||||
<if test="version != null and version != ''"> #{version} ,</if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> #{wlbmid} ,</if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> #{zdy1} ,</if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> #{zdy10} ,</if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> #{zdy11} ,</if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> #{zdy12} ,</if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> #{zdy13} ,</if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> #{zdy14} ,</if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> #{zdy15} ,</if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> #{zdy16} ,</if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> #{zdy17} ,</if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> #{zdy18} ,</if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> #{zdy19} ,</if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> #{zdy2} ,</if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> #{zdy20} ,</if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> #{zdy3} ,</if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> #{zdy4} ,</if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> #{zdy5} ,</if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> #{zdy6} ,</if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> #{zdy7} ,</if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> #{zdy8} ,</if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> #{zdy9} ,</if>
|
||||
<if test="zt != null and zt != ''"> #{zt} ,</if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> #{zyx1} ,</if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> #{zyx2} ,</if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> #{zyx3} ,</if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> #{zyx4} ,</if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> #{zyx5} ,</if>
|
||||
<if test="zzf != null and zzf != ''"> #{zzf} ,</if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> #{bomtypeFrom} ,</if>
|
||||
<if test="cjrq != null and cjrq != ''"> #{cjrq} ,</if>
|
||||
<if test="cjsj != null and cjsj != ''"> #{cjsj} ,</if>
|
||||
<if test="createtype != null and createtype != ''"> #{createtype} ,</if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> #{gcbmFrom} ,</if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> #{modifiedtime} ,</if>
|
||||
<if test="modifier != null and modifier != ''"> #{modifier} ,</if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> #{pkBomidFrom} ,</if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> #{pkCorpFrom} ,</if>
|
||||
<if test="qrrid != null and qrrid != ''"> #{qrrid} ,</if>
|
||||
<if test="qrrq != null and qrrq != ''"> #{qrrq} ,</if>
|
||||
<if test="qrsj != null and qrsj != ''"> #{qrsj} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from BD_BOM a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="pkBomid" useGeneratedKeys="true">
|
||||
insert into BD_BOM(BBLX, BOMLX, CLF, CREAT, DR, FSL, FSLSX, FSLXX, GCBM, GDFSL, GDSL, HSL, JLDWID, MEMO, MVER, PK_CORP, PK_PRODUCE, RGF, SFMR, SFTPMR, SL, SLSX, SLXX, TS, VERSION, WLBMID, ZDY1, ZDY10, ZDY11, ZDY12, ZDY13, ZDY14, ZDY15, ZDY16, ZDY17, ZDY18, ZDY19, ZDY2, ZDY20, ZDY3, ZDY4, ZDY5, ZDY6, ZDY7, ZDY8, ZDY9, ZT, ZYX1, ZYX2, ZYX3, ZYX4, ZYX5, ZZF, BOMTYPE_FROM, CJRQ, CJSJ, CREATETYPE, GCBM_FROM, MODIFIEDTIME, MODIFIER, PK_BOMID_FROM, PK_CORP_FROM, QRRID, QRRQ, QRSJ, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.bblx},#{entity.bomlx},#{entity.clf},#{entity.creat},#{entity.dr},#{entity.fsl},#{entity.fslsx},#{entity.fslxx},#{entity.gcbm},#{entity.gdfsl},#{entity.gdsl},#{entity.hsl},#{entity.jldwid},#{entity.memo},#{entity.mver},#{entity.pkCorp},#{entity.pkProduce},#{entity.rgf},#{entity.sfmr},#{entity.sftpmr},#{entity.sl},#{entity.slsx},#{entity.slxx},#{entity.ts},#{entity.version},#{entity.wlbmid},#{entity.zdy1},#{entity.zdy10},#{entity.zdy11},#{entity.zdy12},#{entity.zdy13},#{entity.zdy14},#{entity.zdy15},#{entity.zdy16},#{entity.zdy17},#{entity.zdy18},#{entity.zdy19},#{entity.zdy2},#{entity.zdy20},#{entity.zdy3},#{entity.zdy4},#{entity.zdy5},#{entity.zdy6},#{entity.zdy7},#{entity.zdy8},#{entity.zdy9},#{entity.zt},#{entity.zyx1},#{entity.zyx2},#{entity.zyx3},#{entity.zyx4},#{entity.zyx5},#{entity.zzf},#{entity.bomtypeFrom},#{entity.cjrq},#{entity.cjsj},#{entity.createtype},#{entity.gcbmFrom},#{entity.modifiedtime},#{entity.modifier},#{entity.pkBomidFrom},#{entity.pkCorpFrom},#{entity.qrrid},#{entity.qrrq},#{entity.qrsj}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="pkBomid" useGeneratedKeys="true">
|
||||
insert into BD_BOM(BBLX, BOMLX, CLF, CREAT, DR, FSL, FSLSX, FSLXX, GCBM, GDFSL, GDSL, HSL, JLDWID, MEMO, MVER, PK_CORP, PK_PRODUCE, RGF, SFMR, SFTPMR, SL, SLSX, SLXX, TS, VERSION, WLBMID, ZDY1, ZDY10, ZDY11, ZDY12, ZDY13, ZDY14, ZDY15, ZDY16, ZDY17, ZDY18, ZDY19, ZDY2, ZDY20, ZDY3, ZDY4, ZDY5, ZDY6, ZDY7, ZDY8, ZDY9, ZT, ZYX1, ZYX2, ZYX3, ZYX4, ZYX5, ZZF, BOMTYPE_FROM, CJRQ, CJSJ, CREATETYPE, GCBM_FROM, MODIFIEDTIME, MODIFIER, PK_BOMID_FROM, PK_CORP_FROM, QRRID, QRRQ, QRSJ)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.bblx},#{entity.bomlx},#{entity.clf},#{entity.creat},#{entity.dr},#{entity.fsl},#{entity.fslsx},#{entity.fslxx},#{entity.gcbm},#{entity.gdfsl},#{entity.gdsl},#{entity.hsl},#{entity.jldwid},#{entity.memo},#{entity.mver},#{entity.pkCorp},#{entity.pkProduce},#{entity.rgf},#{entity.sfmr},#{entity.sftpmr},#{entity.sl},#{entity.slsx},#{entity.slxx},#{entity.ts},#{entity.version},#{entity.wlbmid},#{entity.zdy1},#{entity.zdy10},#{entity.zdy11},#{entity.zdy12},#{entity.zdy13},#{entity.zdy14},#{entity.zdy15},#{entity.zdy16},#{entity.zdy17},#{entity.zdy18},#{entity.zdy19},#{entity.zdy2},#{entity.zdy20},#{entity.zdy3},#{entity.zdy4},#{entity.zdy5},#{entity.zdy6},#{entity.zdy7},#{entity.zdy8},#{entity.zdy9},#{entity.zt},#{entity.zyx1},#{entity.zyx2},#{entity.zyx3},#{entity.zyx4},#{entity.zyx5},#{entity.zzf},#{entity.bomtypeFrom},#{entity.cjrq},#{entity.cjsj},#{entity.createtype},#{entity.gcbmFrom},#{entity.modifiedtime},#{entity.modifier},#{entity.pkBomidFrom},#{entity.pkCorpFrom},#{entity.qrrid},#{entity.qrrq},#{entity.qrsj})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
BBLX = values(BBLX),
|
||||
BOMLX = values(BOMLX),
|
||||
CLF = values(CLF),
|
||||
CREAT = values(CREAT),
|
||||
DR = values(DR),
|
||||
FSL = values(FSL),
|
||||
FSLSX = values(FSLSX),
|
||||
FSLXX = values(FSLXX),
|
||||
GCBM = values(GCBM),
|
||||
GDFSL = values(GDFSL),
|
||||
GDSL = values(GDSL),
|
||||
HSL = values(HSL),
|
||||
JLDWID = values(JLDWID),
|
||||
MEMO = values(MEMO),
|
||||
MVER = values(MVER),
|
||||
PK_CORP = values(PK_CORP),
|
||||
PK_PRODUCE = values(PK_PRODUCE),
|
||||
RGF = values(RGF),
|
||||
SFMR = values(SFMR),
|
||||
SFTPMR = values(SFTPMR),
|
||||
SL = values(SL),
|
||||
SLSX = values(SLSX),
|
||||
SLXX = values(SLXX),
|
||||
TS = values(TS),
|
||||
VERSION = values(VERSION),
|
||||
WLBMID = values(WLBMID),
|
||||
ZDY1 = values(ZDY1),
|
||||
ZDY10 = values(ZDY10),
|
||||
ZDY11 = values(ZDY11),
|
||||
ZDY12 = values(ZDY12),
|
||||
ZDY13 = values(ZDY13),
|
||||
ZDY14 = values(ZDY14),
|
||||
ZDY15 = values(ZDY15),
|
||||
ZDY16 = values(ZDY16),
|
||||
ZDY17 = values(ZDY17),
|
||||
ZDY18 = values(ZDY18),
|
||||
ZDY19 = values(ZDY19),
|
||||
ZDY2 = values(ZDY2),
|
||||
ZDY20 = values(ZDY20),
|
||||
ZDY3 = values(ZDY3),
|
||||
ZDY4 = values(ZDY4),
|
||||
ZDY5 = values(ZDY5),
|
||||
ZDY6 = values(ZDY6),
|
||||
ZDY7 = values(ZDY7),
|
||||
ZDY8 = values(ZDY8),
|
||||
ZDY9 = values(ZDY9),
|
||||
ZT = values(ZT),
|
||||
ZYX1 = values(ZYX1),
|
||||
ZYX2 = values(ZYX2),
|
||||
ZYX3 = values(ZYX3),
|
||||
ZYX4 = values(ZYX4),
|
||||
ZYX5 = values(ZYX5),
|
||||
ZZF = values(ZZF),
|
||||
BOMTYPE_FROM = values(BOMTYPE_FROM),
|
||||
CJRQ = values(CJRQ),
|
||||
CJSJ = values(CJSJ),
|
||||
CREATETYPE = values(CREATETYPE),
|
||||
GCBM_FROM = values(GCBM_FROM),
|
||||
MODIFIEDTIME = values(MODIFIEDTIME),
|
||||
MODIFIER = values(MODIFIER),
|
||||
PK_BOMID_FROM = values(PK_BOMID_FROM),
|
||||
PK_CORP_FROM = values(PK_CORP_FROM),
|
||||
QRRID = values(QRRID),
|
||||
QRRQ = values(QRRQ),
|
||||
QRSJ = values(QRSJ)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" >
|
||||
update BD_BOM set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="bblx != null and bblx != ''"> BBLX = #{bblx},</if>
|
||||
<if test="bomlx != null and bomlx != ''"> BOMLX = #{bomlx},</if>
|
||||
<if test="clf != null and clf != ''"> CLF = #{clf},</if>
|
||||
<if test="creat != null and creat != ''"> CREAT = #{creat},</if>
|
||||
<if test="dr != null and dr != ''"> DR = #{dr},</if>
|
||||
<if test="fsl != null and fsl != ''"> FSL = #{fsl},</if>
|
||||
<if test="fslsx != null and fslsx != ''"> FSLSX = #{fslsx},</if>
|
||||
<if test="fslxx != null and fslxx != ''"> FSLXX = #{fslxx},</if>
|
||||
<if test="gcbm != null and gcbm != ''"> GCBM = #{gcbm},</if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> GDFSL = #{gdfsl},</if>
|
||||
<if test="gdsl != null and gdsl != ''"> GDSL = #{gdsl},</if>
|
||||
<if test="hsl != null and hsl != ''"> HSL = #{hsl},</if>
|
||||
<if test="jldwid != null and jldwid != ''"> JLDWID = #{jldwid},</if>
|
||||
<if test="memo != null and memo != ''"> MEMO = #{memo},</if>
|
||||
<if test="mver != null and mver != ''"> MVER = #{mver},</if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> PK_CORP = #{pkCorp},</if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> PK_PRODUCE = #{pkProduce},</if>
|
||||
<if test="rgf != null and rgf != ''"> RGF = #{rgf},</if>
|
||||
<if test="sfmr != null and sfmr != ''"> SFMR = #{sfmr},</if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> SFTPMR = #{sftpmr},</if>
|
||||
<if test="sl != null and sl != ''"> SL = #{sl},</if>
|
||||
<if test="slsx != null and slsx != ''"> SLSX = #{slsx},</if>
|
||||
<if test="slxx != null and slxx != ''"> SLXX = #{slxx},</if>
|
||||
<if test="ts != null and ts != ''"> TS = #{ts},</if>
|
||||
<if test="version != null and version != ''"> VERSION = #{version},</if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> WLBMID = #{wlbmid},</if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> ZDY1 = #{zdy1},</if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> ZDY10 = #{zdy10},</if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> ZDY11 = #{zdy11},</if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> ZDY12 = #{zdy12},</if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> ZDY13 = #{zdy13},</if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> ZDY14 = #{zdy14},</if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> ZDY15 = #{zdy15},</if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> ZDY16 = #{zdy16},</if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> ZDY17 = #{zdy17},</if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> ZDY18 = #{zdy18},</if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> ZDY19 = #{zdy19},</if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> ZDY2 = #{zdy2},</if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> ZDY20 = #{zdy20},</if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> ZDY3 = #{zdy3},</if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> ZDY4 = #{zdy4},</if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> ZDY5 = #{zdy5},</if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> ZDY6 = #{zdy6},</if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> ZDY7 = #{zdy7},</if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> ZDY8 = #{zdy8},</if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> ZDY9 = #{zdy9},</if>
|
||||
<if test="zt != null and zt != ''"> ZT = #{zt},</if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> ZYX1 = #{zyx1},</if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> ZYX2 = #{zyx2},</if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> ZYX3 = #{zyx3},</if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> ZYX4 = #{zyx4},</if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> ZYX5 = #{zyx5},</if>
|
||||
<if test="zzf != null and zzf != ''"> ZZF = #{zzf},</if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> BOMTYPE_FROM = #{bomtypeFrom},</if>
|
||||
<if test="cjrq != null and cjrq != ''"> CJRQ = #{cjrq},</if>
|
||||
<if test="cjsj != null and cjsj != ''"> CJSJ = #{cjsj},</if>
|
||||
<if test="createtype != null and createtype != ''"> CREATETYPE = #{createtype},</if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> GCBM_FROM = #{gcbmFrom},</if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> MODIFIEDTIME = #{modifiedtime},</if>
|
||||
<if test="modifier != null and modifier != ''"> MODIFIER = #{modifier},</if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> PK_BOMID_FROM = #{pkBomidFrom},</if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> PK_CORP_FROM = #{pkCorpFrom},</if>
|
||||
<if test="qrrid != null and qrrid != ''"> QRRID = #{qrrid},</if>
|
||||
<if test="qrrq != null and qrrq != ''"> QRRQ = #{qrrq},</if>
|
||||
<if test="qrsj != null and qrsj != ''"> QRSJ = #{qrsj},</if>
|
||||
</trim>
|
||||
where PK_BOMID = #{pkBomid}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" >
|
||||
update BD_BOM set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where PK_BOMID = #{pkBomid}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" >
|
||||
update BD_BOM set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="bblx != null and bblx != ''"> and BBLX = #{bblx} </if>
|
||||
<if test="bomlx != null and bomlx != ''"> and BOMLX = #{bomlx} </if>
|
||||
<if test="clf != null and clf != ''"> and CLF = #{clf} </if>
|
||||
<if test="creat != null and creat != ''"> and CREAT = #{creat} </if>
|
||||
<if test="dr != null and dr != ''"> and DR = #{dr} </if>
|
||||
<if test="fsl != null and fsl != ''"> and FSL = #{fsl} </if>
|
||||
<if test="fslsx != null and fslsx != ''"> and FSLSX = #{fslsx} </if>
|
||||
<if test="fslxx != null and fslxx != ''"> and FSLXX = #{fslxx} </if>
|
||||
<if test="gcbm != null and gcbm != ''"> and GCBM = #{gcbm} </if>
|
||||
<if test="gdfsl != null and gdfsl != ''"> and GDFSL = #{gdfsl} </if>
|
||||
<if test="gdsl != null and gdsl != ''"> and GDSL = #{gdsl} </if>
|
||||
<if test="hsl != null and hsl != ''"> and HSL = #{hsl} </if>
|
||||
<if test="jldwid != null and jldwid != ''"> and JLDWID = #{jldwid} </if>
|
||||
<if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
|
||||
<if test="mver != null and mver != ''"> and MVER = #{mver} </if>
|
||||
<if test="pkBomid != null and pkBomid != ''"> and PK_BOMID = #{pkBomid} </if>
|
||||
<if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
|
||||
<if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE = #{pkProduce} </if>
|
||||
<if test="rgf != null and rgf != ''"> and RGF = #{rgf} </if>
|
||||
<if test="sfmr != null and sfmr != ''"> and SFMR = #{sfmr} </if>
|
||||
<if test="sftpmr != null and sftpmr != ''"> and SFTPMR = #{sftpmr} </if>
|
||||
<if test="sl != null and sl != ''"> and SL = #{sl} </if>
|
||||
<if test="slsx != null and slsx != ''"> and SLSX = #{slsx} </if>
|
||||
<if test="slxx != null and slxx != ''"> and SLXX = #{slxx} </if>
|
||||
<if test="ts != null and ts != ''"> and TS = #{ts} </if>
|
||||
<if test="version != null and version != ''"> and VERSION = #{version} </if>
|
||||
<if test="wlbmid != null and wlbmid != ''"> and WLBMID = #{wlbmid} </if>
|
||||
<if test="zdy1 != null and zdy1 != ''"> and ZDY1 = #{zdy1} </if>
|
||||
<if test="zdy10 != null and zdy10 != ''"> and ZDY10 = #{zdy10} </if>
|
||||
<if test="zdy11 != null and zdy11 != ''"> and ZDY11 = #{zdy11} </if>
|
||||
<if test="zdy12 != null and zdy12 != ''"> and ZDY12 = #{zdy12} </if>
|
||||
<if test="zdy13 != null and zdy13 != ''"> and ZDY13 = #{zdy13} </if>
|
||||
<if test="zdy14 != null and zdy14 != ''"> and ZDY14 = #{zdy14} </if>
|
||||
<if test="zdy15 != null and zdy15 != ''"> and ZDY15 = #{zdy15} </if>
|
||||
<if test="zdy16 != null and zdy16 != ''"> and ZDY16 = #{zdy16} </if>
|
||||
<if test="zdy17 != null and zdy17 != ''"> and ZDY17 = #{zdy17} </if>
|
||||
<if test="zdy18 != null and zdy18 != ''"> and ZDY18 = #{zdy18} </if>
|
||||
<if test="zdy19 != null and zdy19 != ''"> and ZDY19 = #{zdy19} </if>
|
||||
<if test="zdy2 != null and zdy2 != ''"> and ZDY2 = #{zdy2} </if>
|
||||
<if test="zdy20 != null and zdy20 != ''"> and ZDY20 = #{zdy20} </if>
|
||||
<if test="zdy3 != null and zdy3 != ''"> and ZDY3 = #{zdy3} </if>
|
||||
<if test="zdy4 != null and zdy4 != ''"> and ZDY4 = #{zdy4} </if>
|
||||
<if test="zdy5 != null and zdy5 != ''"> and ZDY5 = #{zdy5} </if>
|
||||
<if test="zdy6 != null and zdy6 != ''"> and ZDY6 = #{zdy6} </if>
|
||||
<if test="zdy7 != null and zdy7 != ''"> and ZDY7 = #{zdy7} </if>
|
||||
<if test="zdy8 != null and zdy8 != ''"> and ZDY8 = #{zdy8} </if>
|
||||
<if test="zdy9 != null and zdy9 != ''"> and ZDY9 = #{zdy9} </if>
|
||||
<if test="zt != null and zt != ''"> and ZT = #{zt} </if>
|
||||
<if test="zyx1 != null and zyx1 != ''"> and ZYX1 = #{zyx1} </if>
|
||||
<if test="zyx2 != null and zyx2 != ''"> and ZYX2 = #{zyx2} </if>
|
||||
<if test="zyx3 != null and zyx3 != ''"> and ZYX3 = #{zyx3} </if>
|
||||
<if test="zyx4 != null and zyx4 != ''"> and ZYX4 = #{zyx4} </if>
|
||||
<if test="zyx5 != null and zyx5 != ''"> and ZYX5 = #{zyx5} </if>
|
||||
<if test="zzf != null and zzf != ''"> and ZZF = #{zzf} </if>
|
||||
<if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM = #{bomtypeFrom} </if>
|
||||
<if test="cjrq != null and cjrq != ''"> and CJRQ = #{cjrq} </if>
|
||||
<if test="cjsj != null and cjsj != ''"> and CJSJ = #{cjsj} </if>
|
||||
<if test="createtype != null and createtype != ''"> and CREATETYPE = #{createtype} </if>
|
||||
<if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM = #{gcbmFrom} </if>
|
||||
<if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME = #{modifiedtime} </if>
|
||||
<if test="modifier != null and modifier != ''"> and MODIFIER = #{modifier} </if>
|
||||
<if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM = #{pkBomidFrom} </if>
|
||||
<if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM = #{pkCorpFrom} </if>
|
||||
<if test="qrrid != null and qrrid != ''"> and QRRID = #{qrrid} </if>
|
||||
<if test="qrrq != null and qrrq != ''"> and QRRQ = #{qrrq} </if>
|
||||
<if test="qrsj != null and qrsj != ''"> and QRSJ = #{qrsj} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from BD_BOM where PK_BOMID = #{pkBomid}
|
||||
</delete>
|
||||
|
||||
<select id="queryBomVersion" parameterType="com.hzya.frame.plugin.lets.entity.BdBomEntity" resultMap="get-BdBomEntity-result">
|
||||
SELECT
|
||||
a.zt,
|
||||
a.cjsj,
|
||||
a.cjrq,
|
||||
a.qrrid,
|
||||
a.qrrq,
|
||||
a.qrsj,
|
||||
su2.user_name shrmc,
|
||||
a.modifier,
|
||||
a.modifiedtime,
|
||||
a.pk_corp,
|
||||
gcbm,
|
||||
pk_bomid,
|
||||
wlbmid,
|
||||
version,
|
||||
bblx,
|
||||
sfmr,
|
||||
sl,
|
||||
jldwid,
|
||||
rgf,
|
||||
clf,
|
||||
zzf,
|
||||
mver,
|
||||
bomlx,
|
||||
a.memo,
|
||||
zdy1,
|
||||
zdy2,
|
||||
zdy3,
|
||||
zdy4,
|
||||
zdy5,
|
||||
zdy6,
|
||||
zdy7,
|
||||
zdy8,
|
||||
zdy9,
|
||||
zdy10,
|
||||
zdy11,
|
||||
zdy12,
|
||||
zdy13,
|
||||
zdy14,
|
||||
zdy15,
|
||||
zdy16,
|
||||
zdy17,
|
||||
zdy18,
|
||||
zdy19,
|
||||
zdy20,
|
||||
b.invcode,
|
||||
b.invname,
|
||||
b.invspec,
|
||||
b.invtype,
|
||||
b.graphid,
|
||||
c.measname,
|
||||
pk_produce,
|
||||
a.ts,
|
||||
a.slsx,
|
||||
a.slxx,
|
||||
a.gdsl,
|
||||
a.sftpmr,
|
||||
a.fsl,
|
||||
a.fslxx,
|
||||
a.fslsx,
|
||||
a.gdfsl,
|
||||
a.hsl,
|
||||
d.pk_measdoc zjldwid,
|
||||
d.measname zjldwmc,
|
||||
a.creat,
|
||||
su.user_name,
|
||||
a.zyx1,
|
||||
a.zyx2,
|
||||
a.zyx3,
|
||||
a.zyx4,
|
||||
a.zyx5,
|
||||
pk_corp_from,
|
||||
gcbm_from,
|
||||
pk_bomid_from,
|
||||
bomtype_from,
|
||||
createtype
|
||||
FROM
|
||||
bd_bom a
|
||||
INNER JOIN bd_invbasdoc b ON a.wlbmid = b.pk_invbasdoc
|
||||
INNER JOIN bd_measdoc d ON b.pk_measdoc = d.pk_measdoc LEFT outer
|
||||
JOIN bd_measdoc c ON a.jldwid = c.pk_measdoc LEFT outer
|
||||
JOIN sm_user su ON a.creat = su.user_code LEFT outer
|
||||
JOIN sm_user su2 ON a.qrrid = su2.cuserid
|
||||
WHERE
|
||||
a.dr = 0
|
||||
AND wlbmid = #{wlbmid}
|
||||
AND gcbm = #{gcbm}
|
||||
ORDER BY
|
||||
version desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -56,7 +56,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.adjust.AdjustInPluginInitializer";
|
||||
return "adjust.AdjustInPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -295,8 +295,8 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
//cdispatcherid--收发类别
|
||||
List<OFSAdjustOrderSearchResponse.OFSAdjustOrder> ofsAdjustOrders = queryOfsAdjustOrders(ofsHeader.getRefOrderCode());
|
||||
if(ofsAdjustOrders.size()!=1){
|
||||
Assert.state(false,"根据调整入库单号:{},查询调整单:{},失败。不存在或不唯一。",ofsCode,ofsHeader.getRefOrderCode());
|
||||
if (ofsAdjustOrders.size() != 1) {
|
||||
Assert.state(false, "根据调整入库单号:{},查询调整单:{},失败。不存在或不唯一。", ofsCode, ofsHeader.getRefOrderCode());
|
||||
}
|
||||
String u8ReceiptType = ofsAdjustOrders.get(0).getHeader().getU8ReceiptType();
|
||||
// BdRdclEntity bdRdclEntity = new BdRdclEntity();
|
||||
|
@ -341,7 +341,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
|||
//两层判断,一层中台转发,一层u8c返回
|
||||
if ("false".equals(ztResult.getFlag())) {
|
||||
//转发失败
|
||||
response=JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
response = JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
Assert.state(false, "丽知:OFS调整入库--->U8C其它入库.中台转发失败,失败原因:{}", ztResult.getAttribute());
|
||||
}
|
||||
Attribute attribute = ztResult.getAttribute();
|
||||
|
@ -426,7 +426,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
all.addAll(stockinOrderSearchResponse1.getData());
|
||||
|
||||
count=stockinOrderSearchResponse1.getData().size();
|
||||
count = stockinOrderSearchResponse1.getData().size();
|
||||
}
|
||||
return all;
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ public class AdjustInPluginInitializer extends PluginBaseEntity {
|
|||
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
|
||||
interfaceParamDto.setApi("ofs.adjustOrder.search");
|
||||
interfaceParamDto.setData(JSON.toJSONString(queryOfsAdjustOrderRequestVO));
|
||||
OFSAdjustOrderSearchResponse ofsAdjustOrderSearchResponse =(OFSAdjustOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
OFSAdjustOrderSearchResponse ofsAdjustOrderSearchResponse = (OFSAdjustOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
System.out.println(ofsAdjustOrderSearchResponse);
|
||||
List<OFSAdjustOrderSearchResponse.OFSAdjustOrder> data = ofsAdjustOrderSearchResponse.getData();
|
||||
return data;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.adjust.AdjustOutPluginInitializer";
|
||||
return "adjust.AdjustOutPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -298,8 +298,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
//cdispatcherid--收发类别
|
||||
List<OFSAdjustOrderSearchResponse.OFSAdjustOrder> ofsAdjustOrders = queryOfsAdjustOrders(ofsHeader.getRefOrderCode());
|
||||
if(ofsAdjustOrders.size()!=1){
|
||||
Assert.state(false,"根据调整出库单号:{},查询调整单:{},失败。不存在或不唯一。",ofsCode,ofsHeader.getRefOrderCode());
|
||||
if (ofsAdjustOrders.size() != 1) {
|
||||
Assert.state(false, "根据调整出库单号:{},查询调整单:{},失败。不存在或不唯一。", ofsCode, ofsHeader.getRefOrderCode());
|
||||
}
|
||||
String u8ShipmentType = ofsAdjustOrders.get(0).getHeader().getU8ShipmentType();//出库类型
|
||||
|
||||
|
@ -350,7 +350,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
|||
//两层判断,一层中台转发,一层u8c返回
|
||||
if ("false".equals(ztResult.getFlag())) {
|
||||
//转发失败
|
||||
response=JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
response = JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
Assert.state(false, "丽知:OFS调整出库--->U8C其它出库.中台转发失败,失败原因:{}", ztResult.getAttribute());
|
||||
}
|
||||
Attribute attribute = ztResult.getAttribute();
|
||||
|
@ -407,7 +407,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
public List<StockoutOrderSearchResponse.StockoutOrder> queryOfsStockoutOrder(QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO) throws Exception {
|
||||
Long pageNo = 1L;
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> all=new ArrayList<>();
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> all = new ArrayList<>();
|
||||
|
||||
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
|
||||
interfaceParamDto.setApi("ofs.shipment.search");
|
||||
|
@ -433,7 +433,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
|||
SaleOutReturnMessageDto saleOutReturnMessageDto1 = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto);
|
||||
StockoutOrderSearchResponse stockoutOrderSearchResponse1 = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto1);
|
||||
all.addAll(stockoutOrderSearchResponse1.getData());
|
||||
count=stockoutOrderSearchResponse1.getData().size();
|
||||
count = stockoutOrderSearchResponse1.getData().size();
|
||||
}
|
||||
|
||||
return all;
|
||||
|
@ -507,7 +507,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity {
|
|||
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
|
||||
interfaceParamDto.setApi("ofs.adjustOrder.search");
|
||||
interfaceParamDto.setData(JSON.toJSONString(queryOfsAdjustOrderRequestVO));
|
||||
OFSAdjustOrderSearchResponse ofsAdjustOrderSearchResponse =(OFSAdjustOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
OFSAdjustOrderSearchResponse ofsAdjustOrderSearchResponse = (OFSAdjustOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
|
||||
System.out.println(ofsAdjustOrderSearchResponse);
|
||||
List<OFSAdjustOrderSearchResponse.OFSAdjustOrder> data = ofsAdjustOrderSearchResponse.getData();
|
||||
return data;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.base.CustdocAutoAllotPluginInitializer";
|
||||
return "base.CustdocAutoAllotPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -99,14 +99,13 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询客商基本档案
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<CustdocRequestVo> queryCustDoc() {
|
||||
List<CustdocRequestVo> custdocRequestVos=null;
|
||||
List<CustdocRequestVo> custdocRequestVos = null;
|
||||
try {
|
||||
String data = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocQuery"), "{}");
|
||||
CbdocResultVo cbdocResultVo = JSONObject.parseObject(data, CbdocResultVo.class);
|
||||
|
@ -123,11 +122,11 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
return custdocRequestVos;
|
||||
}
|
||||
|
||||
private List<CustdocRequestVo> filterData(List<CustdocRequestVo> list) {
|
||||
private List<CustdocRequestVo> filterData(List<CustdocRequestVo> list) {
|
||||
List<CustdocRequestVo> filterlist = new ArrayList<>();
|
||||
for (CustdocRequestVo requestVo : list) {
|
||||
//o转为
|
||||
if("N".equals(requestVo.getParentvo().getDef10())){
|
||||
//o转为
|
||||
if ("N".equals(requestVo.getParentvo().getDef10())) {
|
||||
filterlist.add(requestVo);
|
||||
}
|
||||
}
|
||||
|
@ -175,12 +174,12 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
try {
|
||||
|
||||
ArrayList<CustDocAssginVo> assginvolist = new ArrayList<>();
|
||||
List<BdCorpEntity> bdCorpEntities=null;
|
||||
List<BdCorpEntity> bdCorpEntities = null;
|
||||
//查询公司档案
|
||||
try {
|
||||
String corpresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("bdcorpQuery"), "{}");
|
||||
CbdocResultVo cbdocResultVo = JSONObject.parseObject(corpresponse, CbdocResultVo.class);
|
||||
if(!"success".equals(cbdocResultVo.getStatus())){
|
||||
if (!"success".equals(cbdocResultVo.getStatus())) {
|
||||
Assert.state(false, "查询公司档案失败");
|
||||
}
|
||||
String datastring = cbdocResultVo.getData();
|
||||
|
@ -193,7 +192,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
for(BdCorpEntity bdCorpEntity:bdCorpEntities){
|
||||
for (BdCorpEntity bdCorpEntity : bdCorpEntities) {
|
||||
CustDocAssginVo custDocAssginVo = new CustDocAssginVo();
|
||||
custDocAssginVo.setPk_cubasdoc(custcode);
|
||||
//TODO
|
||||
|
|
|
@ -51,7 +51,7 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.base.GoodsAutoAllotPluginInitializer";
|
||||
return "base.GoodsAutoAllotPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -163,12 +163,12 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntityList = bdInvbasdocDao.query(bdInvbasdocEntity);
|
||||
if (bdInvbasdocEntityList.size() == 0) {
|
||||
Assert.state(false, "U8C->存货基本档案自动分配全公司,按日期:{} - {},未查到存货基本档案。", startTime,endTime);
|
||||
Assert.state(false, "U8C->存货基本档案自动分配全公司,按日期:{} - {},未查到存货基本档案。", startTime, endTime);
|
||||
}
|
||||
//过滤日志
|
||||
List<BdInvbasdocEntity> filterInvbasdocList = filter(bdInvbasdocEntityList);
|
||||
if (filterInvbasdocList.size() == 0 || filterInvbasdocList == null) {
|
||||
Assert.state(false, "U8C->存货基本档案自动分配全公司,按日期:{} - {},已被分配,请检查。", startTime,endTime);
|
||||
Assert.state(false, "U8C->存货基本档案自动分配全公司,按日期:{} - {},已被分配,请检查。", startTime, endTime);
|
||||
}
|
||||
//推送:自动分配
|
||||
implement(filterInvbasdocList);
|
||||
|
|
|
@ -72,7 +72,7 @@ public class SKUClassPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.base.SKUClassPluginInitializer";
|
||||
return "base.SKUClassPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.base.GoodsPluginInitializer";
|
||||
return "base.GoodsPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -150,15 +150,15 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
queryOfsSKURequestVO.setLastUpdated_start(startTimeStr);
|
||||
queryOfsSKURequestVO.setLastUpdated_end(endTimeStr);
|
||||
List<OFSSKUSearchResponse.OFSSKU> ofsskuList = queryOfsSKUs(queryOfsSKURequestVO);
|
||||
if(ofsskuList.size()==0){
|
||||
return;
|
||||
if (ofsskuList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
//分组排序,
|
||||
List<OFSSKUSearchResponse.OFSSKU> sortSkuList = groupAndSort(ofsskuList);
|
||||
|
||||
//过滤日志
|
||||
List<OFSSKUSearchResponse.OFSSKU> filterSkus = filterData(sortSkuList);
|
||||
if(filterSkus.size()==0){
|
||||
if (filterSkus.size() == 0) {
|
||||
return;
|
||||
}
|
||||
//具体实现
|
||||
|
@ -182,7 +182,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
QueryOfsSKURequestVO queryOfsSKURequestVO = new QueryOfsSKURequestVO();
|
||||
queryOfsSKURequestVO.setCode(split[0]);
|
||||
List<OFSSKUSearchResponse.OFSSKU> ofsskuList = queryOfsSKUs(queryOfsSKURequestVO);
|
||||
if(ofsskuList.size()==0){
|
||||
if (ofsskuList.size() == 0) {
|
||||
Assert.state(false, "根据OFS SKU主档编码:{},未查询到SKU主档,请检查入参或者OFS SKU主档。", split[0]);
|
||||
}
|
||||
//分组排序,
|
||||
|
@ -190,7 +190,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
//过滤日志
|
||||
List<OFSSKUSearchResponse.OFSSKU> filterSkus = filterData(sortSkuList);
|
||||
if(filterSkus.size()==0){
|
||||
if (filterSkus.size() == 0) {
|
||||
Assert.state(false, "根据OFS SKU主档编码:{},已被推送成功,请勿重新推送。", split[0]);
|
||||
}
|
||||
//具体实现
|
||||
|
@ -216,16 +216,16 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
queryOfsSKURequestVO.setLastUpdated_start(start);
|
||||
queryOfsSKURequestVO.setLastUpdated_end(end);
|
||||
List<OFSSKUSearchResponse.OFSSKU> ofsskuList = queryOfsSKUs(queryOfsSKURequestVO);
|
||||
if(ofsskuList.size()==0){
|
||||
Assert.state(false,"根据期间:{} - {} 内,未查询到OFS系统中SKU主档信息,请检查。");
|
||||
if (ofsskuList.size() == 0) {
|
||||
Assert.state(false, "根据期间:{} - {} 内,未查询到OFS系统中SKU主档信息,请检查。");
|
||||
}
|
||||
//分组排序,
|
||||
List<OFSSKUSearchResponse.OFSSKU> sortSkuList = groupAndSort(ofsskuList);
|
||||
|
||||
//过滤日志
|
||||
List<OFSSKUSearchResponse.OFSSKU> filterSkus = filterData(sortSkuList);
|
||||
if(filterSkus.size()==0){
|
||||
Assert.state(false,"根据期间:{} - {} 内询到OFS系统中SKU主档信息已全部推送,请勿重新推送。");
|
||||
if (filterSkus.size() == 0) {
|
||||
Assert.state(false, "根据期间:{} - {} 内询到OFS系统中SKU主档信息已全部推送,请勿重新推送。");
|
||||
}
|
||||
//具体实现
|
||||
implement(filterSkus);
|
||||
|
@ -239,13 +239,14 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
* 过滤成功日志
|
||||
* rootAppPk
|
||||
* [code]_[lastUpdated]
|
||||
*
|
||||
* @param ofsskuList
|
||||
* @return
|
||||
*/
|
||||
public List<OFSSKUSearchResponse.OFSSKU> filterData(List<OFSSKUSearchResponse.OFSSKU> ofsskuList){
|
||||
public List<OFSSKUSearchResponse.OFSSKU> filterData(List<OFSSKUSearchResponse.OFSSKU> ofsskuList) {
|
||||
List<OFSSKUSearchResponse.OFSSKU> filterSkus = new ArrayList<>();
|
||||
for (OFSSKUSearchResponse.OFSSKU ofssku : ofsskuList) {
|
||||
String rootAppPk = ofssku.getCode()+"_"+ofssku.getLastUpdated();
|
||||
String rootAppPk = ofssku.getCode() + "_" + ofssku.getLastUpdated();
|
||||
boolean isExis = true;
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
|
||||
|
@ -268,10 +269,10 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
* 注意:
|
||||
* 可能一家公司封存则,则取消分配这家公司的存货管理档案
|
||||
*/
|
||||
public void implement(List<OFSSKUSearchResponse.OFSSKU> filterSkus){
|
||||
public void implement(List<OFSSKUSearchResponse.OFSSKU> filterSkus) {
|
||||
for (OFSSKUSearchResponse.OFSSKU sku : filterSkus) {
|
||||
|
||||
String PkInvbasdoc= "";
|
||||
String PkInvbasdoc = "";
|
||||
String url = "";
|
||||
String mapStr = "";
|
||||
String format = sku.getLastUpdated();
|
||||
|
@ -284,14 +285,14 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
//查询是否存在,返回pkInvbasdoc,如果有则是修改,null则为新增
|
||||
//查询该id再u8c是否有数据,没有则是新增,有则是修改 存货基本档案:def2-》ofs主键
|
||||
PkInvbasdoc=queryInvbasDocIsExist(sku);
|
||||
PkInvbasdoc = queryInvbasDocIsExist(sku);
|
||||
if (PkInvbasdoc != null) {
|
||||
//修改
|
||||
parentvo.setPk_invbasdoc(PkInvbasdoc);
|
||||
url=OverallConstant.getOverAllValue("bdinvclUpdateCode");
|
||||
url = OverallConstant.getOverAllValue("bdinvclUpdateCode");
|
||||
} else if (PkInvbasdoc == null) {
|
||||
//新增
|
||||
url=OverallConstant.getOverAllValue("bdinvclSaveCode");
|
||||
url = OverallConstant.getOverAllValue("bdinvclSaveCode");
|
||||
}
|
||||
|
||||
//def2 ofs id
|
||||
|
@ -325,14 +326,14 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
invbasdoc.setParentvo(parentvo);
|
||||
//子表,暂时没有要传的值
|
||||
String jsonStr = JSONUtil.toJsonStr(invbasdoc);
|
||||
mapStr= "{\"invbasdoc\":" + jsonStr + "}";
|
||||
mapStr = "{\"invbasdoc\":" + jsonStr + "}";
|
||||
ZTResult ztResult = pushU8CByApiCode.pushByCode(url, mapStr);
|
||||
//两层判断,一层中台转发,一层u8c返回
|
||||
Attribute attribute = ztResult.getAttribute();
|
||||
|
||||
if ("false".equals(ztResult.getFlag())) {
|
||||
//转发失败
|
||||
response=JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
response = JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
Assert.state(false, "丽知:OFS货品档案--->U8C货品档案,中台转发失败,失败原因:{}", ztResult.getAttribute());
|
||||
}
|
||||
boolean isSuccess = false;
|
||||
|
@ -354,13 +355,13 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(attribute.getData());
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode()+"_"+sku.getLastUpdated());
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode() + "_" + sku.getLastUpdated());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(sku.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
integrationTaskLivingDetailsEntity.setDef1(sku.getId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("推送U8C,丽知:OFS货品档案--->U8C货品档案失败,失败原因:" + e);
|
||||
//失败
|
||||
|
@ -373,7 +374,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(format);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode()+"_"+sku.getLastUpdated());
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(sku.getCode() + "_" + sku.getLastUpdated());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(sku.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
integrationTaskLivingDetailsEntity.setDef1(sku.getId());
|
||||
|
@ -384,65 +385,64 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
}
|
||||
|
||||
public String queryInvbasDocIsExist(OFSSKUSearchResponse.OFSSKU sku){
|
||||
String PkInvbasdoc="";
|
||||
public String queryInvbasDocIsExist(OFSSKUSearchResponse.OFSSKU sku) {
|
||||
String PkInvbasdoc = "";
|
||||
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
||||
bdInvbasdocEntity.setDr(0L);
|
||||
bdInvbasdocEntity.setDef2(sku.getId());
|
||||
bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntityList = bdInvbasdocDao.query(bdInvbasdocEntity);//根据ofs id
|
||||
if(bdInvbasdocEntityList.size()==0){
|
||||
if (bdInvbasdocEntityList.size() == 0) {
|
||||
bdInvbasdocEntity.setDef2(null);
|
||||
bdInvbasdocEntity.setInvcode(sku.getCode());
|
||||
bdInvbasdocEntity.setInvname(sku.getName());
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntityList1 = bdInvbasdocDao.query(bdInvbasdocEntity);//根据编码+名称
|
||||
if(bdInvbasdocEntityList1.size()==0){
|
||||
if (bdInvbasdocEntityList1.size() == 0) {
|
||||
bdInvbasdocEntity.setInvname(null);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntityList2 = bdInvbasdocDao.query(bdInvbasdocEntity);//进查询编码
|
||||
if (bdInvbasdocEntityList2.size() == 0) {//编码不存在
|
||||
return null;
|
||||
} else if (bdInvbasdocEntityList2.size() == 1) {//编码存在
|
||||
PkInvbasdoc=bdInvbasdocEntityList2.get(0).getPkInvbasdoc();//主键
|
||||
PkInvbasdoc = bdInvbasdocEntityList2.get(0).getPkInvbasdoc();//主键
|
||||
}
|
||||
}else if(bdInvbasdocEntityList1.size()==1){
|
||||
} else if (bdInvbasdocEntityList1.size() == 1) {
|
||||
//修改
|
||||
PkInvbasdoc=bdInvbasdocEntityList1.get(0).getPkInvbasdoc();//主键
|
||||
PkInvbasdoc = bdInvbasdocEntityList1.get(0).getPkInvbasdoc();//主键
|
||||
}
|
||||
}else if(bdInvbasdocEntityList.size()==1){
|
||||
} else if (bdInvbasdocEntityList.size() == 1) {
|
||||
//修改
|
||||
PkInvbasdoc=bdInvbasdocEntityList.get(0).getPkInvbasdoc();//主键
|
||||
}else {
|
||||
PkInvbasdoc = bdInvbasdocEntityList.get(0).getPkInvbasdoc();//主键
|
||||
} else {
|
||||
//异常,存在多个
|
||||
Assert.state(false,"SKU主档编码:{},id:{}。U8C存货基本档案def2(OFS中SKU主档id)存在多个,请检查。",sku.getCode(),sku.getId());
|
||||
Assert.state(false, "SKU主档编码:{},id:{}。U8C存货基本档案def2(OFS中SKU主档id)存在多个,请检查。", sku.getCode(), sku.getId());
|
||||
}
|
||||
return PkInvbasdoc;
|
||||
return PkInvbasdoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按code分组,并按lastUpdated排序
|
||||
*
|
||||
* @param ofsskuList
|
||||
* @return
|
||||
*/
|
||||
public List<OFSSKUSearchResponse.OFSSKU> groupAndSort(List<OFSSKUSearchResponse.OFSSKU> ofsskuList){
|
||||
List<OFSSKUSearchResponse.OFSSKU> sortSkus=new ArrayList<>();
|
||||
public List<OFSSKUSearchResponse.OFSSKU> groupAndSort(List<OFSSKUSearchResponse.OFSSKU> ofsskuList) {
|
||||
List<OFSSKUSearchResponse.OFSSKU> sortSkus = new ArrayList<>();
|
||||
|
||||
//根据code进行分组
|
||||
Map<String, List<OFSSKUSearchResponse.OFSSKU>> collectMapByCode =
|
||||
ofsskuList.stream().collect(Collectors.groupingBy(OFSSKUSearchResponse.OFSSKU::getCode));
|
||||
Map<String, List<OFSSKUSearchResponse.OFSSKU>> collectMapByCode = ofsskuList.stream().collect(Collectors.groupingBy(OFSSKUSearchResponse.OFSSKU::getCode));
|
||||
|
||||
collectMapByCode.forEach((k,v)->{
|
||||
collectMapByCode.forEach((k, v) -> {
|
||||
//降序排序 (从新到旧),根据最后修改时间倒排
|
||||
List<OFSSKUSearchResponse.OFSSKU> sorted =
|
||||
v.stream().sorted(Comparator.comparing(OFSSKUSearchResponse.OFSSKU::getLastUpdated).reversed()).collect(Collectors.toList());
|
||||
List<OFSSKUSearchResponse.OFSSKU> sorted = v.stream().sorted(Comparator.comparing(OFSSKUSearchResponse.OFSSKU::getLastUpdated).reversed()).collect(Collectors.toList());
|
||||
|
||||
//排除status==0的
|
||||
for (int i = 0; i < sorted.size(); i++) {
|
||||
if("0".equals(sorted.get(i).getStatus())){
|
||||
if ("0".equals(sorted.get(i).getStatus())) {
|
||||
sorted.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
if(sorted.size()!=0){
|
||||
if (sorted.size() != 0) {
|
||||
sortSkus.add(sorted.get(0));//只取最后修改的一个
|
||||
}
|
||||
});
|
||||
|
@ -452,7 +452,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
/**
|
||||
* 封存存货基本档案
|
||||
*/
|
||||
public void sealImplement(String code){
|
||||
public void sealImplement(String code) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -493,6 +493,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
return all;
|
||||
}
|
||||
|
||||
private InvBasDocVO resultDataHandle(String resultData) {
|
||||
try {
|
||||
if (resultData != null && !"".equals(resultData)) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "ShopPluginInitializer";
|
||||
return "base.ShopPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "SupplierPluginInitializer";
|
||||
return "base.SupplierPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,10 +13,8 @@ import com.hzya.frame.plugin.lets.dao.*;
|
|||
import com.hzya.frame.plugin.lets.entity.*;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||
import com.hzya.frame.plugin.lets.util.OfsStandardUtil;
|
||||
import com.hzya.frame.plugin.lets.util.OnlyImplementProxyOrderUtil;
|
||||
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
|
||||
import com.hzya.frame.plugin.lets.util.RdclUtil;
|
||||
import com.hzya.frame.plugin.lets.util.*;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||
|
@ -70,9 +68,27 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
@Autowired
|
||||
private IScOrderBDao iScOrderBDao;
|
||||
|
||||
@Autowired
|
||||
private IBdPurorgDao iBdPurorgDao;
|
||||
|
||||
@Autowired
|
||||
private IBdCubasdocDao iBdCubasdocDao;
|
||||
|
||||
@Autowired
|
||||
private IBdCumandocDao iBdCumandocDao;
|
||||
|
||||
@Autowired
|
||||
private IBdInvbasdocDao iBdInvbasdocDao;
|
||||
|
||||
@Autowired
|
||||
private OnlyImplementProxyOrderUtil onlyImplementProxyOrder;
|
||||
|
||||
@Autowired
|
||||
private IBdBomDao iBdBomDao;
|
||||
|
||||
@Autowired
|
||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
|
@ -85,17 +101,17 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.outsourc.ConsignmachiningIn";
|
||||
return "outsourc.ConsignmachiningIn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "OFS采购入库单生成U8C委外加工入库(委外采购入库)";
|
||||
return "OFS采购入库单生成U8C委外订单(委外采购入库)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "OFS采购入库单生成U8C委外加工入库(委外采购入库)";
|
||||
return "OFS采购入库单生成U8C委外订单(委外采购入库)";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,6 +130,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
* @author liuyang
|
||||
*/
|
||||
public void startImplement(String startTime, String endTime) {
|
||||
long startMillis = System.currentTimeMillis();
|
||||
String threadNameStrStart = StrUtil.format("开始(委外采购)OFS采购入库单生成U8C委外加工入库 开始时间:{} 结束时间:{}", startTime, endTime);
|
||||
logger.info(threadNameStrStart);
|
||||
|
||||
|
@ -148,7 +165,8 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
} catch (Exception e) {
|
||||
logger.error("thread.join()异常", e);
|
||||
}
|
||||
String threadNameStrEnd = StrUtil.format("结束(委外采购)OFS采购入库单生成U8C委外加工入库 开始时间:{} 结束时间:{}", startTime, endTime);
|
||||
long endMillis = System.currentTimeMillis();
|
||||
String threadNameStrEnd = StrUtil.format("结束(委外采购)OFS采购入库单生成U8C委外加工入库 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
|
||||
logger.info(threadNameStrEnd);
|
||||
}
|
||||
|
||||
|
@ -158,6 +176,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
* @author liuyang
|
||||
*/
|
||||
public void startImplement(String code) {
|
||||
long startMillis = System.currentTimeMillis();
|
||||
String threadNameStrStart = StrUtil.format("开始(委外采购)OFS采购入库单生成U8C委外加工入库 OFS采购入库单号:{}", code);
|
||||
logger.info(threadNameStrStart);
|
||||
|
||||
|
@ -191,7 +210,8 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
} catch (Exception e) {
|
||||
logger.error("thread.join()异常", e);
|
||||
}
|
||||
String threadNameStrEnd = StrUtil.format("结束(委外采购)OFS采购入库单生成U8C委外加工入库 OFS采购入库单号:{}", code);
|
||||
long endMillis = System.currentTimeMillis();
|
||||
String threadNameStrEnd = StrUtil.format("结束(委外采购)OFS采购入库单生成U8C委外加工入库 OFS采购入库单号:{}", code, (endMillis - startMillis));
|
||||
logger.info(threadNameStrEnd);
|
||||
}
|
||||
|
||||
|
@ -234,98 +254,139 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
List<ConsignmachiningInSonDto> consignmachiningInSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList);
|
||||
// 查询采购收发类别
|
||||
BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("105");
|
||||
//代理委外入库业务流程
|
||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow();
|
||||
|
||||
if (consignmachiningInSonDtos != null && consignmachiningInSonDtos.size() > 0) {
|
||||
for (int i = 0; i < consignmachiningInSonDtos.size(); i++) {
|
||||
ConsignmachiningInSonDto consignmachiningInSonDto = consignmachiningInSonDtos.get(i);
|
||||
// StockinOrderSearchResponse.StockinOrder.StockinH header = consignmachiningInSonDto.getHeader();
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = consignmachiningInSonDto.getDetails();
|
||||
|
||||
String generateBusinessDate = createGenerateBusinessDate(consignmachiningInSonDto); //生成业务日期
|
||||
OfsPoOrderData ofsPoOrderData = consignmachiningInSonDto.getOfsPoOrderData();//OFS采购订单
|
||||
ScOrderEntity scOrderEntity = consignmachiningInSonDto.getScOrderEntity();//U8C委外订单
|
||||
BdCorpEntity bdCorpEntity = consignmachiningInSonDto.getBdCorpEntity();//公司
|
||||
BdCalbodyEntity bdCalbodyEntity = consignmachiningInSonDto.getBdCalbodyEntity();//库存组织
|
||||
BdStordocEntity bdStordocEntity = consignmachiningInSonDto.getBdStordocEntity();//仓库
|
||||
String generateBusinessDate = null;
|
||||
try {
|
||||
// StockinOrderSearchResponse.StockinOrder.StockinH header = consignmachiningInSonDto.getHeader();
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = consignmachiningInSonDto.getDetails();
|
||||
|
||||
generateBusinessDate = createGenerateBusinessDate(consignmachiningInSonDto); //生成业务日期
|
||||
OfsPoOrderData ofsPoOrderData = consignmachiningInSonDto.getOfsPoOrderData();//OFS采购订单
|
||||
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> ofsPoOrderDataDetails = ofsPoOrderData.getDetails();
|
||||
|
||||
// ScOrderEntity scOrderEntity = consignmachiningInSonDto.getScOrderEntity();//U8C委外订单
|
||||
BdCorpEntity bdCorpEntity = consignmachiningInSonDto.getBdCorpEntity();//公司
|
||||
BdCalbodyEntity bdCalbodyEntity = consignmachiningInSonDto.getBdCalbodyEntity();//库存组织
|
||||
BdPurorgEntity bdPurorgEntity = consignmachiningInSonDto.getBdPurorgEntity();//采购组织
|
||||
// BdStordocEntity bdStordocEntity = consignmachiningInSonDto.getBdStordocEntity();//仓库
|
||||
// StockinOrderSearchResponse.StockinOrder.StockinH header1 = consignmachiningInSonDto.getHeader();
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details1 = consignmachiningInSonDto.getDetails();//OFS采购入库单
|
||||
List<ScOrderBEntity> scOrderBEntityList = consignmachiningInSonDto.getScOrderBEntityList();//U8C委外订单明细行主键
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details1 = consignmachiningInSonDto.getDetails();//OFS采购入库单明细行
|
||||
// List<ScOrderBEntity> scOrderBEntityList = consignmachiningInSonDto.getScOrderBEntityList();//U8C委外订单明细行主键
|
||||
BdCubasdocEntity bdCubasdocEntity = consignmachiningInSonDto.getBdCubasdocEntity();//客商基本档案
|
||||
BdCumandocEntity bdCumandocEntity = consignmachiningInSonDto.getBdCumandocEntity();//客商管理档案
|
||||
BdStordocEntity bdStordocEntity = consignmachiningInSonDto.getBdStordocEntity();//表体仓库
|
||||
|
||||
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> ofsPoOrderDataDetails = ofsPoOrderData.getDetails();
|
||||
//委外订单表头
|
||||
ScorderHeadDto poOrderParentDto = new ScorderHeadDto();
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
|
||||
poOrderParentDto.setCoperator("0001A110000000000U3D");
|
||||
poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());
|
||||
poOrderParentDto.setCgiveinvoicevendor(bdCumandocEntity.getPkCumandoc());
|
||||
poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());
|
||||
poOrderParentDto.setDorderdate(generateBusinessDate);
|
||||
|
||||
// 代理委外入库业务流程
|
||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow(bdCorpEntity.getPkCorp());
|
||||
poOrderParentDto.setPk_defdoc3(bdRdclEntity.getPkRdcl());//收发类别
|
||||
poOrderParentDto.setVdef3(bdRdclEntity.getRdname());
|
||||
poOrderParentDto.setVdef17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
poOrderParentDto.setVdef19(consignmachiningInSonDto.getCode());//原单单号
|
||||
poOrderParentDto.setVdef20(consignmachiningInSonDto.getId());//原单主键
|
||||
|
||||
//委外入库表头
|
||||
ConsignmachiningInHeadDto poOrderParentDto = new ConsignmachiningInHeadDto();
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());
|
||||
poOrderParentDto.setCoperatorid("0001A110000000000U3D");
|
||||
poOrderParentDto.setCwarehouseid(bdStordocEntity.getPkStordoc());
|
||||
poOrderParentDto.setPk_calbody(bdCalbodyEntity.getPkCalbody());
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
|
||||
poOrderParentDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
|
||||
poOrderParentDto.setDbilldate(generateBusinessDate);//入库日期
|
||||
//委外入库表头明细行
|
||||
List<ScorderBodyDto> scorderBodyDtoArrayList = new ArrayList<>();
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
|
||||
//匹配U8C采购订单明细行
|
||||
// ScOrderBEntity u8cPoOrderDetail = findOfsPoOrderDetailAndU8cPoOrderDetail(stockinB, ofsPoOrderData, scOrderBEntityList);
|
||||
//通过O采购订单入库单明细行,联查OFS采购订单明细行
|
||||
OfsPoOrderDetails ofsPoOrderDetailRowTraget = findOfsPoOrderDetailRowTraget(stockinB, ofsPoOrderData);
|
||||
//查询存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
||||
//存货基础档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity = queryStockBasicArchives(bdInvmandocEntity.getPkInvmandoc(), bdCorpEntity.getPkCorp());
|
||||
//存货对应的BOM
|
||||
List<BdBomEntity> bomVersion = getBomVersion(bdCalbodyEntity.getPkCalbody(), bdInvbasdocEntity.getPkInvbasdoc());
|
||||
|
||||
//委外入库表头明细行
|
||||
List<ConsignmachiningInBodyDto> consignmachiningInBodyDtoArrayList = new ArrayList<>();
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
|
||||
//匹配U8C采购订单明细行
|
||||
ScOrderBEntity u8cPoOrderDetail = findOfsPoOrderDetailAndU8cPoOrderDetail(stockinB, ofsPoOrderData, scOrderBEntityList);
|
||||
//通过O采购订单入库单明细行,联查OFS采购订单明细行
|
||||
OfsPoOrderDetails ofsPoOrderDetailRowTraget = findOfsPoOrderDetailRowTraget(stockinB, ofsPoOrderData);
|
||||
//查询存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
||||
//计算含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
String receivedQty = stockinB.getReceivedQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetailRowTraget.getFulfillAmount();//实收累计总金额
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算委外订单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
}
|
||||
|
||||
//计算含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
String receivedQty = stockinB.getReceivedQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetailRowTraget.getFulfillAmount();//实收累计总金额
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采购入库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
ScorderBodyDto scorderBodyDto = new ScorderBodyDto();
|
||||
scorderBodyDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货
|
||||
scorderBodyDto.setNordernum(stockinB.getReceivedQty());//数量
|
||||
scorderBodyDto.setNoriginalnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//净单价
|
||||
scorderBodyDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//仓库
|
||||
scorderBodyDto.setBomversion(bomVersion.get(0).getVersion());//BOM版本
|
||||
scorderBodyDto.setDplanarrvdate(generateBusinessDate);//计划到货日期
|
||||
scorderBodyDtoArrayList.add(scorderBodyDto);
|
||||
}
|
||||
|
||||
ConsignmachiningInBodyDto consignmachiningInBodyDto = new ConsignmachiningInBodyDto();
|
||||
consignmachiningInBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());//存货
|
||||
//TODO 测试
|
||||
consignmachiningInBodyDto.setNinnum("1");
|
||||
// consignmachiningInBodyDto.setNinnum(new BigDecimal(stockinB.getReceivedQty()).stripTrailingZeros().toPlainString());//实收数量
|
||||
consignmachiningInBodyDto.setNprice(noriginalcurprice.stripTrailingZeros().toPlainString());//单价(含税单价)
|
||||
consignmachiningInBodyDto.setCsourcetype("61");//来源单据类型
|
||||
consignmachiningInBodyDto.setVsourcerowno(u8cPoOrderDetail.getCrowno());//来源单据行号
|
||||
consignmachiningInBodyDto.setVsourcebillcode(scOrderEntity.getVordercode());//来源单据号
|
||||
consignmachiningInBodyDto.setWriteofftype("按备料发料核销");//核销方式
|
||||
consignmachiningInBodyDtoArrayList.add(consignmachiningInBodyDto);
|
||||
List<ScorderDto> scorderDtoArrayList = new ArrayList<>();
|
||||
ScorderDto scorderDto = new ScorderDto();
|
||||
scorderDto.setParentvo(poOrderParentDto);
|
||||
scorderDto.setChildrenvo(scorderBodyDtoArrayList);
|
||||
scorderDtoArrayList.add(scorderDto);
|
||||
|
||||
Map<String, List<ScorderDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("OrderVO", scorderDtoArrayList);
|
||||
IcGeneralHResultDto icGeneralHResultDto = sendU8cScorder(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String cgeneralhid = null;
|
||||
String vbillcode = null;
|
||||
IcGeneralHResultHeadDto parentvo = icGeneralHResultDto.getParentvo();
|
||||
List<IcGeneralHResultBodyDto> childrenvo = icGeneralHResultDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
cgeneralhid = parentvo.getCgeneralhid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vbillcode = parentvo.getVbillcode();
|
||||
}
|
||||
logger.info("推送U8C委外入库成功!委外入库单主键:{} 委外入库单编码:{}", cgeneralhid, vbillcode);
|
||||
|
||||
// 成功记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(consignmachiningInSonDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(icGeneralHResultDto));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(consignmachiningInSonDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(consignmachiningInSonDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
} catch (Exception e) {
|
||||
logger.error("推送U8C委外订单失败", e);
|
||||
|
||||
String message = e.getMessage();
|
||||
if (message == null) {
|
||||
message = "未知错误";
|
||||
}
|
||||
// 失败记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(consignmachiningInSonDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(message));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(consignmachiningInSonDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(consignmachiningInSonDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
List<ConsignmachiningInHeadBodyDto> consignmachiningInHeadBodyDtoArrayList = new ArrayList<>();
|
||||
|
||||
ConsignmachiningInHeadBodyDto consignmachiningInHeadBodyDto = new ConsignmachiningInHeadBodyDto();
|
||||
consignmachiningInHeadBodyDto.setParentvo(poOrderParentDto);
|
||||
consignmachiningInHeadBodyDto.setChildrenvo(consignmachiningInBodyDtoArrayList);
|
||||
consignmachiningInHeadBodyDtoArrayList.add(consignmachiningInHeadBodyDto);
|
||||
|
||||
Map<String, List<ConsignmachiningInHeadBodyDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("GeneralBillVO", consignmachiningInHeadBodyDtoArrayList);
|
||||
//TODO 2024年8月26日 14:41:46 委外入库核销方式传不了!已经提交总部
|
||||
//TODO 2024年8月26日 14:42:19 无法超委外订单数量入库!已经提交给总部
|
||||
IcGeneralHResultDto icGeneralHResultDto = sendU8cConsignmachiningIn(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String cgeneralhid = null;
|
||||
String vbillcode = null;
|
||||
IcGeneralHResultHeadDto parentvo = icGeneralHResultDto.getParentvo();
|
||||
List<IcGeneralHResultBodyDto> childrenvo = icGeneralHResultDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
cgeneralhid = parentvo.getCgeneralhid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vbillcode = parentvo.getVbillcode();
|
||||
}
|
||||
logger.info("推送U8C委外入库成功!委外入库单主键:{} 委外入库单编码:{}", cgeneralhid, vbillcode);
|
||||
}
|
||||
} else {
|
||||
logger.info("poOrderSonDto.size为0!");
|
||||
|
@ -365,27 +426,84 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
}
|
||||
|
||||
//2024年8月25日 09:42:58 查询委外订单,如果这一步报错,后续的逻辑就没有必要执行了
|
||||
String ofsId = ofsPoOrderDataHeader.getId();
|
||||
Assert.notNull(ofsId, "通过接口查询到OFS采购订单,但是没有采购订单主键,业务逻辑无法完成");
|
||||
ScOrderEntity scOrderEntity = queryScOrder(ofsId);
|
||||
// String ofsId = ofsPoOrderDataHeader.getId();
|
||||
// Assert.notNull(ofsId, "通过接口查询到OFS采购订单,但是没有采购订单主键,业务逻辑无法完成");
|
||||
// ScOrderEntity scOrderEntity = queryScOrder(ofsId);
|
||||
|
||||
//2024年8月25日 14:15:45 根据委外订单id,查询委外订单表体明细行
|
||||
List<ScOrderBEntity> scOrderBEntityList = queryScOrderDetail(scOrderEntity.getCorderid());
|
||||
// List<ScOrderBEntity> scOrderBEntityList = queryScOrderDetail(scOrderEntity.getCorderid());
|
||||
|
||||
//2024年8月25日 10:09:20 委外入库公司,取委外订单上的公司,已经和妮姐确认,没有必要通过O的公司转换,因为不存在跨组织的问题
|
||||
Assert.notNull(scOrderEntity.getPkCorp(), "O表头公司不能为空");
|
||||
//委外订单表头公司
|
||||
String companyCode = header.getCompanyCode();
|
||||
Assert.notNull(companyCode, "O表头公司不能为空(物理货主)");
|
||||
BdCorpEntity bdCorpEntity = new BdCorpEntity();
|
||||
bdCorpEntity.setDr(0);
|
||||
bdCorpEntity.setDataSourceCode("lets_u8c");
|
||||
bdCorpEntity.setPkCorp(scOrderEntity.getPkCorp());
|
||||
bdCorpEntity.setUnitcode(companyCode);
|
||||
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
|
||||
if (bdCorpEntityList.size() == 0) {
|
||||
Assert.state(false, "根据委外订单公司主键:{},无法匹配到委外入库单", scOrderEntity.getPkCorp());
|
||||
Assert.state(false, "根据O货主编码{},无法匹配到U8C委外订单公司", companyCode);
|
||||
} else if (bdCorpEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据委外订单公司主键:{},匹配到{}个委外入库单", scOrderEntity.getPkCorp(), bdCorpEntityList.size());
|
||||
Assert.state(false, "根据O货主编码{},匹配到U8C委外订单公司{}个", companyCode, bdCorpEntityList.size());
|
||||
}
|
||||
|
||||
// 2024年8月20日 23:51:56 收货库存组织,应该是通过收货公司查询得出收货库存组织,目前收货公司和采购公司保持一致,那么就以采购公司带出!这个逻辑已经和佳妮确认
|
||||
//采购组织
|
||||
BdPurorgEntity bdPurorgEntity = new BdPurorgEntity();
|
||||
bdPurorgEntity.setDr("0");
|
||||
bdPurorgEntity.setDataSourceCode("lets_u8c");
|
||||
bdPurorgEntity.setOwnercorp(bdCorpEntityList.get(0).getPkCorp());
|
||||
List<BdPurorgEntity> bdPurorgEntityList = iBdPurorgDao.query(bdPurorgEntity);
|
||||
if (bdPurorgEntityList.size() == 0) {
|
||||
Assert.state(false, "根据委外订单公司主键:{} 无法匹配到采购组织", bdCorpEntityList.get(0).getPkCorp());
|
||||
} else if (bdPurorgEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据委外订单公司主键:{} 匹配到多个采购组织", bdCorpEntityList.get(0).getPkCorp());
|
||||
}
|
||||
|
||||
//客商基本档案(供应商类型)
|
||||
//2024年8月20日 14:47:55 丽知商城、OFS 供应商客商档案、传递到U8C的客商,
|
||||
//其中自定义项1作为原系统编码,因此统一传到自定义项一,已经和大家确认好了,没有关系的,放心大胆传吧,宝贝
|
||||
String shipFromCode = header.getShipFromCode();
|
||||
Assert.notNull(shipFromCode, "O供应商编码不能为空,没有办法完成业务逻辑,请配置供应商编码(采退)");
|
||||
Assert.state(!"".equals(shipFromCode.trim()), "O供应商编码不能为空,没有办法完成业务逻辑,请配置供应商编码!");
|
||||
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
|
||||
bdCubasdocEntity.setDataSourceCode("lets_u8c");
|
||||
bdCubasdocEntity.setDr(0L);
|
||||
bdCubasdocEntity.setDef1(shipFromCode);
|
||||
List<BdCubasdocEntity> bdCubasdocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
|
||||
if (bdCubasdocEntityList == null || bdCubasdocEntityList.size() == 0) {
|
||||
Assert.state(false, "根据OFS供应商业务编码{},无法查询到U8C客商档案信息(供应商)", shipFromCode);
|
||||
} else if (bdCubasdocEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据OFS供应商业务编码{},查询到多个U8C客商档案信息(供应商)", shipFromCode);
|
||||
}
|
||||
|
||||
//客商管理档案
|
||||
BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity();
|
||||
bdCumandocEntity1.setDataSourceCode("lets_u8c");
|
||||
bdCumandocEntity1.setDr(0L);
|
||||
bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
|
||||
bdCumandocEntity1.setCustflags(ProfilesActiveConstant.SUPPLIER);
|
||||
bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc());
|
||||
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
|
||||
if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) {
|
||||
Assert.state(false, "根据客商基本档案主键{},无法匹配到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc());
|
||||
} else if (bdCumandocEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据客商基本档案主键{},匹配到多个客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc());
|
||||
}
|
||||
|
||||
//2024年8月25日 10:09:20 委外入库公司,取委外订单上的公司,已经和妮姐确认,没有必要通过O的公司转换,因为不存在跨组织的问题
|
||||
// Assert.notNull(scOrderEntity.getPkCorp(), "O表头公司不能为空");
|
||||
// BdCorpEntity bdCorpEntity = new BdCorpEntity();
|
||||
// bdCorpEntity.setDr(0);
|
||||
// bdCorpEntity.setDataSourceCode("lets_u8c");
|
||||
// bdCorpEntity.setPkCorp(scOrderEntity.getPkCorp());
|
||||
// List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
|
||||
// if (bdCorpEntityList.size() == 0) {
|
||||
// Assert.state(false, "根据委外订单公司主键:{},无法匹配到委外入库单", scOrderEntity.getPkCorp());
|
||||
// } else if (bdCorpEntityList.size() >= 2) {
|
||||
// Assert.state(false, "根据委外订单公司主键:{},匹配到{}个委外入库单", scOrderEntity.getPkCorp(), bdCorpEntityList.size());
|
||||
// }
|
||||
|
||||
// 库存组织
|
||||
BdCalbodyEntity bdCalbodyEntity = new BdCalbodyEntity();
|
||||
bdCalbodyEntity.setDr(0);
|
||||
bdCalbodyEntity.setDataSourceCode("lets_u8c");
|
||||
|
@ -397,7 +515,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
Assert.state(false, "根据U8C采购公司{},匹配到U8C发货库存组织{}个", bdCorpEntityList.get(0).getPkCorp(), bdCalbodyEntities.size());
|
||||
}
|
||||
|
||||
//入库仓库
|
||||
//表体仓库
|
||||
String facilityCode = header.getFacilityCode();
|
||||
Assert.notNull(facilityCode, "O售后入库单仓库facilityCode字段不能为空");
|
||||
BdStordocEntity bdStordocEntity = new BdStordocEntity();
|
||||
|
@ -414,20 +532,24 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
|
||||
ConsignmachiningInSonDto consignmachiningInSonDto = new ConsignmachiningInSonDto();
|
||||
consignmachiningInSonDto.setOfsPoOrderData(ofsPoOrderData);
|
||||
consignmachiningInSonDto.setScOrderEntity(scOrderEntity);
|
||||
// consignmachiningInSonDto.setScOrderEntity(scOrderEntity);
|
||||
consignmachiningInSonDto.setBdCorpEntity(bdCorpEntityList.get(0));
|
||||
consignmachiningInSonDto.setBdCalbodyEntity(bdCalbodyEntities.get(0));
|
||||
consignmachiningInSonDto.setBdStordocEntity(bdStordocEntityList.get(0));
|
||||
// consignmachiningInSonDto.setBdStordocEntity(bdStordocEntityList.get(0));
|
||||
consignmachiningInSonDto.setBdPurorgEntity(bdPurorgEntityList.get(0));
|
||||
consignmachiningInSonDto.setBdCubasdocEntity(bdCubasdocEntityList.get(0));
|
||||
consignmachiningInSonDto.setBdCumandocEntity(bdCumandocEntityList.get(0));
|
||||
// consignmachiningInSonDto.setHeader(header);
|
||||
consignmachiningInSonDto.setScOrderBEntityList(scOrderBEntityList);
|
||||
// consignmachiningInSonDto.setScOrderBEntityList(scOrderBEntityList);
|
||||
consignmachiningInSonDto.setDetails(details);
|
||||
consignmachiningInSonDto.setBdStordocEntity(bdStordocEntityList.get(0));
|
||||
|
||||
BeanUtil.copyPropertiesV2(header, consignmachiningInSonDto);
|
||||
consignmachiningInSonDtoArrayList.add(consignmachiningInSonDto);
|
||||
}
|
||||
//成功
|
||||
} catch (Exception e) {
|
||||
logger.error("委外入库OFS档案转换", e);
|
||||
logger.error("委外入库单OFS档案转换错误", e);
|
||||
//失败
|
||||
}
|
||||
} else {
|
||||
|
@ -441,22 +563,22 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private ScOrderEntity queryScOrder(String ofsPoOrderId) {
|
||||
Assert.notNull(ofsPoOrderId, "ofsPoOrderId不能为空!");
|
||||
Assert.state(!"".equals(ofsPoOrderId.trim()), "ofsPoOrderId不能为空");
|
||||
|
||||
ScOrderEntity scOrderEntity = new ScOrderEntity();
|
||||
scOrderEntity.setVdef20(ofsPoOrderId);
|
||||
scOrderEntity.setDr("0");
|
||||
scOrderEntity.setDataSourceCode("lets_u8c");
|
||||
List<ScOrderEntity> scOrderEntityList = iScOrderDao.query(scOrderEntity);
|
||||
if (scOrderEntityList == null || scOrderEntityList.size() == 0) {
|
||||
Assert.state(false, "根据O采购订单主键:{}(u委外订单自定义项20存储O采购订单主键),无法匹配到U8C委外订单", ofsPoOrderId);
|
||||
} else if (scOrderEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据O采购订单主键:{}(u委外订单自定义项20存储O采购订单主键),匹配到{}个U8C委外订单", ofsPoOrderId, scOrderEntityList.size());
|
||||
}
|
||||
return scOrderEntityList.get(0);
|
||||
}
|
||||
// private ScOrderEntity queryScOrder(String ofsPoOrderId) {
|
||||
// Assert.notNull(ofsPoOrderId, "ofsPoOrderId不能为空!");
|
||||
// Assert.state(!"".equals(ofsPoOrderId.trim()), "ofsPoOrderId不能为空");
|
||||
//
|
||||
// ScOrderEntity scOrderEntity = new ScOrderEntity();
|
||||
// scOrderEntity.setVdef20(ofsPoOrderId);
|
||||
// scOrderEntity.setDr("0");
|
||||
// scOrderEntity.setDataSourceCode("lets_u8c");
|
||||
// List<ScOrderEntity> scOrderEntityList = iScOrderDao.query(scOrderEntity);
|
||||
// if (scOrderEntityList == null || scOrderEntityList.size() == 0) {
|
||||
// Assert.state(false, "根据O采购订单主键:{}(u委外订单自定义项20存储O采购订单主键),无法匹配到U8C委外订单", ofsPoOrderId);
|
||||
// } else if (scOrderEntityList.size() >= 2) {
|
||||
// Assert.state(false, "根据O采购订单主键:{}(u委外订单自定义项20存储O采购订单主键),匹配到{}个U8C委外订单", ofsPoOrderId, scOrderEntityList.size());
|
||||
// }
|
||||
// return scOrderEntityList.get(0);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 2024年8月25日 14:11:31 查询U8C委外订单明细
|
||||
|
@ -464,31 +586,30 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
* @param corderid 委外订单表头主键
|
||||
* @author liuyang
|
||||
*/
|
||||
private List<ScOrderBEntity> queryScOrderDetail(String corderid) throws Exception {
|
||||
Assert.notNull(corderid, "委外订单表头主键不能为空!");
|
||||
Assert.state(!"".equals(corderid), "委外订单表头主键不能为空!");
|
||||
|
||||
ScOrderBEntity scOrderBEntity = new ScOrderBEntity();
|
||||
scOrderBEntity.setCorderid(corderid);
|
||||
scOrderBEntity.setDr("0");
|
||||
scOrderBEntity.setDataSourceCode("lets_u8c");
|
||||
List<ScOrderBEntity> scOrderBEntityList = iScOrderBDao.query(scOrderBEntity);
|
||||
if (scOrderBEntityList == null || scOrderBEntityList.size() == 0) {
|
||||
//2024年8月25日 14:16:31 这个验证非常要必要,单据如果没有表体没有行,是很可疑的
|
||||
Assert.state(false, "根据U8C委外订单主键({})无法查询到委外订单表体明细行!", corderid);
|
||||
}
|
||||
return scOrderBEntityList;
|
||||
}
|
||||
// private List<ScOrderBEntity> queryScOrderDetail(String corderid) throws Exception {
|
||||
// Assert.notNull(corderid, "委外订单表头主键不能为空!");
|
||||
// Assert.state(!"".equals(corderid), "委外订单表头主键不能为空!");
|
||||
//
|
||||
// ScOrderBEntity scOrderBEntity = new ScOrderBEntity();
|
||||
// scOrderBEntity.setCorderid(corderid);
|
||||
// scOrderBEntity.setDr("0");
|
||||
// scOrderBEntity.setDataSourceCode("lets_u8c");
|
||||
// List<ScOrderBEntity> scOrderBEntityList = iScOrderBDao.query(scOrderBEntity);
|
||||
// if (scOrderBEntityList == null || scOrderBEntityList.size() == 0) {
|
||||
// //2024年8月25日 14:16:31 这个验证非常要必要,单据如果没有表体没有行,是很可疑的
|
||||
// Assert.state(false, "根据U8C委外订单主键({})无法查询到委外订单表体明细行!", corderid);
|
||||
// }
|
||||
// return scOrderBEntityList;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 2024年8月6日 10:59:03 查询U8C业务流程
|
||||
*
|
||||
* @param pkCorp 公司主键
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdBusitypeEntity u8cOperationFlow(String pkCorp) throws Exception {
|
||||
Assert.notNull(pkCorp, "公司主键不能为空!");
|
||||
Assert.state(!"".equals(pkCorp.trim()), "公司主键不能为空!");
|
||||
private BdBusitypeEntity u8cOperationFlow() throws Exception {
|
||||
// Assert.notNull(pkCorp, "公司主键不能为空!");
|
||||
// Assert.state(!"".equals(pkCorp.trim()), "公司主键不能为空!");
|
||||
//查询业务流程
|
||||
//2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
||||
String processName = "委外加工";
|
||||
|
@ -532,36 +653,36 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
* @param scOrderBEntityList U8C委外订单明细行
|
||||
* @author liuyang
|
||||
*/
|
||||
private ScOrderBEntity findOfsPoOrderDetailAndU8cPoOrderDetail(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, OfsPoOrderData ofsPoOrderData, List<ScOrderBEntity> scOrderBEntityList) {
|
||||
Assert.notNull(stockinB, "stockinB不能为空");
|
||||
Assert.notNull(ofsPoOrderData, "ofsPoOrderData不能为空");
|
||||
Assert.notNull(scOrderBEntityList, "scOrderBEntityList删除不能为空");
|
||||
|
||||
// OfsPoOrderHeader header = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> details = ofsPoOrderData.getDetails();
|
||||
|
||||
//查找采购订单明细行
|
||||
OfsPoOrderDetails tarGetOfsPoOrderDetails = null;
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
OfsPoOrderDetails ofsPoOrderDetails = details.get(i);
|
||||
if (ofsPoOrderDetails.getId().equals(stockinB.getRefOrderDetailId())) {
|
||||
tarGetOfsPoOrderDetails = ofsPoOrderDetails;
|
||||
}
|
||||
}
|
||||
Assert.notNull(tarGetOfsPoOrderDetails, "无法匹配到采购订单明细行! 目标主键:{}", stockinB.getRefOrderDetailId());
|
||||
|
||||
//根据采购订单明细行主键,查找U8C采购订单明细行
|
||||
for (int i = 0; i < scOrderBEntityList.size(); i++) {
|
||||
ScOrderBEntity scOrderBEntity = scOrderBEntityList.get(i);
|
||||
Assert.notNull(scOrderBEntity.getVdef20(), "委外订单明细行v20不能为空(明细行v20存储O采购订单明细行主键)!");
|
||||
Assert.state(!"".equals(scOrderBEntity.getVdef20()), "委外订单明细行v20不能为空(明细行v20存储O采购订单明细行主键)!");
|
||||
if (tarGetOfsPoOrderDetails.getId().equals(scOrderBEntity.getVdef20())) {
|
||||
return scOrderBEntity;
|
||||
}
|
||||
}
|
||||
Assert.state(false, "通过U8C采购订单明细行主键层层匹配到U8C采购明细失败!");
|
||||
return null;
|
||||
}
|
||||
// private ScOrderBEntity findOfsPoOrderDetailAndU8cPoOrderDetail(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, OfsPoOrderData ofsPoOrderData, List<ScOrderBEntity> scOrderBEntityList) {
|
||||
// Assert.notNull(stockinB, "stockinB不能为空");
|
||||
// Assert.notNull(ofsPoOrderData, "ofsPoOrderData不能为空");
|
||||
// Assert.notNull(scOrderBEntityList, "scOrderBEntityList删除不能为空");
|
||||
//
|
||||
//// OfsPoOrderHeader header = ofsPoOrderData.getHeader();
|
||||
// List<OfsPoOrderDetails> details = ofsPoOrderData.getDetails();
|
||||
//
|
||||
// //查找采购订单明细行
|
||||
// OfsPoOrderDetails tarGetOfsPoOrderDetails = null;
|
||||
// for (int i = 0; i < details.size(); i++) {
|
||||
// OfsPoOrderDetails ofsPoOrderDetails = details.get(i);
|
||||
// if (ofsPoOrderDetails.getId().equals(stockinB.getRefOrderDetailId())) {
|
||||
// tarGetOfsPoOrderDetails = ofsPoOrderDetails;
|
||||
// }
|
||||
// }
|
||||
// Assert.notNull(tarGetOfsPoOrderDetails, "无法匹配到采购订单明细行! 目标主键:{}", stockinB.getRefOrderDetailId());
|
||||
//
|
||||
// //根据采购订单明细行主键,查找U8C采购订单明细行
|
||||
// for (int i = 0; i < scOrderBEntityList.size(); i++) {
|
||||
// ScOrderBEntity scOrderBEntity = scOrderBEntityList.get(i);
|
||||
// Assert.notNull(scOrderBEntity.getVdef20(), "委外订单明细行v20不能为空(明细行v20存储O采购订单明细行主键)!");
|
||||
// Assert.state(!"".equals(scOrderBEntity.getVdef20()), "委外订单明细行v20不能为空(明细行v20存储O采购订单明细行主键)!");
|
||||
// if (tarGetOfsPoOrderDetails.getId().equals(scOrderBEntity.getVdef20())) {
|
||||
// return scOrderBEntity;
|
||||
// }
|
||||
// }
|
||||
// Assert.state(false, "通过U8C采购订单明细行主键层层匹配到U8C采购明细失败!");
|
||||
// return null;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 匹配U8C采购订单明细行
|
||||
|
@ -617,19 +738,19 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
* @param param 原数据json
|
||||
* @author liuyang
|
||||
*/
|
||||
public IcGeneralHResultDto sendU8cConsignmachiningIn(String param) throws Exception {
|
||||
public IcGeneralHResultDto sendU8cScorder(String param) throws Exception {
|
||||
long startLong = System.currentTimeMillis();
|
||||
logger.info("U8C委外入库推送开始,推送参数:" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL);
|
||||
logger.info("U8C委外订单推送开始,推送参数:" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL);
|
||||
String result = HttpRequest.post(ProfilesActiveConstant.U8C_URL).header("appId", "800037")//头信息,多个头信息多次调用此方法即可
|
||||
.header("usercode", "admin").header("password", "21232f297a57a5a743894a0e4a801fc3").header("system", "lz").header("trantype", "PK").header("apiCode", "8000370056")//头信息,多个头信息多次调用此方法即可
|
||||
.header("usercode", "admin").header("password", "21232f297a57a5a743894a0e4a801fc3").header("system", "lz").header("trantype", "PK").header("apiCode", "8000370037")//头信息,多个头信息多次调用此方法即可
|
||||
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
||||
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可
|
||||
.body(param)//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
logger.info("U8C委外入库推送结束,返回参数:" + result);
|
||||
logger.info("U8C委外订单推送结束,返回参数:" + result);
|
||||
long endLong = System.currentTimeMillis();
|
||||
logger.info("U8C委外入库推送耗时:" + (endLong - startLong));
|
||||
logger.info("U8C委外订单推送耗时:" + (endLong - startLong));
|
||||
|
||||
if (result == null) {
|
||||
result = "";
|
||||
|
@ -672,4 +793,49 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BOM版本,版本最新的在返回的结果集的最前面
|
||||
*
|
||||
* @param gcbm 工厂主键
|
||||
* @param wlbmid 物料编码id,经过测试,这是存货基本档案主键
|
||||
*/
|
||||
private List<BdBomEntity> getBomVersion(String gcbm, String wlbmid) throws Exception {
|
||||
Assert.notNull(gcbm, "gcbm工厂主键");
|
||||
Assert.notNull(wlbmid, "wlbmid物料编码id不能为空");
|
||||
|
||||
BdBomEntity bdBomEntity = new BdBomEntity();
|
||||
bdBomEntity.setDataSourceCode("lets_u8c");
|
||||
bdBomEntity.setWlbmid(wlbmid);
|
||||
bdBomEntity.setGcbm(gcbm);
|
||||
List<BdBomEntity> bdBomEntityList = iBdBomDao.query(bdBomEntity);
|
||||
//2024年9月2日 15:08:30 等待妮姐确认,如果对应的存货没有BOM,是否抛出异常
|
||||
//2024年9月2日 15:14:18 已经和妮姐确认,如果存货对应的BOM不存在,则抛出异常
|
||||
if (bdBomEntityList == null || bdBomEntityList.size() == 0) {
|
||||
Assert.state(false, "存货:{} 工厂(库存足足):{}对应的BOM不存在(该存货需要维护BOM)!");
|
||||
}
|
||||
return bdBomEntityList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024年8月7日 10:25:29
|
||||
* 查询基础档案,根据公司、管理档案主键查询
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdInvbasdocEntity queryStockBasicArchives(String pkInvmandoc, String pkCorp) throws Exception {
|
||||
Assert.notNull(pkInvmandoc, "存货管理档案不能为空");
|
||||
Assert.notNull(pkCorp, "公司档案不能为空");
|
||||
|
||||
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
||||
bdInvbasdocEntity.setPk_invmandoc(pkInvmandoc);
|
||||
bdInvbasdocEntity.setPk_corp(pkCorp);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntity2 = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV2(bdInvbasdocEntity);
|
||||
if (bdInvbasdocEntity2.size() == 0) {
|
||||
Assert.state(false, "根据存货管理档案主键{}和公司档案主键{}没有查询到U8C基础档案", pkInvmandoc, pkCorp);
|
||||
} else if (bdInvbasdocEntity2.size() >= 2) {
|
||||
Assert.state(false, "根据存货管理档案主键{}和公司档案主键{}没有查询到U8C基础档案", pkInvmandoc, pkCorp);
|
||||
}
|
||||
return bdInvbasdocEntity2.get(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,675 @@
|
|||
package com.hzya.frame.plugin.lets.plugin.outsourc;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.beanutil.BeanUtil;
|
||||
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
|
||||
import com.hzya.frame.plugin.lets.dao.*;
|
||||
import com.hzya.frame.plugin.lets.entity.*;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||
import com.hzya.frame.plugin.lets.util.OfsStandardUtil;
|
||||
import com.hzya.frame.plugin.lets.util.OnlyImplementProxyOrderUtil;
|
||||
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
|
||||
import com.hzya.frame.plugin.lets.util.RdclUtil;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* O采购入库 -> U8C委外加工入库
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.plugin.outsourc
|
||||
* @Project:kangarooDataCenterV3
|
||||
* @name:ConsignmachiningIn
|
||||
* @Date:2024年8月26日 10:23:20
|
||||
* @Filename:ConsignmachiningIn
|
||||
*/
|
||||
public class ConsignmachiningIn extends PluginBaseEntity {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(ConsignmachiningIn.class);
|
||||
|
||||
@Autowired
|
||||
private QueryBdBusitypeUtil queryBdBusitypeUtil;
|
||||
|
||||
@Autowired
|
||||
private IBdCorpDao iBdCorpDao;
|
||||
|
||||
@Autowired
|
||||
private IBdInvmandocDao iBdInvmandocDao;
|
||||
|
||||
@Autowired
|
||||
private IBdCalbodyDao iBdCalbodyDao;
|
||||
|
||||
@Autowired
|
||||
private IBdStordocDao iBdStordocDao;
|
||||
|
||||
@Autowired
|
||||
private RdclUtil rdclUtil;
|
||||
|
||||
@Autowired
|
||||
private OfsStandardUtil ofsStandardUtil;
|
||||
|
||||
@Autowired
|
||||
private IScOrderDao iScOrderDao;
|
||||
|
||||
@Autowired
|
||||
private IScOrderBDao iScOrderBDao;
|
||||
|
||||
@Autowired
|
||||
private OnlyImplementProxyOrderUtil onlyImplementProxyOrder;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.outsourc.ConsignmachiningIn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "OFS采购入库单生成U8C委外加工入库(委外采购入库)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "OFS采购入库单生成U8C委外加工入库(委外采购入库)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "3";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单号查询
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
public void startImplement(String startTime, String endTime) {
|
||||
String threadNameStrStart = StrUtil.format("开始(委外采购)OFS采购入库单生成U8C委外加工入库 开始时间:{} 结束时间:{}", startTime, endTime);
|
||||
logger.info(threadNameStrStart);
|
||||
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||
queryOfsSoSaleOutVo.setClosedAt_start(startTime);
|
||||
queryOfsSoSaleOutVo.setClosedAt_end(endTime);
|
||||
queryOfsSoSaleOutVo.setClientCode("LETS");
|
||||
queryOfsSoSaleOutVo.setPageNo(1L);
|
||||
queryOfsSoSaleOutVo.setPageSize(50L);
|
||||
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE");
|
||||
queryOfsSoSaleOutVo.setStatus(900L);
|
||||
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
||||
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
||||
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
||||
getSet(returnGoodHeaderDetailsDataDtoArrayList);
|
||||
} else {
|
||||
logger.info("没有查询到任何数据!不需要同步");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("startImplement方法抛出异常", e);
|
||||
}
|
||||
}
|
||||
}, threadNameStrStart);
|
||||
thread.start();
|
||||
try {
|
||||
thread.join();
|
||||
} catch (Exception e) {
|
||||
logger.error("thread.join()异常", e);
|
||||
}
|
||||
String threadNameStrEnd = StrUtil.format("结束(委外采购)OFS采购入库单生成U8C委外加工入库 开始时间:{} 结束时间:{}", startTime, endTime);
|
||||
logger.info(threadNameStrEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单号查询
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
public void startImplement(String code) {
|
||||
String threadNameStrStart = StrUtil.format("开始(委外采购)OFS采购入库单生成U8C委外加工入库 OFS采购入库单号:{}", code);
|
||||
logger.info(threadNameStrStart);
|
||||
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
|
||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||
queryOfsSoSaleOutVo.setClientCode("LETS");
|
||||
queryOfsSoSaleOutVo.setPageNo(1L);
|
||||
queryOfsSoSaleOutVo.setPageSize(50L);
|
||||
queryOfsSoSaleOutVo.setCode(code);
|
||||
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE");
|
||||
queryOfsSoSaleOutVo.setStatus(900L);
|
||||
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
||||
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
|
||||
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
||||
getSet(returnGoodHeaderDetailsDataDtoArrayList);
|
||||
} else {
|
||||
logger.info("没有查询到任何数据!不需要同步");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("startImplement方法抛出异常", e);
|
||||
}
|
||||
}
|
||||
}, threadNameStrStart);
|
||||
thread.start();
|
||||
try {
|
||||
thread.join();
|
||||
} catch (Exception e) {
|
||||
logger.error("thread.join()异常", e);
|
||||
}
|
||||
String threadNameStrEnd = StrUtil.format("结束(委外采购)OFS采购入库单生成U8C委外加工入库 OFS采购入库单号:{}", code);
|
||||
logger.info(threadNameStrEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 环境预配置
|
||||
*
|
||||
* @param returnGoodHeaderDetailsDataDtoArrayList 采购入库单
|
||||
* @author liuyang
|
||||
*/
|
||||
private void getSet(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
|
||||
//过滤成功的数据
|
||||
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList);
|
||||
//执行推送主逻辑
|
||||
implement(stockinOrderList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤掉成功的数据
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private List<StockinOrderSearchResponse.StockinOrder> filterData(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) {
|
||||
List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
|
||||
if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
|
||||
//TODO 出库单明细主键,需要O返回,目前没有,已经提需求
|
||||
headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoArrayList);
|
||||
}
|
||||
return headerDetailsDtoList1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行主逻辑
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private void implement(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) throws Exception {
|
||||
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
|
||||
try {
|
||||
// 查询基本档案
|
||||
List<ConsignmachiningInSonDto> consignmachiningInSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList);
|
||||
// 查询采购收发类别
|
||||
BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("105");
|
||||
|
||||
if (consignmachiningInSonDtos != null && consignmachiningInSonDtos.size() > 0) {
|
||||
for (int i = 0; i < consignmachiningInSonDtos.size(); i++) {
|
||||
ConsignmachiningInSonDto consignmachiningInSonDto = consignmachiningInSonDtos.get(i);
|
||||
// StockinOrderSearchResponse.StockinOrder.StockinH header = consignmachiningInSonDto.getHeader();
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = consignmachiningInSonDto.getDetails();
|
||||
|
||||
String generateBusinessDate = createGenerateBusinessDate(consignmachiningInSonDto); //生成业务日期
|
||||
OfsPoOrderData ofsPoOrderData = consignmachiningInSonDto.getOfsPoOrderData();//OFS采购订单
|
||||
ScOrderEntity scOrderEntity = consignmachiningInSonDto.getScOrderEntity();//U8C委外订单
|
||||
BdCorpEntity bdCorpEntity = consignmachiningInSonDto.getBdCorpEntity();//公司
|
||||
BdCalbodyEntity bdCalbodyEntity = consignmachiningInSonDto.getBdCalbodyEntity();//库存组织
|
||||
BdStordocEntity bdStordocEntity = consignmachiningInSonDto.getBdStordocEntity();//仓库
|
||||
// StockinOrderSearchResponse.StockinOrder.StockinH header1 = consignmachiningInSonDto.getHeader();
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details1 = consignmachiningInSonDto.getDetails();//OFS采购入库单
|
||||
List<ScOrderBEntity> scOrderBEntityList = consignmachiningInSonDto.getScOrderBEntityList();//U8C委外订单明细行主键
|
||||
|
||||
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> ofsPoOrderDataDetails = ofsPoOrderData.getDetails();
|
||||
|
||||
// 代理委外入库业务流程
|
||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow(bdCorpEntity.getPkCorp());
|
||||
|
||||
//委外入库表头
|
||||
ConsignmachiningInHeadDto poOrderParentDto = new ConsignmachiningInHeadDto();
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());
|
||||
poOrderParentDto.setCoperatorid("0001A110000000000U3D");
|
||||
poOrderParentDto.setCwarehouseid(bdStordocEntity.getPkStordoc());
|
||||
poOrderParentDto.setPk_calbody(bdCalbodyEntity.getPkCalbody());
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
|
||||
poOrderParentDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
|
||||
poOrderParentDto.setDbilldate(generateBusinessDate);//入库日期
|
||||
|
||||
//委外入库表头明细行
|
||||
List<ConsignmachiningInBodyDto> consignmachiningInBodyDtoArrayList = new ArrayList<>();
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
|
||||
//匹配U8C采购订单明细行
|
||||
ScOrderBEntity u8cPoOrderDetail = findOfsPoOrderDetailAndU8cPoOrderDetail(stockinB, ofsPoOrderData, scOrderBEntityList);
|
||||
//通过O采购订单入库单明细行,联查OFS采购订单明细行
|
||||
OfsPoOrderDetails ofsPoOrderDetailRowTraget = findOfsPoOrderDetailRowTraget(stockinB, ofsPoOrderData);
|
||||
//查询存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
||||
|
||||
//计算含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
String receivedQty = stockinB.getReceivedQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetailRowTraget.getFulfillAmount();//实收累计总金额
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采购入库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
}
|
||||
|
||||
ConsignmachiningInBodyDto consignmachiningInBodyDto = new ConsignmachiningInBodyDto();
|
||||
consignmachiningInBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());//存货
|
||||
//TODO 测试
|
||||
consignmachiningInBodyDto.setNinnum("1");
|
||||
// consignmachiningInBodyDto.setNinnum(new BigDecimal(stockinB.getReceivedQty()).stripTrailingZeros().toPlainString());//实收数量
|
||||
consignmachiningInBodyDto.setNprice(noriginalcurprice.stripTrailingZeros().toPlainString());//单价(含税单价)
|
||||
consignmachiningInBodyDto.setCsourcetype("61");//来源单据类型
|
||||
consignmachiningInBodyDto.setVsourcerowno(u8cPoOrderDetail.getCrowno());//来源单据行号
|
||||
consignmachiningInBodyDto.setVsourcebillcode(scOrderEntity.getVordercode());//来源单据号
|
||||
consignmachiningInBodyDto.setWriteofftype("按备料发料核销");//核销方式
|
||||
consignmachiningInBodyDtoArrayList.add(consignmachiningInBodyDto);
|
||||
}
|
||||
|
||||
List<ConsignmachiningInHeadBodyDto> consignmachiningInHeadBodyDtoArrayList = new ArrayList<>();
|
||||
|
||||
ConsignmachiningInHeadBodyDto consignmachiningInHeadBodyDto = new ConsignmachiningInHeadBodyDto();
|
||||
consignmachiningInHeadBodyDto.setParentvo(poOrderParentDto);
|
||||
consignmachiningInHeadBodyDto.setChildrenvo(consignmachiningInBodyDtoArrayList);
|
||||
consignmachiningInHeadBodyDtoArrayList.add(consignmachiningInHeadBodyDto);
|
||||
|
||||
Map<String, List<ConsignmachiningInHeadBodyDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("GeneralBillVO", consignmachiningInHeadBodyDtoArrayList);
|
||||
//TODO 2024年8月26日 14:41:46 委外入库核销方式传不了!已经提交总部
|
||||
//TODO 2024年8月26日 14:42:19 无法超委外订单数量入库!已经提交给总部
|
||||
IcGeneralHResultDto icGeneralHResultDto = sendU8cConsignmachiningIn(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String cgeneralhid = null;
|
||||
String vbillcode = null;
|
||||
IcGeneralHResultHeadDto parentvo = icGeneralHResultDto.getParentvo();
|
||||
List<IcGeneralHResultBodyDto> childrenvo = icGeneralHResultDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
cgeneralhid = parentvo.getCgeneralhid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vbillcode = parentvo.getVbillcode();
|
||||
}
|
||||
logger.info("推送U8C委外入库成功!委外入库单主键:{} 委外入库单编码:{}", cgeneralhid, vbillcode);
|
||||
}
|
||||
} else {
|
||||
logger.info("poOrderSonDto.size为0!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("implement方法抛出异常", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 档案转换(OFS->U8C)
|
||||
* 2024年8月23日 12:02:47 和妮姐沟通,单据流程U8C成品委外订单 -> 备料计划 -> U8C委外发料(核销)
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private List<ConsignmachiningInSonDto> queryBasicArchives(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) {
|
||||
List<ConsignmachiningInSonDto> consignmachiningInSonDtoArrayList = new ArrayList<>();
|
||||
|
||||
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
|
||||
try {
|
||||
for (int i = 0; i < returnGoodHeaderDetailsDataDtoList.size(); i++) {
|
||||
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoList.get(i);
|
||||
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
|
||||
|
||||
//2024年8月25日 09:54:31 查询OFS采购订单
|
||||
OfsPoOrderData ofsPoOrderData = ofsStandardUtil.queryOfsPoOrder(header.getRefOrderCode());
|
||||
Assert.notNull(ofsPoOrderData, "无法查询到委外订单(OFS采购入库单->OSF采购订单->OFS采购订单主键->U8C委外订单自定义项20)");
|
||||
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> ofsPoOrderDataDetails = ofsPoOrderData.getDetails();
|
||||
|
||||
//如果该O采购订单对应的类型为:委外加工,则继续代码逻辑,否则就跳过代码逻辑
|
||||
boolean checkResult = onlyImplementProxyOrder.onlyImplementProxyOrder(ofsPoOrderData, "WWJG");
|
||||
if (!checkResult) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//2024年8月25日 09:42:58 查询委外订单,如果这一步报错,后续的逻辑就没有必要执行了
|
||||
String ofsId = ofsPoOrderDataHeader.getId();
|
||||
Assert.notNull(ofsId, "通过接口查询到OFS采购订单,但是没有采购订单主键,业务逻辑无法完成");
|
||||
ScOrderEntity scOrderEntity = queryScOrder(ofsId);
|
||||
|
||||
//2024年8月25日 14:15:45 根据委外订单id,查询委外订单表体明细行
|
||||
List<ScOrderBEntity> scOrderBEntityList = queryScOrderDetail(scOrderEntity.getCorderid());
|
||||
|
||||
//2024年8月25日 10:09:20 委外入库公司,取委外订单上的公司,已经和妮姐确认,没有必要通过O的公司转换,因为不存在跨组织的问题
|
||||
Assert.notNull(scOrderEntity.getPkCorp(), "O表头公司不能为空");
|
||||
BdCorpEntity bdCorpEntity = new BdCorpEntity();
|
||||
bdCorpEntity.setDr(0);
|
||||
bdCorpEntity.setDataSourceCode("lets_u8c");
|
||||
bdCorpEntity.setPkCorp(scOrderEntity.getPkCorp());
|
||||
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
|
||||
if (bdCorpEntityList.size() == 0) {
|
||||
Assert.state(false, "根据委外订单公司主键:{},无法匹配到委外入库单", scOrderEntity.getPkCorp());
|
||||
} else if (bdCorpEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据委外订单公司主键:{},匹配到{}个委外入库单", scOrderEntity.getPkCorp(), bdCorpEntityList.size());
|
||||
}
|
||||
|
||||
// 2024年8月20日 23:51:56 收货库存组织,应该是通过收货公司查询得出收货库存组织,目前收货公司和采购公司保持一致,那么就以采购公司带出!这个逻辑已经和佳妮确认
|
||||
BdCalbodyEntity bdCalbodyEntity = new BdCalbodyEntity();
|
||||
bdCalbodyEntity.setDr(0);
|
||||
bdCalbodyEntity.setDataSourceCode("lets_u8c");
|
||||
bdCalbodyEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
|
||||
List<BdCalbodyEntity> bdCalbodyEntities = iBdCalbodyDao.query(bdCalbodyEntity);
|
||||
if (bdCalbodyEntities.size() == 0) {
|
||||
Assert.state(false, "根据U8C采购公司{},无法匹配到U8C发货库存组织", bdCorpEntityList.get(0).getPkCorp());
|
||||
} else if (bdCalbodyEntities.size() >= 2) {
|
||||
Assert.state(false, "根据U8C采购公司{},匹配到U8C发货库存组织{}个", bdCorpEntityList.get(0).getPkCorp(), bdCalbodyEntities.size());
|
||||
}
|
||||
|
||||
//入库仓库
|
||||
String facilityCode = header.getFacilityCode();
|
||||
Assert.notNull(facilityCode, "O售后入库单仓库facilityCode字段不能为空");
|
||||
BdStordocEntity bdStordocEntity = new BdStordocEntity();
|
||||
bdStordocEntity.setDr(0L);
|
||||
bdStordocEntity.setDataSourceCode("lets_u8c");
|
||||
bdStordocEntity.setPkCalbody(bdCalbodyEntities.get(0).getPkCalbody());
|
||||
bdStordocEntity.setStorcode(facilityCode);
|
||||
List<BdStordocEntity> bdStordocEntityList = iBdStordocDao.query(bdStordocEntity);
|
||||
if (bdStordocEntityList.size() == 0) {
|
||||
Assert.state(false, "根据O仓库编码+U8C收货库存组织主键,无法匹配到U8C仓库", facilityCode, bdCalbodyEntities.get(0).getPkCalbody());
|
||||
} else if (bdStordocEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据O仓库编码+U8C收货库存组织主键,匹配到U8C仓库多个", facilityCode, bdCalbodyEntities.get(0).getPkCalbody());
|
||||
}
|
||||
|
||||
ConsignmachiningInSonDto consignmachiningInSonDto = new ConsignmachiningInSonDto();
|
||||
consignmachiningInSonDto.setOfsPoOrderData(ofsPoOrderData);
|
||||
consignmachiningInSonDto.setScOrderEntity(scOrderEntity);
|
||||
consignmachiningInSonDto.setBdCorpEntity(bdCorpEntityList.get(0));
|
||||
consignmachiningInSonDto.setBdCalbodyEntity(bdCalbodyEntities.get(0));
|
||||
consignmachiningInSonDto.setBdStordocEntity(bdStordocEntityList.get(0));
|
||||
// consignmachiningInSonDto.setHeader(header);
|
||||
consignmachiningInSonDto.setScOrderBEntityList(scOrderBEntityList);
|
||||
consignmachiningInSonDto.setDetails(details);
|
||||
|
||||
BeanUtil.copyPropertiesV2(header, consignmachiningInSonDto);
|
||||
consignmachiningInSonDtoArrayList.add(consignmachiningInSonDto);
|
||||
}
|
||||
//成功
|
||||
} catch (Exception e) {
|
||||
logger.error("委外入库OFS档案转换", e);
|
||||
//失败
|
||||
}
|
||||
} else {
|
||||
logger.info("queryBasicArchives对应returnGoodHeaderDetailsDataDtoList.size为0");
|
||||
}
|
||||
return consignmachiningInSonDtoArrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询委外订单表头对象
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private ScOrderEntity queryScOrder(String ofsPoOrderId) {
|
||||
Assert.notNull(ofsPoOrderId, "ofsPoOrderId不能为空!");
|
||||
Assert.state(!"".equals(ofsPoOrderId.trim()), "ofsPoOrderId不能为空");
|
||||
|
||||
ScOrderEntity scOrderEntity = new ScOrderEntity();
|
||||
scOrderEntity.setVdef20(ofsPoOrderId);
|
||||
scOrderEntity.setDr("0");
|
||||
scOrderEntity.setDataSourceCode("lets_u8c");
|
||||
List<ScOrderEntity> scOrderEntityList = iScOrderDao.query(scOrderEntity);
|
||||
if (scOrderEntityList == null || scOrderEntityList.size() == 0) {
|
||||
Assert.state(false, "根据O采购订单主键:{}(u委外订单自定义项20存储O采购订单主键),无法匹配到U8C委外订单", ofsPoOrderId);
|
||||
} else if (scOrderEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据O采购订单主键:{}(u委外订单自定义项20存储O采购订单主键),匹配到{}个U8C委外订单", ofsPoOrderId, scOrderEntityList.size());
|
||||
}
|
||||
return scOrderEntityList.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024年8月25日 14:11:31 查询U8C委外订单明细
|
||||
*
|
||||
* @param corderid 委外订单表头主键
|
||||
* @author liuyang
|
||||
*/
|
||||
private List<ScOrderBEntity> queryScOrderDetail(String corderid) throws Exception {
|
||||
Assert.notNull(corderid, "委外订单表头主键不能为空!");
|
||||
Assert.state(!"".equals(corderid), "委外订单表头主键不能为空!");
|
||||
|
||||
ScOrderBEntity scOrderBEntity = new ScOrderBEntity();
|
||||
scOrderBEntity.setCorderid(corderid);
|
||||
scOrderBEntity.setDr("0");
|
||||
scOrderBEntity.setDataSourceCode("lets_u8c");
|
||||
List<ScOrderBEntity> scOrderBEntityList = iScOrderBDao.query(scOrderBEntity);
|
||||
if (scOrderBEntityList == null || scOrderBEntityList.size() == 0) {
|
||||
//2024年8月25日 14:16:31 这个验证非常要必要,单据如果没有表体没有行,是很可疑的
|
||||
Assert.state(false, "根据U8C委外订单主键({})无法查询到委外订单表体明细行!", corderid);
|
||||
}
|
||||
return scOrderBEntityList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024年8月6日 10:59:03 查询U8C业务流程
|
||||
*
|
||||
* @param pkCorp 公司主键
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdBusitypeEntity u8cOperationFlow(String pkCorp) throws Exception {
|
||||
Assert.notNull(pkCorp, "公司主键不能为空!");
|
||||
Assert.state(!"".equals(pkCorp.trim()), "公司主键不能为空!");
|
||||
//查询业务流程
|
||||
//2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
||||
String processName = "委外加工";
|
||||
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
|
||||
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
|
||||
return bdBusitypeEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024年8月20日 15:46:10
|
||||
* 生成业务日期,以发货时间作为业务日期
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private String createGenerateBusinessDate(ConsignmachiningInSonDto consignmachiningInSonDto) {
|
||||
//TODO 测试
|
||||
consignmachiningInSonDto.setShipAt("2024-08-19");
|
||||
if (consignmachiningInSonDto != null && consignmachiningInSonDto.getShipAt() != null) {
|
||||
String shipAt = consignmachiningInSonDto.getShipAt();
|
||||
String businessFormat = null;
|
||||
try {
|
||||
Date dbill = DateUtil.parse(shipAt);
|
||||
businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
|
||||
} catch (Exception e) {
|
||||
logger.error("业务日期生成失败", e);
|
||||
}
|
||||
return businessFormat;
|
||||
} else {
|
||||
logger.error("生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(consignmachiningInSonDto));
|
||||
Assert.state(false, "生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(consignmachiningInSonDto));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配U8C采购订单明细行
|
||||
* 通过O采购入库单明细行,得到采购订单明细行,最后查找到U8C采购订单明细行
|
||||
*
|
||||
* @param stockinB OFS采购入库单明细行
|
||||
* @param ofsPoOrderData OFS采购订单
|
||||
* @param scOrderBEntityList U8C委外订单明细行
|
||||
* @author liuyang
|
||||
*/
|
||||
private ScOrderBEntity findOfsPoOrderDetailAndU8cPoOrderDetail(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, OfsPoOrderData ofsPoOrderData, List<ScOrderBEntity> scOrderBEntityList) {
|
||||
Assert.notNull(stockinB, "stockinB不能为空");
|
||||
Assert.notNull(ofsPoOrderData, "ofsPoOrderData不能为空");
|
||||
Assert.notNull(scOrderBEntityList, "scOrderBEntityList删除不能为空");
|
||||
|
||||
// OfsPoOrderHeader header = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> details = ofsPoOrderData.getDetails();
|
||||
|
||||
//查找采购订单明细行
|
||||
OfsPoOrderDetails tarGetOfsPoOrderDetails = null;
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
OfsPoOrderDetails ofsPoOrderDetails = details.get(i);
|
||||
if (ofsPoOrderDetails.getId().equals(stockinB.getRefOrderDetailId())) {
|
||||
tarGetOfsPoOrderDetails = ofsPoOrderDetails;
|
||||
}
|
||||
}
|
||||
Assert.notNull(tarGetOfsPoOrderDetails, "无法匹配到采购订单明细行! 目标主键:{}", stockinB.getRefOrderDetailId());
|
||||
|
||||
//根据采购订单明细行主键,查找U8C采购订单明细行
|
||||
for (int i = 0; i < scOrderBEntityList.size(); i++) {
|
||||
ScOrderBEntity scOrderBEntity = scOrderBEntityList.get(i);
|
||||
Assert.notNull(scOrderBEntity.getVdef20(), "委外订单明细行v20不能为空(明细行v20存储O采购订单明细行主键)!");
|
||||
Assert.state(!"".equals(scOrderBEntity.getVdef20()), "委外订单明细行v20不能为空(明细行v20存储O采购订单明细行主键)!");
|
||||
if (tarGetOfsPoOrderDetails.getId().equals(scOrderBEntity.getVdef20())) {
|
||||
return scOrderBEntity;
|
||||
}
|
||||
}
|
||||
Assert.state(false, "通过U8C采购订单明细行主键层层匹配到U8C采购明细失败!");
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配U8C采购订单明细行
|
||||
* 通过O采购入库单明细行,得到采购订单明细行,最后查找到U8C采购订单明细行
|
||||
*
|
||||
* @param stockinB OFS采购入库单明细行
|
||||
* @param ofsPoOrderData OFS采购订单
|
||||
* @author liuyang
|
||||
*/
|
||||
private OfsPoOrderDetails findOfsPoOrderDetailRowTraget(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, OfsPoOrderData ofsPoOrderData) {
|
||||
Assert.notNull(stockinB, "stockinB不能为空");
|
||||
Assert.notNull(ofsPoOrderData, "ofsPoOrderData不能为空");
|
||||
|
||||
List<OfsPoOrderDetails> details = ofsPoOrderData.getDetails();
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
OfsPoOrderDetails ofsPoOrderDetails = details.get(i);
|
||||
if (ofsPoOrderDetails.getId().equals(stockinB.getRefOrderDetailId())) {
|
||||
return ofsPoOrderDetails;
|
||||
}
|
||||
}
|
||||
Assert.state(false, "通过OFS采购入库单,无法匹配到OFS采购订单明细行! 目标主键:{}", stockinB.getRefOrderDetailId());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询存货管理档案
|
||||
*
|
||||
* @param pkCorp 发货公司主键
|
||||
* @param stockinB 采购入库单明细行
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdInvmandocEntity queryInventoryMan(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, String pkCorp) throws Exception {
|
||||
Assert.notNull(stockinB, "sonDetailsDto不能为空");
|
||||
Assert.notNull(stockinB.getSkuCode(), "O存货商家编码不能为空");
|
||||
Assert.notNull(pkCorp, "发货公司主键不能为空");
|
||||
|
||||
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
bdInvmandocEntity.setInvcode(stockinB.getSkuCode());
|
||||
bdInvmandocEntity.setPkCorp(pkCorp);
|
||||
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
||||
if (bdInvmandocEntity2.size() == 0) {
|
||||
Assert.state(false, "根据O商家编码:{} U8C发货公司主键:{}没有查询到存货管理档案", stockinB.getSkuCode(), pkCorp);
|
||||
} else if (bdInvmandocEntity2.size() >= 2) {
|
||||
Assert.state(false, "根据O商家编码:{} U8C发货公司主键:{}没有查询到存货管理档案", stockinB.getSkuCode(), pkCorp);
|
||||
}
|
||||
return bdInvmandocEntity2.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024年8月25日 15:12:22
|
||||
* 推送U8C委外入库单
|
||||
*
|
||||
* @param param 原数据json
|
||||
* @author liuyang
|
||||
*/
|
||||
public IcGeneralHResultDto sendU8cConsignmachiningIn(String param) throws Exception {
|
||||
long startLong = System.currentTimeMillis();
|
||||
logger.info("U8C委外入库推送开始,推送参数:" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL);
|
||||
String result = HttpRequest.post(ProfilesActiveConstant.U8C_URL).header("appId", "800037")//头信息,多个头信息多次调用此方法即可
|
||||
.header("usercode", "admin").header("password", "21232f297a57a5a743894a0e4a801fc3").header("system", "lz").header("trantype", "PK").header("apiCode", "8000370056")//头信息,多个头信息多次调用此方法即可
|
||||
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
||||
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可
|
||||
.body(param)//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
logger.info("U8C委外入库推送结束,返回参数:" + result);
|
||||
long endLong = System.currentTimeMillis();
|
||||
logger.info("U8C委外入库推送耗时:" + (endLong - startLong));
|
||||
|
||||
if (result == null) {
|
||||
result = "";
|
||||
}
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(result);
|
||||
result = String.valueOf(jsonObject.get("attribute"));
|
||||
|
||||
boolean isSuccess = false;
|
||||
IcGeneralHResultDto icGeneralHResultDto = null;
|
||||
if (result != null && !"".equals(result)) {
|
||||
ReusltStrDto reusltStrDto = JSON.parseObject(result, ReusltStrDto.class);
|
||||
if ("success".equals(reusltStrDto.getStatus())) {
|
||||
icGeneralHResultDto = resultDataHandle(reusltStrDto.getData());
|
||||
isSuccess = true;
|
||||
}
|
||||
}
|
||||
if (!isSuccess) {
|
||||
Assert.state(false, "O采购入库业务推送U8C委外入库失败 接口返回结果:{}", result);
|
||||
}
|
||||
return icGeneralHResultDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回结果解析处理,在确认了success后调用
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private IcGeneralHResultDto resultDataHandle(String resultData) {
|
||||
try {
|
||||
if (resultData != null && !"".equals(resultData)) {
|
||||
if (resultData.contains("[")) {
|
||||
resultData = resultData.substring(1, resultData.length() - 1);
|
||||
}
|
||||
return JSON.parseObject(resultData, IcGeneralHResultDto.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("resultDataHandle方法解析返回参数失败的错误", e);
|
||||
//如果解析失败,记录原因,但是不能影响结果的记录
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ import com.hzya.frame.plugin.lets.entity.*;
|
|||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||
import com.hzya.frame.plugin.lets.util.*;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
|
||||
|
@ -85,6 +86,9 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
|
|||
@Autowired
|
||||
private IBdStordocDao iBdStordocDao;
|
||||
|
||||
@Autowired
|
||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
|
@ -97,7 +101,7 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.outsourc.ConsignmachiningInReturn";
|
||||
return "outsourc.ConsignmachiningInReturn";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -262,82 +266,114 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
|
|||
ReturnOrderHeaderDto returnOrderHeaderDto = returnOrderHeaderDtos.get(i);
|
||||
List<DetailsDto> details = returnOrderHeaderDto.getDetails();
|
||||
|
||||
String generateBusinessDate = createGenerateBusinessDate(returnOrderHeaderDto); //生成业务日期
|
||||
PurchaseReturnOrder purchaseReturnOrder = returnOrderHeaderDto.getPurchaseReturnOrder();//OFS采退订单
|
||||
ScOrderEntity scOrderEntity = returnOrderHeaderDto.getScOrderEntity();//U8C委外订单
|
||||
List<ScOrderBEntity> scOrderBEntityList = returnOrderHeaderDto.getScOrderBEntityList();//U8C委外订单明细行
|
||||
BdCorpEntity bdCorpEntity = returnOrderHeaderDto.getBdCorpEntity();//公司
|
||||
BdCalbodyEntity bdCalbodyEntity = returnOrderHeaderDto.getBdCalbodyEntity();//库存组织
|
||||
BdStordocEntity bdStordocEntity = returnOrderHeaderDto.getBdStordocEntity();//仓库
|
||||
OfsPoOrderData ofsPoOrder = returnOrderHeaderDto.getOfsPoOrder();//OFS原正向的采购订单
|
||||
String generateBusinessDate = null;
|
||||
try {
|
||||
generateBusinessDate = createGenerateBusinessDate(returnOrderHeaderDto); //生成业务日期
|
||||
PurchaseReturnOrder purchaseReturnOrder = returnOrderHeaderDto.getPurchaseReturnOrder();//OFS采退订单
|
||||
ScOrderEntity scOrderEntity = returnOrderHeaderDto.getScOrderEntity();//U8C委外订单
|
||||
List<ScOrderBEntity> scOrderBEntityList = returnOrderHeaderDto.getScOrderBEntityList();//U8C委外订单明细行
|
||||
BdCorpEntity bdCorpEntity = returnOrderHeaderDto.getBdCorpEntity();//公司
|
||||
BdCalbodyEntity bdCalbodyEntity = returnOrderHeaderDto.getBdCalbodyEntity();//库存组织
|
||||
BdStordocEntity bdStordocEntity = returnOrderHeaderDto.getBdStordocEntity();//仓库
|
||||
OfsPoOrderData ofsPoOrder = returnOrderHeaderDto.getOfsPoOrder();//OFS原正向的采购订单
|
||||
|
||||
//委外入库表头
|
||||
ConsignmachiningInHeadDto poOrderParentDto = new ConsignmachiningInHeadDto();
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());
|
||||
poOrderParentDto.setCoperatorid("0001A110000000000U3D");
|
||||
poOrderParentDto.setCwarehouseid(bdStordocEntity.getPkStordoc());
|
||||
poOrderParentDto.setPk_calbody(bdCalbodyEntity.getPkCalbody());
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
|
||||
poOrderParentDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
|
||||
poOrderParentDto.setDbilldate(generateBusinessDate);//入库日期
|
||||
poOrderParentDto.setFreplenishflag(true);//是否退货
|
||||
//委外入库表头
|
||||
ConsignmachiningInHeadDto poOrderParentDto = new ConsignmachiningInHeadDto();
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());
|
||||
poOrderParentDto.setCoperatorid("0001A110000000000U3D");
|
||||
poOrderParentDto.setCwarehouseid(bdStordocEntity.getPkStordoc());
|
||||
poOrderParentDto.setPk_calbody(bdCalbodyEntity.getPkCalbody());
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
|
||||
poOrderParentDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
|
||||
poOrderParentDto.setDbilldate(generateBusinessDate);//入库日期
|
||||
poOrderParentDto.setFreplenishflag(true);//是否退货
|
||||
|
||||
//委外入库表头明细行
|
||||
List<ConsignmachiningInBodyDto> consignmachiningInBodyDtoArrayList = new ArrayList<>();
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
DetailsDto detailsDto = details.get(j);
|
||||
//匹配U8C采购订单明细行
|
||||
ScOrderBEntity u8cPoOrderDetail = findOfsPoOrderDetailAndU8cPoOrderDetail(detailsDto, purchaseReturnOrder, ofsPoOrder, scOrderBEntityList);
|
||||
//通过O采退出库库单明细行,联查OFS采退订单明细行
|
||||
PurchaseReturnOrderDetails ofsPoOrderDetailRowTraget = findOfsPoOrderDetailRowTraget(detailsDto, purchaseReturnOrder);
|
||||
//查询存货管理档案
|
||||
//委外入库表头明细行
|
||||
List<ConsignmachiningInBodyDto> consignmachiningInBodyDtoArrayList = new ArrayList<>();
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
DetailsDto detailsDto = details.get(j);
|
||||
//匹配U8C采购订单明细行
|
||||
ScOrderBEntity u8cPoOrderDetail = findOfsPoOrderDetailAndU8cPoOrderDetail(detailsDto, purchaseReturnOrder, ofsPoOrder, scOrderBEntityList);
|
||||
//通过O采退出库库单明细行,联查OFS采退订单明细行
|
||||
PurchaseReturnOrderDetails ofsPoOrderDetailRowTraget = findOfsPoOrderDetailRowTraget(detailsDto, purchaseReturnOrder);
|
||||
//查询存货管理档案
|
||||
// BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
||||
BdInvmandocEntity bdInvmandocEntity = null;
|
||||
BdInvmandocEntity bdInvmandocEntity = null;
|
||||
|
||||
//计算含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
String receivedQty = detailsDto.getShipQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetailRowTraget.getFulfillAmount();//实收累计总金额
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采退出库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采退出库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
//计算含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
String receivedQty = detailsDto.getShipQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetailRowTraget.getFulfillAmount();//实收累计总金额
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采退出库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采退出库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
}
|
||||
|
||||
ConsignmachiningInBodyDto consignmachiningInBodyDto = new ConsignmachiningInBodyDto();
|
||||
consignmachiningInBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());//存货主键
|
||||
consignmachiningInBodyDto.setNinnum("-" + new BigDecimal(receivedQty).stripTrailingZeros().toPlainString());//实收数量
|
||||
consignmachiningInBodyDto.setNprice(noriginalcurprice.stripTrailingZeros().toPlainString());//单价(含税单价)
|
||||
consignmachiningInBodyDto.setCsourcetype("61");//来源单据类型
|
||||
consignmachiningInBodyDto.setVsourcerowno(u8cPoOrderDetail.getCrowno());//来源单据行号
|
||||
consignmachiningInBodyDto.setVsourcebillcode(scOrderEntity.getVordercode());//来源单据号
|
||||
// consignmachiningInBodyDto.setWriteofftype("按备料发料核销");//核销方式,和妮姐已经确认,不用传递
|
||||
consignmachiningInBodyDto.setDbizdate(generateBusinessDate);// 入库日期
|
||||
consignmachiningInBodyDtoArrayList.add(consignmachiningInBodyDto);
|
||||
}
|
||||
|
||||
ConsignmachiningInBodyDto consignmachiningInBodyDto = new ConsignmachiningInBodyDto();
|
||||
consignmachiningInBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());//存货主键
|
||||
consignmachiningInBodyDto.setNinnum("-" + new BigDecimal(receivedQty).stripTrailingZeros().toPlainString());//实收数量
|
||||
consignmachiningInBodyDto.setNprice(noriginalcurprice.stripTrailingZeros().toPlainString());//单价(含税单价)
|
||||
consignmachiningInBodyDto.setCsourcetype("61");//来源单据类型
|
||||
consignmachiningInBodyDto.setVsourcerowno(u8cPoOrderDetail.getCrowno());//来源单据行号
|
||||
consignmachiningInBodyDto.setVsourcebillcode(scOrderEntity.getVordercode());//来源单据号
|
||||
// consignmachiningInBodyDto.setWriteofftype("按备料发料核销");//核销方式,和妮姐已经确认,不用传递
|
||||
consignmachiningInBodyDto.setDbizdate(generateBusinessDate);// 入库日期
|
||||
consignmachiningInBodyDtoArrayList.add(consignmachiningInBodyDto);
|
||||
List<ConsignmachiningInHeadBodyDto> consignmachiningInHeadBodyDtoArrayList = new ArrayList<>();
|
||||
ConsignmachiningInHeadBodyDto consignmachiningInHeadBodyDto = new ConsignmachiningInHeadBodyDto();
|
||||
consignmachiningInHeadBodyDto.setParentvo(poOrderParentDto);
|
||||
consignmachiningInHeadBodyDto.setChildrenvo(consignmachiningInBodyDtoArrayList);
|
||||
consignmachiningInHeadBodyDtoArrayList.add(consignmachiningInHeadBodyDto);
|
||||
|
||||
Map<String, List<ConsignmachiningInHeadBodyDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("GeneralBillVO", consignmachiningInHeadBodyDtoArrayList);
|
||||
//2024年8月26日 14:41:46 委外入库核销方式传不了!已经提交总部,2024年8月30日 14:05:25 已经解决,和妮姐确认不用填写
|
||||
//TODO 2024年8月26日 14:42:19 无法超委外订单数量入库!已经提交给总部
|
||||
IcGeneralHResultDto icGeneralHResultDto = sendU8cConsignmachiningIn(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String cgeneralhid = null;
|
||||
String vbillcode = null;
|
||||
IcGeneralHResultHeadDto parentvo = icGeneralHResultDto.getParentvo();
|
||||
List<IcGeneralHResultBodyDto> childrenvo = icGeneralHResultDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
cgeneralhid = parentvo.getCgeneralhid();
|
||||
vbillcode = parentvo.getVbillcode();
|
||||
}
|
||||
logger.info("推送U8C红字委外入库成功!委外入库单主键:{} 委外入库单编码:{} 公司名称:{}", cgeneralhid, vbillcode, bdCorpEntity.getUnitname());
|
||||
// 成功记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(returnOrderHeaderDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(icGeneralHResultDto));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(returnOrderHeaderDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(returnOrderHeaderDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
} catch (Exception e) {
|
||||
logger.error("推送U8C红字委外入库单失败", e);
|
||||
|
||||
String message = e.getMessage();
|
||||
if (message == null) {
|
||||
message = "未知错误";
|
||||
}
|
||||
// 失败记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(returnOrderHeaderDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(message));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(returnOrderHeaderDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(returnOrderHeaderDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
List<ConsignmachiningInHeadBodyDto> consignmachiningInHeadBodyDtoArrayList = new ArrayList<>();
|
||||
ConsignmachiningInHeadBodyDto consignmachiningInHeadBodyDto = new ConsignmachiningInHeadBodyDto();
|
||||
consignmachiningInHeadBodyDto.setParentvo(poOrderParentDto);
|
||||
consignmachiningInHeadBodyDto.setChildrenvo(consignmachiningInBodyDtoArrayList);
|
||||
consignmachiningInHeadBodyDtoArrayList.add(consignmachiningInHeadBodyDto);
|
||||
|
||||
Map<String, List<ConsignmachiningInHeadBodyDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("GeneralBillVO", consignmachiningInHeadBodyDtoArrayList);
|
||||
//2024年8月26日 14:41:46 委外入库核销方式传不了!已经提交总部,2024年8月30日 14:05:25 已经解决,和妮姐确认不用填写
|
||||
//TODO 2024年8月26日 14:42:19 无法超委外订单数量入库!已经提交给总部
|
||||
IcGeneralHResultDto icGeneralHResultDto = sendU8cConsignmachiningIn(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String cgeneralhid = null;
|
||||
String vbillcode = null;
|
||||
IcGeneralHResultHeadDto parentvo = icGeneralHResultDto.getParentvo();
|
||||
List<IcGeneralHResultBodyDto> childrenvo = icGeneralHResultDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
cgeneralhid = parentvo.getCgeneralhid();
|
||||
vbillcode = parentvo.getVbillcode();
|
||||
}
|
||||
logger.info("推送U8C红字委外入库成功!委外入库单主键:{} 委外入库单编码:{} 公司名称:{}", cgeneralhid, vbillcode, bdCorpEntity.getUnitname());
|
||||
}
|
||||
} else {
|
||||
logger.info("poOrderSonDto.size为0!");
|
||||
|
|
|
@ -13,10 +13,8 @@ import com.hzya.frame.plugin.lets.dao.*;
|
|||
import com.hzya.frame.plugin.lets.entity.*;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||
import com.hzya.frame.plugin.lets.util.OfsStandardUtil;
|
||||
import com.hzya.frame.plugin.lets.util.OnlyImplementProxyOrderUtil;
|
||||
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
|
||||
import com.hzya.frame.plugin.lets.util.RdclUtil;
|
||||
import com.hzya.frame.plugin.lets.util.*;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
|
@ -85,6 +83,9 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
|
|||
@Autowired
|
||||
private OfsStandardUtil ofsStandardUtil;
|
||||
|
||||
@Autowired
|
||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||
|
||||
@Autowired
|
||||
private OnlyImplementProxyOrderUtil onlyImplementProxyOrder;
|
||||
|
||||
|
@ -100,7 +101,7 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseReturn";
|
||||
return "purchase.ProxyPurchaseReturn";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -290,109 +291,142 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
|
|||
PoOrderRerturnSonDto poOrderSonDto = poOrderRerturnSonDtos.get(i);
|
||||
List<DetailsDto> details = poOrderSonDto.getDetails();
|
||||
|
||||
//生成业务日期
|
||||
String generateBusinessDate = createGenerateBusinessDate(poOrderSonDto);
|
||||
String generateBusinessDate = null;
|
||||
try {
|
||||
//生成业务日期
|
||||
generateBusinessDate = createGenerateBusinessDate(poOrderSonDto);
|
||||
|
||||
BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司、收货公司
|
||||
BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门
|
||||
BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织
|
||||
BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity();//客商基本档案-供应商
|
||||
BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商管理档案-供应商
|
||||
BdCalbodyEntity bdCalbodyEntity = poOrderSonDto.getBdCalbodyEntity();//收货库存组织
|
||||
BdStordocEntity bdStordocEntity = poOrderSonDto.getBdStordocEntity();//收货仓库
|
||||
BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司、收货公司
|
||||
BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门
|
||||
BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织
|
||||
BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity();//客商基本档案-供应商
|
||||
BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商管理档案-供应商
|
||||
BdCalbodyEntity bdCalbodyEntity = poOrderSonDto.getBdCalbodyEntity();//收货库存组织
|
||||
BdStordocEntity bdStordocEntity = poOrderSonDto.getBdStordocEntity();//收货仓库
|
||||
|
||||
PurchaseReturnOrder purchaseReturnOrder = poOrderSonDto.getPurchaseReturnOrder();//OFS采退订单
|
||||
PurchaseReturnOrderHeader header = purchaseReturnOrder.getHeader();
|
||||
List<PurchaseReturnOrderDetails> details1 = purchaseReturnOrder.getDetails();
|
||||
PurchaseReturnOrder purchaseReturnOrder = poOrderSonDto.getPurchaseReturnOrder();//OFS采退订单
|
||||
PurchaseReturnOrderHeader header = purchaseReturnOrder.getHeader();
|
||||
List<PurchaseReturnOrderDetails> details1 = purchaseReturnOrder.getDetails();
|
||||
|
||||
//采购订单表头
|
||||
PoOrderParentDto poOrderParentDto = new PoOrderParentDto();
|
||||
poOrderParentDto.setBreturn(true);//确认退货
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程
|
||||
poOrderParentDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//采购部门
|
||||
poOrderParentDto.setCoperator("0001A110000000000U3D");//制单人
|
||||
poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());//采购组织
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());//采购公司
|
||||
poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());//供应商管理档案
|
||||
poOrderParentDto.setDauditdate(generateBusinessDate);//审批日期
|
||||
poOrderParentDto.setDorderdate(generateBusinessDate);//订单日期
|
||||
poOrderParentDto.setDrevisiondate(generateBusinessDate);//修改日期
|
||||
//2024年8月21日 13:34:07 对比了手工建单和接口传单,发现接口传单少了这个:是否由销售订单协同生成、补货标志、是否已协同生成销售订单 默认为N
|
||||
poOrderParentDto.setBsocooptome(false);//是否由销售订单协同生成
|
||||
poOrderParentDto.setBisreplenish(false);//补货标志
|
||||
poOrderParentDto.setBcooptoso(false);//是否已协同生成销售订单
|
||||
poOrderParentDto.setCgiveinvoicevendor(bdCumandocEntity.getPkCumandoc());//发票方id
|
||||
//采购订单表头
|
||||
PoOrderParentDto poOrderParentDto = new PoOrderParentDto();
|
||||
poOrderParentDto.setBreturn(true);//确认退货
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程
|
||||
poOrderParentDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//采购部门
|
||||
poOrderParentDto.setCoperator("0001A110000000000U3D");//制单人
|
||||
poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());//采购组织
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());//采购公司
|
||||
poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());//供应商管理档案
|
||||
poOrderParentDto.setDauditdate(generateBusinessDate);//审批日期
|
||||
poOrderParentDto.setDorderdate(generateBusinessDate);//订单日期
|
||||
poOrderParentDto.setDrevisiondate(generateBusinessDate);//修改日期
|
||||
//2024年8月21日 13:34:07 对比了手工建单和接口传单,发现接口传单少了这个:是否由销售订单协同生成、补货标志、是否已协同生成销售订单 默认为N
|
||||
poOrderParentDto.setBsocooptome(false);//是否由销售订单协同生成
|
||||
poOrderParentDto.setBisreplenish(false);//补货标志
|
||||
poOrderParentDto.setBcooptoso(false);//是否已协同生成销售订单
|
||||
poOrderParentDto.setCgiveinvoicevendor(bdCumandocEntity.getPkCumandoc());//发票方id
|
||||
|
||||
poOrderParentDto.setVdef17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
poOrderParentDto.setVdef19(poOrderSonDto.getCode());//原单单号
|
||||
poOrderParentDto.setVdef20(poOrderSonDto.getId());//原单主键
|
||||
poOrderParentDto.setVdef17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
poOrderParentDto.setVdef19(poOrderSonDto.getCode());//原单单号
|
||||
poOrderParentDto.setVdef20(poOrderSonDto.getId());//原单主键
|
||||
|
||||
//收发类别
|
||||
poOrderParentDto.setPk_defdoc3(bdRdclEntity.getPkRdcl());
|
||||
poOrderParentDto.setVdef3(bdRdclEntity.getRdname());
|
||||
//收发类别
|
||||
poOrderParentDto.setPk_defdoc3(bdRdclEntity.getPkRdcl());
|
||||
poOrderParentDto.setVdef3(bdRdclEntity.getRdname());
|
||||
|
||||
//采购订单明细行
|
||||
List<PoOrderChildrenDto> poOrderChildrenDtoList = new ArrayList<>();
|
||||
//采购订单明细行
|
||||
List<PoOrderChildrenDto> poOrderChildrenDtoList = new ArrayList<>();
|
||||
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
DetailsDto detailsDto = details.get(j);
|
||||
PurchaseReturnOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(details1, detailsDto);
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
DetailsDto detailsDto = details.get(j);
|
||||
PurchaseReturnOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(details1, detailsDto);
|
||||
|
||||
//TODO 测试
|
||||
detailsDto.setShipQty("1");
|
||||
ofsPoOrderDetail.setFulfillAmount("10");
|
||||
//TODO 测试
|
||||
detailsDto.setShipQty("1");
|
||||
ofsPoOrderDetail.setFulfillAmount("10");
|
||||
|
||||
//2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(detailsDto, bdCorpEntity.getPkCorp());
|
||||
String receivedQty = detailsDto.getShipQty();//实发数量
|
||||
String fulfillAmount = ofsPoOrderDetail.getDiscountPrice();//实际进价
|
||||
//2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(detailsDto, bdCorpEntity.getPkCorp());
|
||||
String receivedQty = detailsDto.getShipQty();//实发数量
|
||||
String fulfillAmount = ofsPoOrderDetail.getDiscountPrice();//实际进价
|
||||
|
||||
//原币含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采退出库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采退出库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
//原币含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采退出库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采退出库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
}
|
||||
|
||||
PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto();
|
||||
poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id
|
||||
poOrderChildrenDto.setNordernum("-" + new BigDecimal(receivedQty).stripTrailingZeros().toPlainString());//订货数量
|
||||
poOrderChildrenDto.setNorgtaxprice(noriginalcurprice.stripTrailingZeros().toPlainString());//原币含税单价
|
||||
poOrderChildrenDto.setPk_arrvcorp(bdCorpEntity.getPkCorp());//收货公司
|
||||
poOrderChildrenDto.setPk_arrvstoorg(bdCalbodyEntity.getPkCalbody());//收货库存组织
|
||||
poOrderChildrenDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//收货仓库
|
||||
poOrderChildrenDto.setPk_reqcorp(bdCorpEntity.getPkCorp());//需求公司 *
|
||||
// poOrderChildrenDto.setIisreplenish(false);//补货标识 *
|
||||
poOrderChildrenDto.setCoperator("0001A110000000000U3D");//操作员id
|
||||
// poOrderChildrenDto.setBreceiveplan(false);//存在到货计划
|
||||
poOrderChildrenDtoList.add(poOrderChildrenDto);
|
||||
|
||||
//2024年8月20日 16:00:03 已经和佳妮总确认,计划到货日期,不用进行传递
|
||||
}
|
||||
|
||||
PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto();
|
||||
poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id
|
||||
poOrderChildrenDto.setNordernum("-" + new BigDecimal(receivedQty).stripTrailingZeros().toPlainString());//订货数量
|
||||
poOrderChildrenDto.setNorgtaxprice(noriginalcurprice.stripTrailingZeros().toPlainString());//原币含税单价
|
||||
poOrderChildrenDto.setPk_arrvcorp(bdCorpEntity.getPkCorp());//收货公司
|
||||
poOrderChildrenDto.setPk_arrvstoorg(bdCalbodyEntity.getPkCalbody());//收货库存组织
|
||||
poOrderChildrenDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//收货仓库
|
||||
poOrderChildrenDto.setPk_reqcorp(bdCorpEntity.getPkCorp());//需求公司 *
|
||||
// poOrderChildrenDto.setIisreplenish(false);//补货标识 *
|
||||
poOrderChildrenDto.setCoperator("0001A110000000000U3D");//操作员id
|
||||
// poOrderChildrenDto.setBreceiveplan(false);//存在到货计划
|
||||
poOrderChildrenDtoList.add(poOrderChildrenDto);
|
||||
List<PoOrderParentChildrenDto> poOrderParentChildrenDtoList = new ArrayList<>();
|
||||
PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto();
|
||||
poOrderParentChildrenDto.setParentvo(poOrderParentDto);
|
||||
poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList);
|
||||
poOrderParentChildrenDtoList.add(poOrderParentChildrenDto);
|
||||
|
||||
//2024年8月20日 16:00:03 已经和佳妮总确认,计划到货日期,不用进行传递
|
||||
Map<String, List<PoOrderParentChildrenDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("puordervo", poOrderParentChildrenDtoList);
|
||||
PoOrderHeadBodyDto poOrderHeadBodyDto = sendU8CPoOrder(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String corderid = null;
|
||||
String vordercode = null;
|
||||
PoOrderHeadDto parentvo = poOrderHeadBodyDto.getParentvo();
|
||||
List<PoOrderBodyDto> childrenvo = poOrderHeadBodyDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
corderid = parentvo.getCorderid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vordercode = parentvo.getVordercode();
|
||||
}
|
||||
logger.info("推送U8C代理品牌采购订单采购!U8C采购订单主键:{} U8C采购订单编码:{}", corderid, vordercode);
|
||||
|
||||
// 成功记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(poOrderSonDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(poOrderHeadBodyDto));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
} catch (Exception e) {
|
||||
logger.error("推送U8C代理品牌红字采购订单采购失败!", e);
|
||||
|
||||
// 失败记录日志
|
||||
String message = e.getMessage();
|
||||
if (message == null) {
|
||||
message = "未知错误";
|
||||
}
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(poOrderSonDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(message));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
List<PoOrderParentChildrenDto> poOrderParentChildrenDtoList = new ArrayList<>();
|
||||
PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto();
|
||||
poOrderParentChildrenDto.setParentvo(poOrderParentDto);
|
||||
poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList);
|
||||
poOrderParentChildrenDtoList.add(poOrderParentChildrenDto);
|
||||
|
||||
Map<String, List<PoOrderParentChildrenDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("puordervo", poOrderParentChildrenDtoList);
|
||||
PoOrderHeadBodyDto poOrderHeadBodyDto = sendU8CPoOrder(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String corderid = null;
|
||||
String vordercode = null;
|
||||
PoOrderHeadDto parentvo = poOrderHeadBodyDto.getParentvo();
|
||||
List<PoOrderBodyDto> childrenvo = poOrderHeadBodyDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
corderid = parentvo.getCorderid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vordercode = parentvo.getVordercode();
|
||||
}
|
||||
logger.info("推送U8C代理品牌采购订单采购!U8C采购订单主键:{} U8C采购订单编码:{}", corderid, vordercode);
|
||||
}
|
||||
} else {
|
||||
logger.info("poOrderSonDto.size为0!");
|
||||
|
|
|
@ -13,10 +13,8 @@ import com.hzya.frame.plugin.lets.dao.*;
|
|||
import com.hzya.frame.plugin.lets.entity.*;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||
import com.hzya.frame.plugin.lets.util.OfsStandardUtil;
|
||||
import com.hzya.frame.plugin.lets.util.OnlyImplementProxyOrderUtil;
|
||||
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
|
||||
import com.hzya.frame.plugin.lets.util.RdclUtil;
|
||||
import com.hzya.frame.plugin.lets.util.*;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
|
||||
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
|
||||
|
@ -85,6 +83,9 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
|
|||
@Autowired
|
||||
private OnlyImplementProxyOrderUtil onlyImplementProxyOrder;
|
||||
|
||||
@Autowired
|
||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
|
@ -97,7 +98,7 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous";
|
||||
return "purchase.ProxyPurchaseWarehous";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -284,108 +285,141 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
|
|||
PoOrderSonDto poOrderSonDto = poOrderSonDtos.get(i);
|
||||
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = poOrderSonDto.getDetails();
|
||||
|
||||
//生成业务日期
|
||||
String generateBusinessDate = createGenerateBusinessDate(poOrderSonDto);
|
||||
String generateBusinessDate = null;
|
||||
try {
|
||||
//生成业务日期
|
||||
generateBusinessDate = createGenerateBusinessDate(poOrderSonDto);
|
||||
|
||||
BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司、收货公司
|
||||
BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门
|
||||
BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织
|
||||
BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity();//客商基本档案-供应商
|
||||
BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商管理档案-供应商
|
||||
BdCalbodyEntity bdCalbodyEntity = poOrderSonDto.getBdCalbodyEntity();//收货库存组织
|
||||
BdStordocEntity bdStordocEntity = poOrderSonDto.getBdStordocEntity();//收货仓库
|
||||
BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司、收货公司
|
||||
BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门
|
||||
BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织
|
||||
BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity();//客商基本档案-供应商
|
||||
BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商管理档案-供应商
|
||||
BdCalbodyEntity bdCalbodyEntity = poOrderSonDto.getBdCalbodyEntity();//收货库存组织
|
||||
BdStordocEntity bdStordocEntity = poOrderSonDto.getBdStordocEntity();//收货仓库
|
||||
|
||||
OfsPoOrderData ofsPoOrderData = poOrderSonDto.getOfsPoOrderData();//OFS采购订单
|
||||
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> ofsPoOrderDataDetails = ofsPoOrderData.getDetails();
|
||||
OfsPoOrderData ofsPoOrderData = poOrderSonDto.getOfsPoOrderData();//OFS采购订单
|
||||
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
|
||||
List<OfsPoOrderDetails> ofsPoOrderDataDetails = ofsPoOrderData.getDetails();
|
||||
|
||||
//采购订单表头
|
||||
PoOrderParentDto poOrderParentDto = new PoOrderParentDto();
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程
|
||||
poOrderParentDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//采购部门
|
||||
poOrderParentDto.setCoperator("0001A110000000000U3D");//制单人
|
||||
poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());//采购组织
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());//采购公司
|
||||
poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());//供应商管理档案
|
||||
poOrderParentDto.setDauditdate(generateBusinessDate);//审批日期
|
||||
poOrderParentDto.setDorderdate(generateBusinessDate);//订单日期
|
||||
poOrderParentDto.setDrevisiondate(generateBusinessDate);//修改日期
|
||||
//2024年8月21日 13:34:07 对比了手工建单和接口传单,发现接口传单少了这个:是否由销售订单协同生成、补货标志、是否已协同生成销售订单 默认为N
|
||||
poOrderParentDto.setBsocooptome(false);//是否由销售订单协同生成
|
||||
poOrderParentDto.setBisreplenish(false);//补货标志
|
||||
poOrderParentDto.setBcooptoso(false);//是否已协同生成销售订单
|
||||
poOrderParentDto.setCgiveinvoicevendor(bdCumandocEntity.getPkCumandoc());//发票方id
|
||||
//采购订单表头
|
||||
PoOrderParentDto poOrderParentDto = new PoOrderParentDto();
|
||||
poOrderParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程
|
||||
poOrderParentDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//采购部门
|
||||
poOrderParentDto.setCoperator("0001A110000000000U3D");//制单人
|
||||
poOrderParentDto.setCpurorganization(bdPurorgEntity.getPkPurorg());//采购组织
|
||||
poOrderParentDto.setPk_corp(bdCorpEntity.getPkCorp());//采购公司
|
||||
poOrderParentDto.setCvendormangid(bdCumandocEntity.getPkCumandoc());//供应商管理档案
|
||||
poOrderParentDto.setDauditdate(generateBusinessDate);//审批日期
|
||||
poOrderParentDto.setDorderdate(generateBusinessDate);//订单日期
|
||||
poOrderParentDto.setDrevisiondate(generateBusinessDate);//修改日期
|
||||
//2024年8月21日 13:34:07 对比了手工建单和接口传单,发现接口传单少了这个:是否由销售订单协同生成、补货标志、是否已协同生成销售订单 默认为N
|
||||
poOrderParentDto.setBsocooptome(false);//是否由销售订单协同生成
|
||||
poOrderParentDto.setBisreplenish(false);//补货标志
|
||||
poOrderParentDto.setBcooptoso(false);//是否已协同生成销售订单
|
||||
poOrderParentDto.setCgiveinvoicevendor(bdCumandocEntity.getPkCumandoc());//发票方id
|
||||
|
||||
poOrderParentDto.setVdef17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
poOrderParentDto.setVdef19(poOrderSonDto.getCode());//原单单号
|
||||
poOrderParentDto.setVdef20(poOrderSonDto.getId());//原单主键
|
||||
poOrderParentDto.setVdef17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
poOrderParentDto.setVdef19(poOrderSonDto.getCode());//原单单号
|
||||
poOrderParentDto.setVdef20(poOrderSonDto.getId());//原单主键
|
||||
|
||||
//收发类别
|
||||
poOrderParentDto.setPk_defdoc3(bdRdclEntity.getPkRdcl());
|
||||
poOrderParentDto.setVdef3(bdRdclEntity.getRdname());
|
||||
//收发类别
|
||||
poOrderParentDto.setPk_defdoc3(bdRdclEntity.getPkRdcl());
|
||||
poOrderParentDto.setVdef3(bdRdclEntity.getRdname());
|
||||
|
||||
//采购订单明细行
|
||||
List<PoOrderChildrenDto> poOrderChildrenDtoList = new ArrayList<>();
|
||||
//采购订单明细行
|
||||
List<PoOrderChildrenDto> poOrderChildrenDtoList = new ArrayList<>();
|
||||
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
|
||||
OfsPoOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(ofsPoOrderDataDetails, stockinB);
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
|
||||
OfsPoOrderDetails ofsPoOrderDetail = findOfsPoOrderDetail(ofsPoOrderDataDetails, stockinB);
|
||||
|
||||
//TODO 测试
|
||||
stockinB.setReceivedQty("1");
|
||||
ofsPoOrderDetail.setFulfillAmount("10");
|
||||
//TODO 测试
|
||||
stockinB.setReceivedQty("1");
|
||||
ofsPoOrderDetail.setFulfillAmount("10");
|
||||
|
||||
//2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
||||
String receivedQty = stockinB.getReceivedQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetail.getFulfillAmount();//实收累计总金额
|
||||
//2024年8月20日 16:02:21 已经和妮姐、万万确认,采购公司和收货公司目前是一致的,暂时不用区分取数逻辑
|
||||
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
|
||||
String receivedQty = stockinB.getReceivedQty();//实收数量
|
||||
String fulfillAmount = ofsPoOrderDetail.getFulfillAmount();//实收累计总金额
|
||||
|
||||
//原币含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采购入库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
//原币含税单价
|
||||
BigDecimal noriginalcurprice = null;
|
||||
try {
|
||||
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("计算采购入库单原币含税单价失败", e);
|
||||
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
|
||||
}
|
||||
|
||||
PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto();
|
||||
poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id
|
||||
poOrderChildrenDto.setNordernum(receivedQty);//订货数量
|
||||
poOrderChildrenDto.setNorgtaxprice(noriginalcurprice.stripTrailingZeros().toPlainString());//原币含税单价
|
||||
poOrderChildrenDto.setPk_arrvcorp(bdCorpEntity.getPkCorp());//收货公司
|
||||
poOrderChildrenDto.setPk_arrvstoorg(bdCalbodyEntity.getPkCalbody());//收货库存组织
|
||||
poOrderChildrenDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//收货仓库
|
||||
poOrderChildrenDto.setPk_reqcorp(bdCorpEntity.getPkCorp());//需求公司 *
|
||||
// poOrderChildrenDto.setIisreplenish(false);//补货标识 *
|
||||
poOrderChildrenDto.setCoperator("0001A110000000000U3D");//操作员id
|
||||
// poOrderChildrenDto.setBreceiveplan(false);//存在到货计划
|
||||
poOrderChildrenDtoList.add(poOrderChildrenDto);
|
||||
|
||||
//2024年8月20日 16:00:03 已经和佳妮总确认,计划到货日期,不用进行传递
|
||||
}
|
||||
|
||||
PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto();
|
||||
poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id
|
||||
poOrderChildrenDto.setNordernum(receivedQty);//订货数量
|
||||
poOrderChildrenDto.setNorgtaxprice(noriginalcurprice.stripTrailingZeros().toPlainString());//原币含税单价
|
||||
poOrderChildrenDto.setPk_arrvcorp(bdCorpEntity.getPkCorp());//收货公司
|
||||
poOrderChildrenDto.setPk_arrvstoorg(bdCalbodyEntity.getPkCalbody());//收货库存组织
|
||||
poOrderChildrenDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//收货仓库
|
||||
poOrderChildrenDto.setPk_reqcorp(bdCorpEntity.getPkCorp());//需求公司 *
|
||||
// poOrderChildrenDto.setIisreplenish(false);//补货标识 *
|
||||
poOrderChildrenDto.setCoperator("0001A110000000000U3D");//操作员id
|
||||
// poOrderChildrenDto.setBreceiveplan(false);//存在到货计划
|
||||
poOrderChildrenDtoList.add(poOrderChildrenDto);
|
||||
List<PoOrderParentChildrenDto> poOrderParentChildrenDtoList = new ArrayList<>();
|
||||
PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto();
|
||||
poOrderParentChildrenDto.setParentvo(poOrderParentDto);
|
||||
poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList);
|
||||
poOrderParentChildrenDtoList.add(poOrderParentChildrenDto);
|
||||
|
||||
//2024年8月20日 16:00:03 已经和佳妮总确认,计划到货日期,不用进行传递
|
||||
Map<String, List<PoOrderParentChildrenDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("puordervo", poOrderParentChildrenDtoList);
|
||||
PoOrderHeadBodyDto poOrderHeadBodyDto = sendU8CPoOrder(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String corderid = null;
|
||||
String vordercode = null;
|
||||
PoOrderHeadDto parentvo = poOrderHeadBodyDto.getParentvo();
|
||||
List<PoOrderBodyDto> childrenvo = poOrderHeadBodyDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
corderid = parentvo.getCorderid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vordercode = parentvo.getVordercode();
|
||||
}
|
||||
logger.info("推送U8C代理品牌采购订单采购!U8C采购订单主键:{} U8C采购订单编码:{}", corderid, vordercode);
|
||||
|
||||
// 成功记录日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(poOrderSonDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(poOrderHeadBodyDto));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
} catch (Exception e) {
|
||||
logger.error("推送U8C代理品牌采购订单采购失败", e);
|
||||
|
||||
// 失败记录日志
|
||||
String message = e.getMessage();
|
||||
if (message == null) {
|
||||
message = "未知错误";
|
||||
}
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(JSON.toJSONString(poOrderSonDto));//原始数据json
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(message));//返回结果
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(generateBusinessDate);
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId());
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
List<PoOrderParentChildrenDto> poOrderParentChildrenDtoList = new ArrayList<>();
|
||||
PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto();
|
||||
poOrderParentChildrenDto.setParentvo(poOrderParentDto);
|
||||
poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList);
|
||||
poOrderParentChildrenDtoList.add(poOrderParentChildrenDto);
|
||||
|
||||
Map<String, List<PoOrderParentChildrenDto>> stringStringMap = new HashMap<>();
|
||||
stringStringMap.put("puordervo", poOrderParentChildrenDtoList);
|
||||
PoOrderHeadBodyDto poOrderHeadBodyDto = sendU8CPoOrder(JSON.toJSONString(stringStringMap));
|
||||
|
||||
String corderid = null;
|
||||
String vordercode = null;
|
||||
PoOrderHeadDto parentvo = poOrderHeadBodyDto.getParentvo();
|
||||
List<PoOrderBodyDto> childrenvo = poOrderHeadBodyDto.getChildrenvo();
|
||||
if (parentvo != null) {
|
||||
corderid = parentvo.getCorderid();
|
||||
}
|
||||
if (childrenvo != null) {
|
||||
vordercode = parentvo.getVordercode();
|
||||
}
|
||||
logger.info("推送U8C代理品牌采购订单采购!U8C采购订单主键:{} U8C采购订单编码:{}", corderid, vordercode);
|
||||
}
|
||||
} else {
|
||||
logger.info("poOrderSonDto.size为0!");
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB";
|
||||
return "sales.SoSaleOutPluginInitializerToB";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -60,7 +60,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.sowow.plugin.sales.SoSaleOutPluginInitializerToC";
|
||||
return "sales.SoSaleOutPluginInitializerToC";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToB";
|
||||
return "sales.SoSaleReturnPluginInitializerToB";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -55,7 +55,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToC";
|
||||
return "sales.SoSaleReturnPluginInitializerToC";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.transfer.TransferInPluginInitializer";
|
||||
return "transfer.TransferInPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -360,7 +360,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
|||
//两层判断,一层中台转发,一层u8c返回
|
||||
if ("false".equals(ztResult.getFlag())) {
|
||||
//转发失败
|
||||
response=JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
response = JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
Assert.state(false, "丽知:OFS调拨入库订单--->U8C调拨入库订单.中台转发失败,失败原因:{}", response);
|
||||
}
|
||||
Attribute attribute = ztResult.getAttribute();
|
||||
|
@ -469,7 +469,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
all.addAll(stockinOrderSearchResponse1.getData());
|
||||
|
||||
count=stockinOrderSearchResponse1.getData().size();
|
||||
count = stockinOrderSearchResponse1.getData().size();
|
||||
}
|
||||
|
||||
return all;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "com.hzya.frame.plugin.lets.plugin.transfer.TransferOutPluginInitializer";
|
||||
return "transfer.TransferOutPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -149,12 +149,12 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
queryOfsStockoutOrderRequestVO.setClosedAt_end(endTimeStr);
|
||||
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
||||
if(transferOutOrder.size()==0){
|
||||
if (transferOutOrder.size() == 0) {
|
||||
return;
|
||||
}
|
||||
//过滤成功日志
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
|
||||
if(filterTransferOutOrders.size()==0){
|
||||
if (filterTransferOutOrders.size() == 0) {
|
||||
return;
|
||||
}
|
||||
//推送U8C
|
||||
|
@ -173,12 +173,12 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
queryOfsStockoutOrderRequestVO.setCode(stockoutNo);
|
||||
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
||||
if(transferOutOrder.size()==0){
|
||||
if (transferOutOrder.size() == 0) {
|
||||
Assert.state(false, "丽知:OFS调拨出库订单[出库完成]--->U8C调拨订单,自动生成调拨出库单(保存签字),未查询到调拨出库单:{}", stockoutNo);
|
||||
}
|
||||
//过滤成功日志
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
|
||||
if(filterTransferOutOrders.size()==0){
|
||||
if (filterTransferOutOrders.size() == 0) {
|
||||
Assert.state(false, "丽知:OFS调拨出库订单[出库完成]--->U8C调拨订单,自动生成调拨出库单(保存签字),该调拨出库单:{},已被推送成功,请勿重新推送", stockoutNo);
|
||||
}
|
||||
//推送U8C
|
||||
|
@ -205,12 +205,12 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
|
||||
|
||||
if(transferOutOrder.size()==0){
|
||||
if (transferOutOrder.size() == 0) {
|
||||
Assert.state(false, "丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)根据日期期间[开始时间]-[结束时间]:{}-{},未查询到调拨出库单[出库完成]", startTime, endTime);
|
||||
}
|
||||
//过滤成功日志
|
||||
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
|
||||
if(filterTransferOutOrders.size()==0){
|
||||
if (filterTransferOutOrders.size() == 0) {
|
||||
Assert.state(false, "丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字)根据日期期间[开始时间]-[结束时间]:{}-{},该调期调拨出库单[出库完成]已被推送成功,请勿重新推送", startTime, endTime);
|
||||
}
|
||||
//推送U8C
|
||||
|
@ -342,7 +342,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
//两层判断,一层中台转发,一层u8c返回
|
||||
if ("false".equals(ztResult.getFlag())) {
|
||||
//转发失败
|
||||
response=JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
response = JSONUtil.toJsonStr(ztResult.getAttribute());
|
||||
Assert.state(false, "丽知:OFS调拨出库订单--->U8C调拨订单,自动生成调拨出库单(保存签字).中台转发失败,失败原因:{}", ztResult.getAttribute());
|
||||
}
|
||||
Attribute attribute = ztResult.getAttribute();
|
||||
|
@ -379,11 +379,11 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
//失败
|
||||
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
|
||||
String ErrMessage=null;
|
||||
String ErrMessage = null;
|
||||
if (reusltStrDto != null) {
|
||||
ErrMessage = "推送U8C,丽知:OFS调整出库--->U8C其它出库失败,失败原因:" + reusltStrDto.getErrormsg();
|
||||
}else {
|
||||
ErrMessage=e.getMessage();
|
||||
} else {
|
||||
ErrMessage = e.getMessage();
|
||||
}
|
||||
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
|
@ -439,7 +439,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
|
|||
StockoutOrderSearchResponse stockoutOrderSearchResponse1 = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto1);
|
||||
|
||||
all.addAll(stockoutOrderSearchResponse1.getData());
|
||||
count=stockoutOrderSearchResponse1.getData().size();
|
||||
count = stockoutOrderSearchResponse1.getData().size();
|
||||
}
|
||||
|
||||
return all;
|
||||
|
|
|
@ -57,4 +57,19 @@ public class ConsignmachiningInSonDto extends StockinOrderSearchResponse.Stockin
|
|||
* U8C委外订单明细行
|
||||
*/
|
||||
private List<ScOrderBEntity> scOrderBEntityList;
|
||||
|
||||
/**
|
||||
* 采购组织
|
||||
*/
|
||||
private BdPurorgEntity bdPurorgEntity;
|
||||
|
||||
/**
|
||||
* 客商基本档案
|
||||
*/
|
||||
private BdCubasdocEntity bdCubasdocEntity;
|
||||
|
||||
/**
|
||||
* 客商管理档案
|
||||
*/
|
||||
private BdCumandocEntity bdCumandocEntity;
|
||||
}
|
||||
|
|
|
@ -5,20 +5,32 @@ import cn.hutool.core.lang.Assert;
|
|||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//保存或者更新业务日志
|
||||
|
||||
/**
|
||||
* 保存或者更新业务日志
|
||||
*/
|
||||
@Component
|
||||
public class SaveOrUpdateBusinessLogUtil {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(SaveOrUpdateBusinessLogUtil.class);
|
||||
|
||||
@Autowired
|
||||
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
|
||||
|
||||
private static final Object insertOrUpdateLock = new Object();
|
||||
|
||||
private static final Object queryDetailsLock = new Object();
|
||||
|
||||
private static final String successY = "Y";
|
||||
|
||||
private static final String failN = "N";
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
*
|
||||
|
@ -29,29 +41,37 @@ public class SaveOrUpdateBusinessLogUtil {
|
|||
Assert.notNull(integrationTaskLivingDetailsEntity.getRootAppPk(), "源系统单号不能为空");
|
||||
Assert.notNull(integrationTaskLivingDetailsEntity.getPluginId(), "场景id不能为空");
|
||||
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetails = null;
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity1.setRootAppPk(integrationTaskLivingDetailsEntity.getRootAppPk());
|
||||
integrationTaskLivingDetailsEntity1.setPluginId(integrationTaskLivingDetailsEntity.getPluginId());
|
||||
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity1);
|
||||
if (integrationTaskLivingDetailsEntities != null && integrationTaskLivingDetailsEntities.size() > 0) {
|
||||
integrationTaskLivingDetails = integrationTaskLivingDetailsEntities.get(0);
|
||||
}
|
||||
if (integrationTaskLivingDetails != null) {
|
||||
//存在
|
||||
synchronized (insertOrUpdateLock) {
|
||||
integrationTaskLivingDetailsEntity.setId(integrationTaskLivingDetails.getId());
|
||||
updateSuccessMessage(integrationTaskLivingDetailsEntity);
|
||||
// iIntegrationTaskLivingDetailsDao.update("com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.impl.IntegrationTaskLivingDetailsDaoImpl.entity_updatebyid", integrationTaskLivingDetailsEntity);
|
||||
iIntegrationTaskLivingDetailsDao.update(integrationTaskLivingDetailsEntity);
|
||||
try {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetails = null;
|
||||
synchronized (queryDetailsLock) {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity1.setRootAppPk(integrationTaskLivingDetailsEntity.getRootAppPk());
|
||||
integrationTaskLivingDetailsEntity1.setPluginId(integrationTaskLivingDetailsEntity.getPluginId());
|
||||
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity1);
|
||||
if (integrationTaskLivingDetailsEntities != null && integrationTaskLivingDetailsEntities.size() > 0) {
|
||||
integrationTaskLivingDetails = integrationTaskLivingDetailsEntities.get(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//不存在
|
||||
Long uuid = UUIDLong.longUUID();
|
||||
integrationTaskLivingDetailsEntity.setId(String.valueOf(uuid));
|
||||
updateSuccessMessage(integrationTaskLivingDetailsEntity);
|
||||
IntegrationTaskLivingDetailsEntity save = iIntegrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity);
|
||||
System.out.println("save = " + save);
|
||||
if (integrationTaskLivingDetails != null) {
|
||||
//存在
|
||||
synchronized (insertOrUpdateLock) {
|
||||
integrationTaskLivingDetailsEntity.setId(integrationTaskLivingDetails.getId());
|
||||
updateSuccessMessage(integrationTaskLivingDetailsEntity);
|
||||
// iIntegrationTaskLivingDetailsDao.update("com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.impl.IntegrationTaskLivingDetailsDaoImpl.entity_updatebyid", integrationTaskLivingDetailsEntity);
|
||||
iIntegrationTaskLivingDetailsDao.update(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
} else {
|
||||
//不存在
|
||||
Long uuid = UUIDLong.longUUID();
|
||||
integrationTaskLivingDetailsEntity.setId(String.valueOf(uuid));
|
||||
updateSuccessMessage(integrationTaskLivingDetailsEntity);
|
||||
IntegrationTaskLivingDetailsEntity save = iIntegrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity);
|
||||
// System.out.println("save = " + save);
|
||||
logger.info("integration_task_living_details->日志保存成功,主键:{}", save.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("SaveOrUpdateBusinessLogUtil对应的saveOrUpdate方法抛出异常,日志详情保存失败!", e);
|
||||
//2024年9月3日 10:26:45 如果这里往上抛出异常,没有功能搭配处理
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,14 +82,30 @@ public class SaveOrUpdateBusinessLogUtil {
|
|||
*/
|
||||
private void updateSuccessMessage(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
if (integrationTaskLivingDetailsEntity != null) {
|
||||
if ("Y".equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
if (successY.equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
//成功
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData("success");
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo("success");
|
||||
String successIdentification = "success";
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(successIdentification);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(successIdentification);
|
||||
/**
|
||||
* integrationTaskLivingDetailsEntity.setRoot_app_new_data(JSON.toJSONString(searchPurchaseReceiptOrder));
|
||||
* integrationTaskLivingDetailsEntity.setNew_transmit_info(cgrkApi);
|
||||
*/
|
||||
} else if (failN.equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
//2024年9月2日 17:09:07 如果失败,仅保留500个字符,用于平衡数据库性能
|
||||
//2024年9月2日 17:15:19 如果该单据判断为失败,则integration_task_living_details表的root_app_new_data、new_transmit_info字段,仅保留500个长度的字符,用于平衡性能,速网、珍视名项目这一块性能很差
|
||||
String rootAppNewData = null;
|
||||
if (integrationTaskLivingDetailsEntity.getRootAppNewData() != null) {
|
||||
rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData().substring(0, 500);
|
||||
}
|
||||
String newTransmitInfo = null;
|
||||
if (integrationTaskLivingDetailsEntity.getNewTransmitInfo() != null) {
|
||||
newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo().substring(0, 500);
|
||||
}
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo);
|
||||
} else {
|
||||
Assert.state(false, "不合法的newState,不能为空请传递Y或者N!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,4 +51,6 @@
|
|||
|
||||
<bean name="soSaleinvoiceDao" class="com.hzya.frame.plugin.lets.dao.impl.SoSaleinvoiceDaoImpl"/>
|
||||
<bean name="soSaleinvoiceBDao" class="com.hzya.frame.plugin.lets.dao.impl.SoSaleinvoiceBDaoImpl"/>
|
||||
|
||||
<bean name="bdBomDao" class="com.hzya.frame.plugin.lets.dao.impl.BdBomDaoImpl"/>
|
||||
</beans>
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<bean name="proxyPurchaseReturn" class="com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseReturn"/>
|
||||
|
||||
<!-- <bean name="consignmachiningIn" class="com.hzya.frame.plugin.lets.plugin.outsourc.ConsignmachiningIn"/>-->
|
||||
<bean name="consignmachiningIn" class="com.hzya.frame.plugin.lets.plugin.outsourc.ConsignmachiningIn"/>
|
||||
<!-- <bean name="consignmachiningInReturn" class="com.hzya.frame.plugin.lets.plugin.outsourc.ConsignmachiningInReturn"/>-->
|
||||
|
||||
<bean name="scOrderBDao" class="com.hzya.frame.plugin.lets.dao.impl.ScOrderBDaoImpl"/>
|
||||
|
|
Loading…
Reference in New Issue