Merge remote-tracking branch 'origin/lets' into lets

This commit is contained in:
sx 2024-08-23 09:00:15 +08:00
commit 33335195dd
39 changed files with 2978 additions and 2140 deletions

View File

@ -40,6 +40,8 @@ public class OverallConstant {
//调拨 //调拨
prodOverPublic.put("approveqzCode", "8000370009");//调拨订单保存即审批 prodOverPublic.put("approveqzCode", "8000370009");//调拨订单保存即审批
prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批 prodOverPublic.put("approveqz", "/u8cloud/api/to/transorder/saveapprove");//调拨订单保存即审批
prodOverPublic.put("approveInqzCode", "8000370054");//调拨入库保存并签字
prodOverPublic.put("approveInqz", "/u8cloud/api/ic/allocationIn/save/sign");//调拨入库保存并签字
//其他出入库 //其他出入库
prodOverPublic.put("otherinqzCode", "8000370007");//库存其他入库保存即签字 prodOverPublic.put("otherinqzCode", "8000370007");//库存其他入库保存即签字

View File

@ -0,0 +1,15 @@
package com.hzya.frame.plugin.lets.dao;
import com.hzya.frame.plugin.lets.entity.BdPurorgEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (BD_PURORG: table)表数据库访问层
*
* @author makejava
* @since 2024-08-20 14:20:10
*/
public interface IBdPurorgDao extends IBaseDao<BdPurorgEntity, String> {
}

View File

@ -16,6 +16,7 @@ public interface IIcGeneralBDao extends IBaseDao<IcGeneralBEntity, String> {
* 根据cgeneralhid表头主键查询 * 根据cgeneralhid表头主键查询
*/ */
public List<IcGeneralBEntity> queryByCgeneralhid(String cgeneralhid); public List<IcGeneralBEntity> queryByCgeneralhid(String cgeneralhid);
public List<IcGeneralBEntity> queryAndCinvbasCode(String cgeneralhid);
} }

View File

@ -0,0 +1,16 @@
package com.hzya.frame.plugin.lets.dao.impl;
import com.hzya.frame.plugin.lets.entity.BdPurorgEntity;
import com.hzya.frame.plugin.lets.dao.IBdPurorgDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (BdPurorg)表数据库访问层
*
* @author makejava
* @since 2024-08-20 14:20:11
*/
public class BdPurorgDaoImpl extends MybatisGenericDao<BdPurorgEntity, String> implements IBdPurorgDao{
}

View File

@ -1,6 +1,8 @@
package com.hzya.frame.plugin.lets.dao.impl; package com.hzya.frame.plugin.lets.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.dao.IIcGeneralBDao; import com.hzya.frame.plugin.lets.dao.IIcGeneralBDao;
import com.hzya.frame.plugin.lets.entity.IcGeneralBEntity; import com.hzya.frame.plugin.lets.entity.IcGeneralBEntity;
@ -18,5 +20,10 @@ public class IcGeneralBDaoImpl extends MybatisGenericDao<IcGeneralBEntity, Strin
public List<IcGeneralBEntity> queryByCgeneralhid(String cgeneralhid) { public List<IcGeneralBEntity> queryByCgeneralhid(String cgeneralhid) {
return query("com.hzya.frame.plugin.lets.entity.IcGeneralBEntity.queryByCgeneralhid",cgeneralhid); return query("com.hzya.frame.plugin.lets.entity.IcGeneralBEntity.queryByCgeneralhid",cgeneralhid);
} }
@Override
@DS(ProfilesActiveConstant.LETS_DATE_SOURCE)
public List<IcGeneralBEntity> queryAndCinvbasCode(String cgeneralhid) {
return (List<IcGeneralBEntity>)selectList("com.hzya.frame.plugin.lets.entity.IcGeneralBEntity.queryAndCinvbasCode",cgeneralhid);
}
} }

View File

@ -0,0 +1,178 @@
package com.hzya.frame.plugin.lets.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdPurorg)实体类
*
* @author makejava
* @since 2024-08-20 14:20:11
*/
public class BdPurorgEntity extends BaseEntity {
private String code;
private String createdate;
private String def1;
private String def2;
private String def3;
private String def4;
private String def5;
private String dr;
private String memo;
private String mobile;
private String name;
private String officeaddr;
private String ownercorp;
private String pkPurorg;
private String pkResppsn;
private String sealdate;
private String settlestockorg;
private String ts;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCreatedate() {
return createdate;
}
public void setCreatedate(String createdate) {
this.createdate = createdate;
}
public String getDef1() {
return def1;
}
public void setDef1(String def1) {
this.def1 = def1;
}
public String getDef2() {
return def2;
}
public void setDef2(String def2) {
this.def2 = def2;
}
public String getDef3() {
return def3;
}
public void setDef3(String def3) {
this.def3 = def3;
}
public String getDef4() {
return def4;
}
public void setDef4(String def4) {
this.def4 = def4;
}
public String getDef5() {
return def5;
}
public void setDef5(String def5) {
this.def5 = def5;
}
public String getDr() {
return dr;
}
public void setDr(String dr) {
this.dr = dr;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOfficeaddr() {
return officeaddr;
}
public void setOfficeaddr(String officeaddr) {
this.officeaddr = officeaddr;
}
public String getOwnercorp() {
return ownercorp;
}
public void setOwnercorp(String ownercorp) {
this.ownercorp = ownercorp;
}
public String getPkPurorg() {
return pkPurorg;
}
public void setPkPurorg(String pkPurorg) {
this.pkPurorg = pkPurorg;
}
public String getPkResppsn() {
return pkResppsn;
}
public void setPkResppsn(String pkResppsn) {
this.pkResppsn = pkResppsn;
}
public String getSealdate() {
return sealdate;
}
public void setSealdate(String sealdate) {
this.sealdate = sealdate;
}
public String getSettlestockorg() {
return settlestockorg;
}
public void setSettlestockorg(String settlestockorg) {
this.settlestockorg = settlestockorg;
}
public String getTs() {
return ts;
}
public void setTs(String ts) {
this.ts = ts;
}
}

View File

@ -0,0 +1,307 @@
<?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.BdPurorgDaoImpl">
<resultMap id="get-BdPurorgEntity-result" type="com.hzya.frame.plugin.lets.entity.BdPurorgEntity" >
<result property="code" column="CODE" jdbcType="VARCHAR"/>
<result property="createdate" column="CREATEDATE" jdbcType="VARCHAR"/>
<result property="def1" column="DEF1" jdbcType="VARCHAR"/>
<result property="def2" column="DEF2" jdbcType="VARCHAR"/>
<result property="def3" column="DEF3" jdbcType="VARCHAR"/>
<result property="def4" column="DEF4" jdbcType="VARCHAR"/>
<result property="def5" column="DEF5" jdbcType="VARCHAR"/>
<result property="dr" column="DR" jdbcType="VARCHAR"/>
<result property="memo" column="MEMO" jdbcType="VARCHAR"/>
<result property="mobile" column="MOBILE" jdbcType="VARCHAR"/>
<result property="name" column="NAME" jdbcType="VARCHAR"/>
<result property="officeaddr" column="OFFICEADDR" jdbcType="VARCHAR"/>
<result property="ownercorp" column="OWNERCORP" jdbcType="VARCHAR"/>
<result property="pkPurorg" column="PK_PURORG" jdbcType="VARCHAR"/>
<result property="pkResppsn" column="PK_RESPPSN" jdbcType="VARCHAR"/>
<result property="sealdate" column="SEALDATE" jdbcType="VARCHAR"/>
<result property="settlestockorg" column="SETTLESTOCKORG" jdbcType="VARCHAR"/>
<result property="ts" column="TS" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "BdPurorgEntity_Base_Column_List">
CODE
,CREATEDATE
,DEF1
,DEF2
,DEF3
,DEF4
,DEF5
,DR
,MEMO
,MOBILE
,NAME
,OFFICEADDR
,OWNERCORP
,PK_PURORG
,PK_RESPPSN
,SEALDATE
,SETTLESTOCKORG
,TS
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-BdPurorgEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdPurorgEntity">
select
<include refid="BdPurorgEntity_Base_Column_List" />
from BD_PURORG
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE = #{code} </if>
<if test="createdate != null and createdate != ''"> and CREATEDATE = #{createdate} </if>
<if test="def1 != null and def1 != ''"> and DEF1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and DEF2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and DEF3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and DEF4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and DEF5 = #{def5} </if>
<if test="dr != null and dr != ''"> and DR = #{dr} </if>
<if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
<if test="mobile != null and mobile != ''"> and MOBILE = #{mobile} </if>
<if test="name != null and name != ''"> and NAME = #{name} </if>
<if test="officeaddr != null and officeaddr != ''"> and OFFICEADDR = #{officeaddr} </if>
<if test="ownercorp != null and ownercorp != ''"> and OWNERCORP = #{ownercorp} </if>
<if test="pkPurorg != null and pkPurorg != ''"> and PK_PURORG = #{pkPurorg} </if>
<if test="pkResppsn != null and pkResppsn != ''"> and PK_RESPPSN = #{pkResppsn} </if>
<if test="sealdate != null and sealdate != ''"> and SEALDATE = #{sealdate} </if>
<if test="settlestockorg != null and settlestockorg != ''"> and SETTLESTOCKORG = #{settlestockorg} </if>
<if test="ts != null and ts != ''"> and TS = #{ts} </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.BdPurorgEntity">
select count(1) from BD_PURORG
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE = #{code} </if>
<if test="createdate != null and createdate != ''"> and CREATEDATE = #{createdate} </if>
<if test="def1 != null and def1 != ''"> and DEF1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and DEF2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and DEF3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and DEF4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and DEF5 = #{def5} </if>
<if test="dr != null and dr != ''"> and DR = #{dr} </if>
<if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
<if test="mobile != null and mobile != ''"> and MOBILE = #{mobile} </if>
<if test="name != null and name != ''"> and NAME = #{name} </if>
<if test="officeaddr != null and officeaddr != ''"> and OFFICEADDR = #{officeaddr} </if>
<if test="ownercorp != null and ownercorp != ''"> and OWNERCORP = #{ownercorp} </if>
<if test="pkPurorg != null and pkPurorg != ''"> and PK_PURORG = #{pkPurorg} </if>
<if test="pkResppsn != null and pkResppsn != ''"> and PK_RESPPSN = #{pkResppsn} </if>
<if test="sealdate != null and sealdate != ''"> and SEALDATE = #{sealdate} </if>
<if test="settlestockorg != null and settlestockorg != ''"> and SETTLESTOCKORG = #{settlestockorg} </if>
<if test="ts != null and ts != ''"> and TS = #{ts} </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-BdPurorgEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdPurorgEntity">
select
<include refid="BdPurorgEntity_Base_Column_List" />
from BD_PURORG
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE like concat('%',#{code},'%') </if>
<if test="createdate != null and createdate != ''"> and CREATEDATE like concat('%',#{createdate},'%') </if>
<if test="def1 != null and def1 != ''"> and DEF1 like concat('%',#{def1},'%') </if>
<if test="def2 != null and def2 != ''"> and DEF2 like concat('%',#{def2},'%') </if>
<if test="def3 != null and def3 != ''"> and DEF3 like concat('%',#{def3},'%') </if>
<if test="def4 != null and def4 != ''"> and DEF4 like concat('%',#{def4},'%') </if>
<if test="def5 != null and def5 != ''"> and DEF5 like concat('%',#{def5},'%') </if>
<if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
<if test="memo != null and memo != ''"> and MEMO like concat('%',#{memo},'%') </if>
<if test="mobile != null and mobile != ''"> and MOBILE like concat('%',#{mobile},'%') </if>
<if test="name != null and name != ''"> and NAME like concat('%',#{name},'%') </if>
<if test="officeaddr != null and officeaddr != ''"> and OFFICEADDR like concat('%',#{officeaddr},'%') </if>
<if test="ownercorp != null and ownercorp != ''"> and OWNERCORP like concat('%',#{ownercorp},'%') </if>
<if test="pkPurorg != null and pkPurorg != ''"> and PK_PURORG like concat('%',#{pkPurorg},'%') </if>
<if test="pkResppsn != null and pkResppsn != ''"> and PK_RESPPSN like concat('%',#{pkResppsn},'%') </if>
<if test="sealdate != null and sealdate != ''"> and SEALDATE like concat('%',#{sealdate},'%') </if>
<if test="settlestockorg != null and settlestockorg != ''"> and SETTLESTOCKORG like concat('%',#{settlestockorg},'%') </if>
<if test="ts != null and ts != ''"> and TS like concat('%',#{ts},'%') </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="BdPurorgentity_list_or" resultMap="get-BdPurorgEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdPurorgEntity">
select
<include refid="BdPurorgEntity_Base_Column_List" />
from BD_PURORG
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> or CODE = #{code} </if>
<if test="createdate != null and createdate != ''"> or CREATEDATE = #{createdate} </if>
<if test="def1 != null and def1 != ''"> or DEF1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> or DEF2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> or DEF3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> or DEF4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> or DEF5 = #{def5} </if>
<if test="dr != null and dr != ''"> or DR = #{dr} </if>
<if test="memo != null and memo != ''"> or MEMO = #{memo} </if>
<if test="mobile != null and mobile != ''"> or MOBILE = #{mobile} </if>
<if test="name != null and name != ''"> or NAME = #{name} </if>
<if test="officeaddr != null and officeaddr != ''"> or OFFICEADDR = #{officeaddr} </if>
<if test="ownercorp != null and ownercorp != ''"> or OWNERCORP = #{ownercorp} </if>
<if test="pkPurorg != null and pkPurorg != ''"> or PK_PURORG = #{pkPurorg} </if>
<if test="pkResppsn != null and pkResppsn != ''"> or PK_RESPPSN = #{pkResppsn} </if>
<if test="sealdate != null and sealdate != ''"> or SEALDATE = #{sealdate} </if>
<if test="settlestockorg != null and settlestockorg != ''"> or SETTLESTOCKORG = #{settlestockorg} </if>
<if test="ts != null and ts != ''"> or TS = #{ts} </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.BdPurorgEntity" keyProperty="pkPurorg" useGeneratedKeys="true">
insert into BD_PURORG(
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''"> CODE , </if>
<if test="createdate != null and createdate != ''"> CREATEDATE , </if>
<if test="def1 != null and def1 != ''"> DEF1 , </if>
<if test="def2 != null and def2 != ''"> DEF2 , </if>
<if test="def3 != null and def3 != ''"> DEF3 , </if>
<if test="def4 != null and def4 != ''"> DEF4 , </if>
<if test="def5 != null and def5 != ''"> DEF5 , </if>
<if test="dr != null and dr != ''"> DR , </if>
<if test="memo != null and memo != ''"> MEMO , </if>
<if test="mobile != null and mobile != ''"> MOBILE , </if>
<if test="name != null and name != ''"> NAME , </if>
<if test="officeaddr != null and officeaddr != ''"> OFFICEADDR , </if>
<if test="ownercorp != null and ownercorp != ''"> OWNERCORP , </if>
<if test="pkPurorg != null and pkPurorg != ''"> PK_PURORG , </if>
<if test="pkResppsn != null and pkResppsn != ''"> PK_RESPPSN , </if>
<if test="sealdate != null and sealdate != ''"> SEALDATE , </if>
<if test="settlestockorg != null and settlestockorg != ''"> SETTLESTOCKORG , </if>
<if test="ts != null and ts != ''"> TS , </if>
<if test="sorts == null ">sorts,</if>
<!-- <if test="sts == null ">sts,</if>-->
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''"> #{code} ,</if>
<if test="createdate != null and createdate != ''"> #{createdate} ,</if>
<if test="def1 != null and def1 != ''"> #{def1} ,</if>
<if test="def2 != null and def2 != ''"> #{def2} ,</if>
<if test="def3 != null and def3 != ''"> #{def3} ,</if>
<if test="def4 != null and def4 != ''"> #{def4} ,</if>
<if test="def5 != null and def5 != ''"> #{def5} ,</if>
<if test="dr != null and dr != ''"> #{dr} ,</if>
<if test="memo != null and memo != ''"> #{memo} ,</if>
<if test="mobile != null and mobile != ''"> #{mobile} ,</if>
<if test="name != null and name != ''"> #{name} ,</if>
<if test="officeaddr != null and officeaddr != ''"> #{officeaddr} ,</if>
<if test="ownercorp != null and ownercorp != ''"> #{ownercorp} ,</if>
<if test="pkPurorg != null and pkPurorg != ''"> #{pkPurorg} ,</if>
<if test="pkResppsn != null and pkResppsn != ''"> #{pkResppsn} ,</if>
<if test="sealdate != null and sealdate != ''"> #{sealdate} ,</if>
<if test="settlestockorg != null and settlestockorg != ''"> #{settlestockorg} ,</if>
<if test="ts != null and ts != ''"> #{ts} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from BD_PURORG a WHERE a.sts = 'Y' ),</if>
-- <if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="pkPurorg" useGeneratedKeys="true">
insert into BD_PURORG(CODE, CREATEDATE, DEF1, DEF2, DEF3, DEF4, DEF5, DR, MEMO, MOBILE, NAME, OFFICEADDR, OWNERCORP, PK_RESPPSN, SEALDATE, SETTLESTOCKORG, TS)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.createdate},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.dr},#{entity.memo},#{entity.mobile},#{entity.name},#{entity.officeaddr},#{entity.ownercorp},#{entity.pkResppsn},#{entity.sealdate},#{entity.settlestockorg},#{entity.ts})
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="pkPurorg" useGeneratedKeys="true">
insert into BD_PURORG(CODE, CREATEDATE, DEF1, DEF2, DEF3, DEF4, DEF5, DR, MEMO, MOBILE, NAME, OFFICEADDR, OWNERCORP, PK_RESPPSN, SEALDATE, SETTLESTOCKORG, TS)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.createdate},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.dr},#{entity.memo},#{entity.mobile},#{entity.name},#{entity.officeaddr},#{entity.ownercorp},#{entity.pkResppsn},#{entity.sealdate},#{entity.settlestockorg},#{entity.ts})
</foreach>
on duplicate key update
CODE = values(CODE),
CREATEDATE = values(CREATEDATE),
DEF1 = values(DEF1),
DEF2 = values(DEF2),
DEF3 = values(DEF3),
DEF4 = values(DEF4),
DEF5 = values(DEF5),
DR = values(DR),
MEMO = values(MEMO),
MOBILE = values(MOBILE),
NAME = values(NAME),
OFFICEADDR = values(OFFICEADDR),
OWNERCORP = values(OWNERCORP),
PK_RESPPSN = values(PK_RESPPSN),
SEALDATE = values(SEALDATE),
SETTLESTOCKORG = values(SETTLESTOCKORG),
TS = values(TS)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BdPurorgEntity" >
update BD_PURORG set
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''"> CODE = #{code},</if>
<if test="createdate != null and createdate != ''"> CREATEDATE = #{createdate},</if>
<if test="def1 != null and def1 != ''"> DEF1 = #{def1},</if>
<if test="def2 != null and def2 != ''"> DEF2 = #{def2},</if>
<if test="def3 != null and def3 != ''"> DEF3 = #{def3},</if>
<if test="def4 != null and def4 != ''"> DEF4 = #{def4},</if>
<if test="def5 != null and def5 != ''"> DEF5 = #{def5},</if>
<if test="dr != null and dr != ''"> DR = #{dr},</if>
<if test="memo != null and memo != ''"> MEMO = #{memo},</if>
<if test="mobile != null and mobile != ''"> MOBILE = #{mobile},</if>
<if test="name != null and name != ''"> NAME = #{name},</if>
<if test="officeaddr != null and officeaddr != ''"> OFFICEADDR = #{officeaddr},</if>
<if test="ownercorp != null and ownercorp != ''"> OWNERCORP = #{ownercorp},</if>
<if test="pkResppsn != null and pkResppsn != ''"> PK_RESPPSN = #{pkResppsn},</if>
<if test="sealdate != null and sealdate != ''"> SEALDATE = #{sealdate},</if>
<if test="settlestockorg != null and settlestockorg != ''"> SETTLESTOCKORG = #{settlestockorg},</if>
<if test="ts != null and ts != ''"> TS = #{ts},</if>
</trim>
where PK_PURORG = #{pkPurorg}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BdPurorgEntity" >
update BD_PURORG set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where PK_PURORG = #{pkPurorg}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BdPurorgEntity" >
update BD_PURORG set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE = #{code} </if>
<if test="createdate != null and createdate != ''"> and CREATEDATE = #{createdate} </if>
<if test="def1 != null and def1 != ''"> and DEF1 = #{def1} </if>
<if test="def2 != null and def2 != ''"> and DEF2 = #{def2} </if>
<if test="def3 != null and def3 != ''"> and DEF3 = #{def3} </if>
<if test="def4 != null and def4 != ''"> and DEF4 = #{def4} </if>
<if test="def5 != null and def5 != ''"> and DEF5 = #{def5} </if>
<if test="dr != null and dr != ''"> and DR = #{dr} </if>
<if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
<if test="mobile != null and mobile != ''"> and MOBILE = #{mobile} </if>
<if test="name != null and name != ''"> and NAME = #{name} </if>
<if test="officeaddr != null and officeaddr != ''"> and OFFICEADDR = #{officeaddr} </if>
<if test="ownercorp != null and ownercorp != ''"> and OWNERCORP = #{ownercorp} </if>
<if test="pkPurorg != null and pkPurorg != ''"> and PK_PURORG = #{pkPurorg} </if>
<if test="pkResppsn != null and pkResppsn != ''"> and PK_RESPPSN = #{pkResppsn} </if>
<if test="sealdate != null and sealdate != ''"> and SEALDATE = #{sealdate} </if>
<if test="settlestockorg != null and settlestockorg != ''"> and SETTLESTOCKORG = #{settlestockorg} </if>
<if test="ts != null and ts != ''"> and TS = #{ts} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from BD_PURORG where PK_PURORG = #{pkPurorg}
</delete>
</mapper>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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.IcGeneralBDaoImpl"> <mapper namespace="com.hzya.frame.plugin.lets.entity.IcGeneralBEntity">
<resultMap id="get-IcGeneralBEntity-result" type="com.hzya.frame.plugin.lets.entity.IcGeneralBEntity" > <resultMap id="get-IcGeneralBEntity-result" type="com.hzya.frame.plugin.lets.entity.IcGeneralBEntity" >
<result property="alrconfincomny" column="alrconfincomny" jdbcType="NUMERIC"/> <result property="alrconfincomny" column="alrconfincomny" jdbcType="NUMERIC"/>
@ -35,6 +35,7 @@
<result property="cfreezeid" column="cfreezeid" jdbcType="VARCHAR"/> <result property="cfreezeid" column="cfreezeid" jdbcType="VARCHAR"/>
<result property="cgeneralbid" column="cgeneralbid" jdbcType="VARCHAR"/> <result property="cgeneralbid" column="cgeneralbid" jdbcType="VARCHAR"/>
<result property="cgeneralhid" column="cgeneralhid" jdbcType="VARCHAR"/> <result property="cgeneralhid" column="cgeneralhid" jdbcType="VARCHAR"/>
<result property="cinvbascode" column="cinvbascode" jdbcType="VARCHAR"/>
<result property="cinvbasid" column="cinvbasid" jdbcType="VARCHAR"/> <result property="cinvbasid" column="cinvbasid" jdbcType="VARCHAR"/>
<result property="cinventoryid" column="cinventoryid" jdbcType="VARCHAR"/> <result property="cinventoryid" column="cinventoryid" jdbcType="VARCHAR"/>
<result property="corderBb1id" column="corder_bb1id" jdbcType="VARCHAR"/> <result property="corderBb1id" column="corder_bb1id" jdbcType="VARCHAR"/>
@ -253,6 +254,7 @@
,cfreezeid ,cfreezeid
,cgeneralbid ,cgeneralbid
,cgeneralhid ,cgeneralhid
,cinvbascode
,cinvbasid ,cinvbasid
,cinventoryid ,cinventoryid
,corder_bb1id ,corder_bb1id
@ -658,11 +660,241 @@
<if test="vuserdef9 != null and vuserdef9 != ''"> and vuserdef9 = #{vuserdef9} </if> <if test="vuserdef9 != null and vuserdef9 != ''"> and vuserdef9 = #{vuserdef9} </if>
<if test="vvehiclecode != null and vvehiclecode != ''"> and vvehiclecode = #{vvehiclecode} </if> <if test="vvehiclecode != null and vvehiclecode != ''"> and vvehiclecode = #{vvehiclecode} </if>
<if test="writeofftype != null and writeofftype != ''"> and writeofftype = #{writeofftype} </if> <if test="writeofftype != null and writeofftype != ''"> and writeofftype = #{writeofftype} </if>
and dr=0
</trim> </trim>
<!-- <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>--> <!-- <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> <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select> </select>
<select id="queryAndCinvbasCode" resultType="com.hzya.frame.plugin.lets.entity.IcGeneralBEntity" parameterType = "String">
select
ic_general_b.alrconfincomny
,ic_general_b.alrconfinconum
,ic_general_b.bbarcodeclose
,ic_general_b.bomversion
,ic_general_b.bonroadflag
,ic_general_b.breturnprofit
,ic_general_b.bsafeprice
,ic_general_b.bsourcelargess
,ic_general_b.bsupplyflag
,ic_general_b.btoinzgflag
,ic_general_b.btoouttoiaflag
,ic_general_b.btooutzgflag
,ic_general_b.btou8rm
,ic_general_b.btransasset
,ic_general_b.bzgflag
,ic_general_b.bzgyfflag
,ic_general_b.castunitid
,ic_general_b.cbodybilltypecode
,ic_general_b.cbodywarehouseid
,ic_general_b.ccheckstateid
,ic_general_b.ccorrespondbid
,ic_general_b.ccorrespondcode
,ic_general_b.ccorrespondhid
,ic_general_b.ccorrespondtype
,ic_general_b.ccostobject
,ic_general_b.ccurrencytypeid
,ic_general_b.cfirstbillbid
,ic_general_b.cfirstbillhid
,ic_general_b.cfirsttype
,ic_general_b.cfreezeid
,ic_general_b.cgeneralbid
,ic_general_b.cgeneralhid
,BD_INVBASDOC.invcode AS cinvbascode
,ic_general_b.cinvbasid
,ic_general_b.cinventoryid
,ic_general_b.corder_bb1id
,ic_general_b.cparentid
,ic_general_b.cprojectid
,ic_general_b.cprojectphaseid
,ic_general_b.cquotecurrency
,ic_general_b.cquoteunitid
,ic_general_b.creceieveid
,ic_general_b.creceiveareaid
,ic_general_b.creceivepointid
,ic_general_b.crowno
,ic_general_b.cselastunitid
,ic_general_b.csignwastbid
,ic_general_b.csignwasthid
,ic_general_b.csignwasttype
,ic_general_b.csourcebillbid
,ic_general_b.csourcebillhid
,ic_general_b.csourcetype
,ic_general_b.csourcewastbid
,ic_general_b.csourcewasthid
,ic_general_b.csourcewasttype
,ic_general_b.csrc2billbid
,ic_general_b.csrc2billhid
,ic_general_b.csrc2billtype
,ic_general_b.csumid
,ic_general_b.cvendorid
,ic_general_b.cworkcenterid
,ic_general_b.cworksiteid
,ic_general_b.cwp
,ic_general_b.dbizdate
,ic_general_b.ddeliverdate
,ic_general_b.dfirstbilldate
,ic_general_b.dr
,ic_general_b.drequiredate
,ic_general_b.drequiretime
,ic_general_b.dstandbydate
,ic_general_b.dvalidate
,ic_general_b.dzgdate
,ic_general_b.fassertcardflag
,ic_general_b.fbillrowflag
,ic_general_b.fchecked
,ic_general_b.flargess
,ic_general_b.ftoouttransflag
,ic_general_b.hsl
,ic_general_b.idesatype
,ic_general_b.inccontimepoint
,ic_general_b.inccontimepointname
,ic_general_b.isok
,ic_general_b.materialcost
,ic_general_b.naccumtonum
,ic_general_b.naccumwastnum
,ic_general_b.nbarcodenum
,ic_general_b.ncorrespondastnum
,ic_general_b.ncorrespondgrsnum
,ic_general_b.ncorrespondnum
,ic_general_b.ncountnum
,ic_general_b.nfeesettletimes
,ic_general_b.ninassistnum
,ic_general_b.ningrossnum
,ic_general_b.ninnum
,ic_general_b.nkdnum
,ic_general_b.nmny
,ic_general_b.nneedinassistnum
,ic_general_b.noutassistnum
,ic_general_b.noutgrossnum
,ic_general_b.noutnum
,ic_general_b.nplannedmny
,ic_general_b.nplannedprice
,ic_general_b.nprice
,ic_general_b.npricesettlebill
,ic_general_b.nquotemny
,ic_general_b.nquotentmny
,ic_general_b.nquotentprice
,ic_general_b.nquoteprice
,ic_general_b.nquoteunitnum
,ic_general_b.nquoteunitrate
,ic_general_b.nreplenishedastnum
,ic_general_b.nreplenishednum
,ic_general_b.nretastnum
,ic_general_b.nretgrossnum
,ic_general_b.nretnum
,ic_general_b.nsalemny
,ic_general_b.nsaleprice
,ic_general_b.nshouldinnum
,ic_general_b.nshouldoutassistnum
,ic_general_b.nshouldoutnum
,ic_general_b.ntarenum
,ic_general_b.ntaxmny
,ic_general_b.ntaxprice
,ic_general_b.ntotalmatchnum
,ic_general_b.ntotalreasonwastenum
,ic_general_b.ntranoutastnum
,ic_general_b.ntranoutnum
,ic_general_b.pk_bodycalbody
,ic_general_b.pk_corp
,ic_general_b.pk_creqwareid
,ic_general_b.pk_cubasdoc
,ic_general_b.pk_defdoc1
,ic_general_b.pk_defdoc10
,ic_general_b.pk_defdoc11
,ic_general_b.pk_defdoc12
,ic_general_b.pk_defdoc13
,ic_general_b.pk_defdoc14
,ic_general_b.pk_defdoc15
,ic_general_b.pk_defdoc16
,ic_general_b.pk_defdoc17
,ic_general_b.pk_defdoc18
,ic_general_b.pk_defdoc19
,ic_general_b.pk_defdoc2
,ic_general_b.pk_defdoc20
,ic_general_b.pk_defdoc3
,ic_general_b.pk_defdoc4
,ic_general_b.pk_defdoc5
,ic_general_b.pk_defdoc6
,ic_general_b.pk_defdoc7
,ic_general_b.pk_defdoc8
,ic_general_b.pk_defdoc9
,ic_general_b.pk_invoicecorp
,ic_general_b.pk_measware
,ic_general_b.pk_packsort
,ic_general_b.pk_reqcorp
,ic_general_b.pk_reqstoorg
,ic_general_b.pk_returnreason
,ic_general_b.process1
,ic_general_b.process2
,ic_general_b.process3
,ic_general_b.process4
,ic_general_b.process5
,ic_general_b.processcost
,ic_general_b.processmanid
,ic_general_b.serialnum
,ic_general_b.ts
,ic_general_b.vbatchcode
,ic_general_b.vbilltypeu8rm
,ic_general_b.vbodynote2
,ic_general_b.vcorrespondrowno
,ic_general_b.vfirstbillcode
,ic_general_b.vfirstrowno
,ic_general_b.vfree1
,ic_general_b.vfree10
,ic_general_b.vfree2
,ic_general_b.vfree3
,ic_general_b.vfree4
,ic_general_b.vfree5
,ic_general_b.vfree6
,ic_general_b.vfree7
,ic_general_b.vfree8
,ic_general_b.vfree9
,ic_general_b.vnotebody
,ic_general_b.vproductbatch
,ic_general_b.vreceiveaddress
,ic_general_b.vsignwastcode
,ic_general_b.vsignwastrowno
,ic_general_b.vsourcebillcode
,ic_general_b.vsourcerowno
,ic_general_b.vsourcewastcode
,ic_general_b.vsourcewastrowno
,ic_general_b.vsrc2billcode
,ic_general_b.vsrc2billrowno
,ic_general_b.vtransfercode
,ic_general_b.vuserdef1
,ic_general_b.vuserdef10
,ic_general_b.vuserdef11
,ic_general_b.vuserdef12
,ic_general_b.vuserdef13
,ic_general_b.vuserdef14
,ic_general_b.vuserdef15
,ic_general_b.vuserdef16
,ic_general_b.vuserdef17
,ic_general_b.vuserdef18
,ic_general_b.vuserdef19
,ic_general_b.vuserdef2
,ic_general_b.vuserdef20
,ic_general_b.vuserdef3
,ic_general_b.vuserdef4
,ic_general_b.vuserdef5
,ic_general_b.vuserdef6
,ic_general_b.vuserdef7
,ic_general_b.vuserdef8
,ic_general_b.vuserdef9
,ic_general_b.vvehiclecode
,ic_general_b.writeofftype
from ic_general_b ic_general_b
LEFT JOIN BD_INVBASDOC BD_INVBASDOC ON IC_GENERAL_B.cinvbasid=BD_INVBASDOC.PK_INVBASDOC
where ic_general_b.dr=0 and ic_general_b.cgeneralhid=#{cgeneralhid}
</select>
<!-- 查询符合条件的数量 --> <!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.IcGeneralBEntity"> <select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.IcGeneralBEntity">
select count(1) from ic_general_b select count(1) from ic_general_b

View File

@ -340,10 +340,8 @@
<if test="vuserdef7 != null and vuserdef7 != ''">and vuserdef7 = #{vuserdef7}</if> <if test="vuserdef7 != null and vuserdef7 != ''">and vuserdef7 = #{vuserdef7}</if>
<if test="vuserdef8 != null and vuserdef8 != ''">and vuserdef8 = #{vuserdef8}</if> <if test="vuserdef8 != null and vuserdef8 != ''">and vuserdef8 = #{vuserdef8}</if>
<if test="vuserdef9 != null and vuserdef9 != ''">and vuserdef9 = #{vuserdef9}</if> <if test="vuserdef9 != null and vuserdef9 != ''">and vuserdef9 = #{vuserdef9}</if>
and sts='Y' and dr=0
</trim> </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>
<!-- 查询符合条件的数量 --> <!-- 查询符合条件的数量 -->

View File

@ -16,9 +16,13 @@ public class QueryOfsSKURequestVO {
/** 组织 */ /** 组织 */
private String clientCode; private String clientCode;
private String lastUpdated_start;
private String lastUpdated_end;
private String companyCode; private String companyCode;
private int status; private String status;
private String code; private String code;
private int pageNo; private String pageNo;
private int pageSize; private String pageSize;
} }

View File

@ -11,6 +11,7 @@ import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto; import com.hzya.frame.ttxofs.dto.InterfaceParamByU8CApiDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -98,8 +99,8 @@ public class SKUPluginInitializer extends PluginBaseEntity {
// queryOfsSKURequestVO.setCreated_start("2023-10-15 00:00:00"); // queryOfsSKURequestVO.setCreated_start("2023-10-15 00:00:00");
// queryOfsSKURequestVO.setCreated_end("2023-10-21 23:59:59"); // queryOfsSKURequestVO.setCreated_end("2023-10-21 23:59:59");
// queryOfsSKURequestVO.setCompanyCode(""); // queryOfsSKURequestVO.setCompanyCode("");
queryOfsSKURequestVO.setPageNo(1); queryOfsSKURequestVO.setPageNo("1");
queryOfsSKURequestVO.setPageSize(500); queryOfsSKURequestVO.setPageSize("500");
queryOfsSKUs(queryOfsSKURequestVO); queryOfsSKUs(queryOfsSKURequestVO);
@ -134,6 +135,14 @@ public class SKUPluginInitializer extends PluginBaseEntity {
Date business_end = DateUtil.parse(endTime); Date business_end = DateUtil.parse(endTime);
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00"; String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
QueryOfsSKURequestVO queryOfsSKURequestVO = new QueryOfsSKURequestVO();
queryOfsSKURequestVO.setLastUpdated_start(start);
queryOfsSKURequestVO.setLastUpdated_end(end);
queryOfsSKURequestVO.setPageNo("1");
queryOfsSKURequestVO.setPageSize("500");
queryOfsSKUs(queryOfsSKURequestVO);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知丽知OFS货品档案--->U8C货品档案,start(String startTime, String endTime)方法报错:", e); logger.error("丽知丽知OFS货品档案--->U8C货品档案,start(String startTime, String endTime)方法报错:", e);
} }
@ -141,13 +150,15 @@ public class SKUPluginInitializer extends PluginBaseEntity {
/** /**
* 查询OFS SKU档案 * 查询OFS SKU档案
* status 0禁用 1启用
*/ */
public void queryOfsSKUs(QueryOfsSKURequestVO queryOfsGoodsRequestVO) throws Exception { public void queryOfsSKUs(QueryOfsSKURequestVO queryOfsGoodsRequestVO) throws Exception {
InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto(); InterfaceParamByU8CApiDto interfaceParamDto = new InterfaceParamByU8CApiDto();
interfaceParamDto.setApi("ofs.sku.search"); interfaceParamDto.setApi("ofs.sku.search");
queryOfsGoodsRequestVO.setClientCode("LETS"); queryOfsGoodsRequestVO.setClientCode("LETS");
interfaceParamDto.setData(JSON.toJSONString(queryOfsGoodsRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsGoodsRequestVO));
ReturnMessageBasics returnMessageBasics = ofsUnifiedService.unifiedByU8CApi(interfaceParamDto); OFSSKUSearchResponse ofsskuSearchResponse =(OFSSKUSearchResponse) ofsUnifiedService.unifiedByU8CApi(interfaceParamDto);
System.out.println(ofsskuSearchResponse);
} }

View File

@ -0,0 +1,505 @@
package com.hzya.frame.plugin.lets.plugin.purchase;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.beanutil.BeanUtil;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.dao.*;
import com.hzya.frame.plugin.lets.entity.*;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.u8cdto.PoOrderChildrenDto;
import com.hzya.frame.plugin.lets.u8cdto.PoOrderParentChildrenDto;
import com.hzya.frame.plugin.lets.u8cdto.PoOrderParentDto;
import com.hzya.frame.plugin.lets.u8cdto.PoOrderSonDto;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 代理品牌采购退货业务代理品牌采购退货OFS销退出库单生成U8C红字采购订单
*
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.plugin.purchase
* @ProjectkangarooDataCenterV3
* @nameProxyPurchase
* @Date2024/8/19 18:01
* @FilenameProxyPurchase
*/
public class ProxyPurchaseReturn extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(ProxyPurchaseReturn.class);
@Autowired
private OfsUnifiedService ofsUnifiedService;
@Autowired
private QueryBdBusitypeUtil queryBdBusitypeUtil;
@Autowired
private IBdCorpDao iBdCorpDao;
@Autowired
private IBdDeptdocDao iBdDeptdocDao;
@Autowired
private IBdPurorgDao iBdPurorgDao;
@Autowired
private IBdCubasdocDao iBdCubasdocDao;
@Autowired
private IBdCumandocDao iBdCumandocDao;
@Autowired
private IBdInvmandocDao iBdInvmandocDao;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseReturn";
}
@Override
public String getPluginName() {
return "OFS销退出库单生成U8C红字采购订单(代理品牌采购退货)";
}
@Override
public String getPluginLabel() {
return "OFS销退出库单生成U8C红字采购订单(代理品牌采购退货)";
}
@Override
public String getPluginType() {
return "3";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
return null;
}
/**
* 根据单号查询
*
* @author liuyang
*/
public void startImplement(String code) {
String threadNameStr = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单 售后入库单号", code);
logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setCode(code);
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE_RETURN");
queryOfsSoSaleOutVo.setStatus(900L);
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
} catch (Exception e) {
logger.error("startImplement方法抛出异常", e);
}
}
}, threadNameStr);
thread.start();
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join()异常", e);
}
}
/**
* 查询OFS售后退货入库单
*
* @param queryOfsSoSaleOutVo 查询参数
* @param headerDetailsDtoList 查询结果集
* @param pageNo 从第pageNo页开始查询
*/
private void queryOfsReturnGoods(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList, Long pageNo) throws Exception {
Long pageSize = 200L;
queryOfsSoSaleOutVo.setPageNo(pageNo);
queryOfsSoSaleOutVo.setPageSize(pageSize);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.shipment.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
ofsUnifiedService.unified(interfaceParamDto);
}
/**
* 环境预配置
*
* @param returnGoodHeaderDetailsDataDtoArrayList 采购入库单
* @author liuyang
*/
private void getSet(List<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<PoOrderSonDto> poOrderSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList);
// 代理品牌采购业务流程
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow();
if (poOrderSonDtos != null && poOrderSonDtos.size() > 0) {
for (int i = 0; i < poOrderSonDtos.size(); i++) {
PoOrderSonDto poOrderSonDto = poOrderSonDtos.get(i);
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = poOrderSonDto.getDetails();
//生成业务日期
String generateBusinessDate = createGenerateBusinessDate(poOrderSonDto);
BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司收货公司
BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门
BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织
BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity();
BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商档案-供应商
OfsPoOrderData ofsPoOrderData = poOrderSonDto.getOfsPoOrderData();//OFS采购订单
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
List<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);//修改日期
//采购订单明细行
List<PoOrderChildrenDto> poOrderChildrenDtoList = new ArrayList<>();
for (int j = 0; j < details.size(); j++) {
StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
//2024年8月20日 16:02:21 已经和妮姐万万确认采购公司和收货公司目前是一致的暂时不用区分取数逻辑
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
String receivedQty = stockinB.getReceivedQty();//实收数量
//原币含税单价
try {
// noriginalcurprice = noriginalcurtaxprice.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
} catch (Exception e) {
logger.error("计算采购入库单原币含税单价失败", e);
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
}
PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto();
poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id
poOrderChildrenDto.setNordernum(receivedQty);//订货数量
// poOrderChildrenDto.setNorgtaxprice();//原币含税单价
// poOrderChildrenDto.setPk_arrvcorp();//收货公司
// poOrderChildrenDto.setPk_arrvstoorg();//收货库存组织
// poOrderChildrenDto.setCwarehouseid();//收货仓库
poOrderChildrenDtoList.add(poOrderChildrenDto);
//2024年8月20日 16:00:03 已经和佳妮总确认计划到货日期不用进行传递
}
PoOrderParentChildrenDto poOrderParentChildrenDto = new PoOrderParentChildrenDto();
poOrderParentChildrenDto.setParentvo(poOrderParentDto);
poOrderParentChildrenDto.setChildrenvo(poOrderChildrenDtoList);
}
} else {
logger.info("poOrderSonDto.size为0");
}
} catch (Exception e) {
logger.error("implement方法抛出异常", e);
}
}
}
/**
* 档案转换
*
* @author liuyang
*/
private List<PoOrderSonDto> queryBasicArchives(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) {
List<PoOrderSonDto> poOrderSonDtoArrayList = new ArrayList<>();
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
try {
for (int i = 0; i < returnGoodHeaderDetailsDataDtoList.size(); i++) {
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoList.get(i);
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
//采购公司
String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
}
//采购部门其他
String deptName = "其他部门";
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptname(deptName);
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp());
}
//采购组织
BdPurorgEntity bdPurorgEntity = new BdPurorgEntity();
bdPurorgEntity.setDr("0");
bdPurorgEntity.setDataSourceCode("lets_u8c");
bdPurorgEntity.setOwnercorp(bdCorpEntityList.get(0).getPkCorp());
List<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();
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());
}
//查询OFS采购订单
OfsPoOrderData ofsPoOrderData = queryOfsPoOrder(header.getRefOrderCode());
PoOrderSonDto poOrderSonDto = new PoOrderSonDto();
poOrderSonDto.setBdCorpEntity(bdCorpEntityList.get(0));
poOrderSonDto.setBdDeptdocEntity(bdDeptdocEntityList.get(0));
poOrderSonDto.setBdPurorgEntity(bdPurorgEntityList.get(0));
poOrderSonDto.setBdCubasdocEntity(bdCubasdocEntityList.get(0));
poOrderSonDto.setBdCumandocEntity(bdCumandocEntityList.get(0));
poOrderSonDto.setOfsPoOrderData(ofsPoOrderData);
BeanUtil.copyPropertiesV2(poOrderSonDto, header);
poOrderSonDtoArrayList.add(poOrderSonDto);
}
//成功
} catch (Exception e) {
logger.error("代理品牌采购入库单档案转换失败", e);
//失败
}
} else {
logger.info("queryBasicArchives对应returnGoodHeaderDetailsDataDtoList.size为0");
}
return poOrderSonDtoArrayList;
}
/**
* 2024年8月6日 10:59:03 查询U8C业务流程
*
* @author liuyang
*/
private BdBusitypeEntity u8cOperationFlow() throws Exception {
//查询业务流程
//2024年8月6日 11:33:07 具体的业务流程名称还需要实施提供
String processName = "代理品牌采购";
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
return bdBusitypeEntity;
}
/**
* 2024年8月20日 15:46:10
* 生成业务日期以发货时间作为业务日期
*
* @author liuyang
*/
private String createGenerateBusinessDate(PoOrderSonDto poOrderSonDto) {
if (poOrderSonDto != null && poOrderSonDto.getShipAt() != null) {
String shipAt = poOrderSonDto.getShipAt();
String businessFormat = null;
try {
Date dbill = DateUtil.parse(shipAt);
businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
} catch (Exception e) {
logger.error("业务日期生成失败", e);
}
return businessFormat;
} else {
logger.error("生成采购订单入库日期失败或者shipAt为空! json{}", JSON.toJSON(poOrderSonDto));
Assert.state(false, "生成采购订单入库日期失败或者shipAt为空! json{}", JSON.toJSON(poOrderSonDto));
return null;
}
}
/**
* 查询存货管理档案
*
* @param pkCorp 发货公司主键
* @param stockinB 采购入库单明细行
* @author liuyang
*/
private BdInvmandocEntity queryInventoryMan(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, String pkCorp) throws Exception {
Assert.notNull(stockinB, "sonDetailsDto不能为空");
Assert.notNull(stockinB.getSkuCode(), "O存货商家编码不能为空");
Assert.notNull(pkCorp, "发货公司主键不能为空");
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
bdInvmandocEntity.setInvcode(stockinB.getSkuCode());
bdInvmandocEntity.setPkCorp(pkCorp);
List<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月20日 16:11:46
*
* @author liuyang
*/
public OfsPoOrderData queryOfsPoOrder(String code) throws Exception {
if (code != null && !"".equals(code)) {
Long pageSize = 200L;
Long pageNo = 1L;
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setPageNo(pageNo);
queryOfsSoSaleOutVo.setPageSize(pageSize);
queryOfsSoSaleOutVo.setCode(code);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.purchaseOrder.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
OfsPoOrderBean ofsPoOrderBean = (OfsPoOrderBean) ofsUnifiedService.unified(interfaceParamDto);
if (ofsPoOrderBean != null) {
if ("false".equals(ofsPoOrderBean.getError()) && "0".equals(ofsPoOrderBean.getCode()) && "Success".equals(ofsPoOrderBean.getMsg())) {
List<OfsPoOrderData> data = ofsPoOrderBean.getData();
if (data != null && data.size() > 0) {
return data.get(0);
}
} else {
logger.error("查询采购订单失败,失败原因:{}", JSON.toJSON(interfaceParamDto));
}
} else {
logger.error("ofsPoOrderBean为空interfaceParamDto接口入参{}", JSON.toJSON(interfaceParamDto));
}
} else {
Assert.state(false, "采购订单编码不能为空!");
}
return null;
}
/**
* 2024年8月20日 16:42:14
* 查找对应的采购订单明细行
* 2024年8月20日 17:42:15
* 应该通过明细行主键匹配但是只能根据sku匹配目前的实现逻辑
*
* @param ofsPoOrderDataDetails OFS采购订单明细行所有对象
* @param stockinB OFS采购入库单明细行对象
* @author liuyang
*/
private void findOfsPoOrderDetail(List<OfsPoOrderDetails> ofsPoOrderDataDetails, StockinOrderSearchResponse.StockinOrder.StockinB stockinB) {
if (ofsPoOrderDataDetails != null && ofsPoOrderDataDetails.size() > 0 && stockinB != null) {
}
}
}

View File

@ -1,115 +1,631 @@
//package com.hzya.frame.plugin.lets.plugin.purchase; package com.hzya.frame.plugin.lets.plugin.purchase;
//
//import cn.hutool.core.util.StrUtil; import cn.hutool.core.date.DateUtil;
//import com.alibaba.fastjson.JSONObject; import cn.hutool.core.lang.Assert;
//import com.hzya.frame.base.PluginBaseEntity; import cn.hutool.core.util.StrUtil;
//import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import cn.hutool.http.HttpRequest;
//import com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB; import com.alibaba.fastjson.JSON;
//import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.alibaba.fastjson.JSONObject;
//import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.base.PluginBaseEntity;
//import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto; import com.hzya.frame.beanutil.BeanUtil;
//import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
//import org.slf4j.Logger; import com.hzya.frame.plugin.lets.dao.*;
//import org.slf4j.LoggerFactory; import com.hzya.frame.plugin.lets.entity.*;
// import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
//import java.util.ArrayList; import com.hzya.frame.plugin.lets.u8cdto.*;
//import java.util.List; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
// import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
///** import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
// * 代理品牌采购业务代理品牌采购OFS采购入库单生成U8C采购订单 import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
// * import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderDetails;
// * @Authorliuyang import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderHeader;
// * @Packagecom.hzya.frame.plugin.lets.plugin.purchase import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
// * @ProjectkangarooDataCenterV3 import com.hzya.frame.ttxofs.service.OfsUnifiedService;
// * @nameProxyPurchase import com.hzya.frame.web.entity.JsonResultEntity;
// * @Date2024/8/19 18:01 import org.slf4j.Logger;
// * @FilenameProxyPurchase import org.slf4j.LoggerFactory;
// */ import org.springframework.beans.factory.annotation.Autowired;
//public class ProxyPurchaseWarehous extends PluginBaseEntity {
// import java.math.BigDecimal;
// Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehous.class); import java.util.*;
//
// @Override /**
// public void initialize() { * 代理品牌采购业务代理品牌采购OFS采购入库单生成U8C采购订单
// logger.info(getPluginLabel() + "執行初始化方法initialize()"); *
// } * @Authorliuyang
// * @Packagecom.hzya.frame.plugin.lets.plugin.purchase
// @Override * @ProjectkangarooDataCenterV3
// public void destroy() { * @nameProxyPurchase
// logger.info(getPluginLabel() + "執行銷毀方法destroy()"); * @Date2024/8/19 18:01
// } * @FilenameProxyPurchase
// */
// @Override public class ProxyPurchaseWarehous extends PluginBaseEntity {
// public String getPluginId() {
// return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous"; Logger logger = LoggerFactory.getLogger(ProxyPurchaseWarehous.class);
// }
// @Autowired
// @Override private OfsUnifiedService ofsUnifiedService;
// public String getPluginName() {
// return "OFS采购入库单生成U8C采购订单(代理品牌)"; @Autowired
// } private QueryBdBusitypeUtil queryBdBusitypeUtil;
//
// @Override @Autowired
// public String getPluginLabel() { private IBdCorpDao iBdCorpDao;
// return "OFS采购入库单生成U8C采购订单(代理品牌)";
// } @Autowired
// private IBdDeptdocDao iBdDeptdocDao;
// @Override
// public String getPluginType() { @Autowired
// return "3"; private IBdPurorgDao iBdPurorgDao;
// }
// @Autowired
// @Override private IBdCubasdocDao iBdCubasdocDao;
// public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
// return null; @Autowired
// } private IBdCumandocDao iBdCumandocDao;
//
// /** @Autowired
// * 根据指定时间范围拉取 private IBdInvmandocDao iBdInvmandocDao;
// *
// * @author liuyang @Autowired
// */ private IBdCalbodyDao iBdCalbodyDao;
// public void startImplement(String startTime, String endTime) {
// String threadNameStr = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", dateStr, summaryOrderNumber); @Autowired
// logger.info(threadNameStr); private IBdStordocDao iBdStordocDao;
//
// Thread thread = new Thread(new Runnable() { @Override
// @Override public void initialize() {
// public void run() { logger.info(getPluginLabel() + "執行初始化方法initialize()");
// try { }
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
// String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); @Override
// public void destroy() {
// List<HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>(); logger.info(getPluginLabel() + "執行銷毀方法destroy()");
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); }
// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time()); @Override
// queryOfsSoSaleOutVo.setClientCode("LETS"); public String getPluginId() {
// queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); return "com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous";
//// queryOfsSoSaleOutVo.setCompanyCode("SHLZ"); }
// queryOfsSoSaleOutVo.setStatus(900L);
// queryOfsSoSaleOutVo.setPageNo(1L); @Override
// queryOfsSoSaleOutVo.setPageSize(50L); public String getPluginName() {
// queryOfsSoSaleOutVo.setStoreCode(tobShop); return "OFS采购入库单生成U8C采购订单(代理品牌)";
//// queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004"); }
// queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
// logger.info("数据返回行数:{}", headerDetailsDtoList.size()); @Override
// if (headerDetailsDtoList.size() > 0) { public String getPluginLabel() {
// getSet(headerDetailsDtoList); return "OFS采购入库单生成U8C采购订单(代理品牌)";
// } else { }
// logger.info("没有查询到任何数据!不需要同步");
// } @Override
// } catch (Exception e) { public String getPluginType() {
// logger.error("startImplement方法抛出异常", e); return "3";
// } }
// }
// }, threadNameStr); @Override
// thread.start(); public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
// try { return null;
// thread.join(); }
// } catch (Exception e) {
// logger.error("thread.join()异常", e); /**
// } * 根据单号查询
// } *
// * @author liuyang
//} */
public void startImplement(String code) {
String threadNameStr = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单 售后入库单号", code);
logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
List<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);
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
} catch (Exception e) {
logger.error("startImplement方法抛出异常", e);
}
}
}, threadNameStr);
thread.start();
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join()异常", e);
}
}
/**
* 查询OFS售后退货入库单
*
* @param queryOfsSoSaleOutVo 查询参数
* @param headerDetailsDtoList 查询结果集
* @param pageNo 从第pageNo页开始查询
*/
private void queryOfsReturnGoods(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList, Long pageNo) throws Exception {
Long pageSize = 200L;
queryOfsSoSaleOutVo.setPageNo(pageNo);
queryOfsSoSaleOutVo.setPageSize(pageSize);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.receipt.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
StockinOrderSearchResponse rertunGoodsRootBean = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
if (rertunGoodsRootBean != null) {
if ("false".equals(rertunGoodsRootBean.getError()) && "0".equals(rertunGoodsRootBean.getCode()) && "Success".equals(rertunGoodsRootBean.getMsg())) {
List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = rertunGoodsRootBean.getData();
if (stockinOrderList != null && stockinOrderList.size() > 0) {
headerDetailsDtoList.addAll(stockinOrderList);
//TODO OFS没有提供分页字段等待开发
}
} else {
logger.error("查询失败,失败原因:{}", JSON.toJSON(interfaceParamDto));
}
} else {
logger.error("rertunGoodsRootBean为空interfaceParamDto对象的结果集json{}", JSON.toJSON(interfaceParamDto));
}
}
/**
* 环境预配置
*
* @param returnGoodHeaderDetailsDataDtoArrayList 采购入库单
* @author liuyang
*/
private void getSet(List<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<PoOrderSonDto> poOrderSonDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList);
// 代理品牌采购业务流程
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow();
if (poOrderSonDtos != null && poOrderSonDtos.size() > 0) {
for (int i = 0; i < poOrderSonDtos.size(); i++) {
PoOrderSonDto poOrderSonDto = poOrderSonDtos.get(i);
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = poOrderSonDto.getDetails();
//生成业务日期
String generateBusinessDate = createGenerateBusinessDate(poOrderSonDto);
BdCorpEntity bdCorpEntity = poOrderSonDto.getBdCorpEntity();//采购公司收货公司
BdDeptdocEntity bdDeptdocEntity = poOrderSonDto.getBdDeptdocEntity();//采购部门
BdPurorgEntity bdPurorgEntity = poOrderSonDto.getBdPurorgEntity();//采购组织
BdCubasdocEntity bdCubasdocEntity = poOrderSonDto.getBdCubasdocEntity();
BdCumandocEntity bdCumandocEntity = poOrderSonDto.getBdCumandocEntity();//客商档案-供应商
BdCalbodyEntity bdCalbodyEntity = poOrderSonDto.getBdCalbodyEntity();//收货库存组织
BdStordocEntity bdStordocEntity = poOrderSonDto.getBdStordocEntity();//收货仓库
OfsPoOrderData ofsPoOrderData = poOrderSonDto.getOfsPoOrderData();//OFS采购订单
OfsPoOrderHeader ofsPoOrderDataHeader = ofsPoOrderData.getHeader();
List<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);//修改日期
//采购订单明细行
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);
//2024年8月20日 16:02:21 已经和妮姐万万确认采购公司和收货公司目前是一致的暂时不用区分取数逻辑
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCorpEntity.getPkCorp());
String receivedQty = stockinB.getReceivedQty();//实收数量
String fulfillAmount = ofsPoOrderDetail.getFulfillAmount();//实收累计总金额
//原币含税单价
BigDecimal noriginalcurprice = null;
try {
noriginalcurprice = new BigDecimal(fulfillAmount).divide(new BigDecimal(receivedQty), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
} catch (Exception e) {
logger.error("计算采购入库单原币含税单价失败", e);
Assert.state(false, "计算采购入库单原币含税单价失败 原因:{}", e.getMessage());
}
PoOrderChildrenDto poOrderChildrenDto = new PoOrderChildrenDto();
poOrderChildrenDto.setCmangid(bdInvmandocEntity.getPkInvmandoc());//存货管理id
poOrderChildrenDto.setNordernum(receivedQty);//订货数量
poOrderChildrenDto.setNorgtaxprice(noriginalcurprice.stripTrailingZeros().toPlainString());//原币含税单价
poOrderChildrenDto.setPk_arrvcorp(bdCorpEntity.getPkCorp());//收货公司
poOrderChildrenDto.setPk_arrvstoorg(bdCalbodyEntity.getPkCalbody());//收货库存组织
poOrderChildrenDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//收货仓库
poOrderChildrenDtoList.add(poOrderChildrenDto);
//2024年8月20日 16:00:03 已经和佳妮总确认计划到货日期不用进行传递
}
List<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);
sendU8CPoOrder(JSON.toJSONString(stringStringMap));
logger.info("推送U8C代理品牌采购订单采购采购订单主键{} 采购订单编码:{}", null, null);
}
} else {
logger.info("poOrderSonDto.size为0");
}
} catch (Exception e) {
logger.error("implement方法抛出异常", e);
}
}
}
/**
* 档案转换
*
* @author liuyang
*/
private List<PoOrderSonDto> queryBasicArchives(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) {
List<PoOrderSonDto> poOrderSonDtoArrayList = new ArrayList<>();
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
try {
for (int i = 0; i < returnGoodHeaderDetailsDataDtoList.size(); i++) {
StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoList.get(i);
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
//采购公司
String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
}
//采购部门其他
String deptName = "其他部门";
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptname(deptName);
bdDeptdocEntity.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList.size() == 0) {
Assert.state(false, "根据部门名称:{} 公司id{}无法匹配到U8C销售组织", deptName, bdCorpEntityList.get(0).getPkCorp());
} else if (bdDeptdocEntityList.size() >= 2) {
Assert.state(false, "根据部门名称:{} 公司id{}匹配到U8C销售组织{}个", deptName, bdCorpEntityList.get(0).getPkCorp());
}
//采购组织
BdPurorgEntity bdPurorgEntity = new BdPurorgEntity();
bdPurorgEntity.setDr("0");
bdPurorgEntity.setDataSourceCode("lets_u8c");
bdPurorgEntity.setOwnercorp(bdCorpEntityList.get(0).getPkCorp());
List<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();
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月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());
}
//查询OFS采购订单
OfsPoOrderData ofsPoOrderData = queryOfsPoOrder(header.getRefOrderCode());
PoOrderSonDto poOrderSonDto = new PoOrderSonDto();
poOrderSonDto.setBdCorpEntity(bdCorpEntityList.get(0));
poOrderSonDto.setBdDeptdocEntity(bdDeptdocEntityList.get(0));
poOrderSonDto.setBdPurorgEntity(bdPurorgEntityList.get(0));
poOrderSonDto.setBdCubasdocEntity(bdCubasdocEntityList.get(0));
poOrderSonDto.setBdCumandocEntity(bdCumandocEntityList.get(0));
poOrderSonDto.setOfsPoOrderData(ofsPoOrderData);
poOrderSonDto.setBdCalbodyEntity(bdCalbodyEntities.get(0));
poOrderSonDto.setBdStordocEntity(bdStordocEntityList.get(0));
BeanUtil.copyPropertiesV2(poOrderSonDto, header);
poOrderSonDtoArrayList.add(poOrderSonDto);
}
//成功
} catch (Exception e) {
logger.error("代理品牌采购入库单档案转换失败", e);
//失败
}
} else {
logger.info("queryBasicArchives对应returnGoodHeaderDetailsDataDtoList.size为0");
}
return poOrderSonDtoArrayList;
}
/**
* 2024年8月6日 10:59:03 查询U8C业务流程
*
* @author liuyang
*/
private BdBusitypeEntity u8cOperationFlow() throws Exception {
//查询业务流程
//2024年8月6日 11:33:07 具体的业务流程名称还需要实施提供
String processName = "代理品牌采购";
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
return bdBusitypeEntity;
}
/**
* 2024年8月20日 15:46:10
* 生成业务日期以发货时间作为业务日期
*
* @author liuyang
*/
private String createGenerateBusinessDate(PoOrderSonDto poOrderSonDto) {
if (poOrderSonDto != null && poOrderSonDto.getShipAt() != null) {
String shipAt = poOrderSonDto.getShipAt();
String businessFormat = null;
try {
Date dbill = DateUtil.parse(shipAt);
businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
} catch (Exception e) {
logger.error("业务日期生成失败", e);
}
return businessFormat;
} else {
logger.error("生成采购订单入库日期失败或者shipAt为空! json{}", JSON.toJSON(poOrderSonDto));
Assert.state(false, "生成采购订单入库日期失败或者shipAt为空! json{}", JSON.toJSON(poOrderSonDto));
return null;
}
}
/**
* 查询存货管理档案
*
* @param pkCorp 发货公司主键
* @param stockinB 采购入库单明细行
* @author liuyang
*/
private BdInvmandocEntity queryInventoryMan(StockinOrderSearchResponse.StockinOrder.StockinB stockinB, String pkCorp) throws Exception {
Assert.notNull(stockinB, "sonDetailsDto不能为空");
Assert.notNull(stockinB.getSkuCode(), "O存货商家编码不能为空");
Assert.notNull(pkCorp, "发货公司主键不能为空");
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
bdInvmandocEntity.setInvcode(stockinB.getSkuCode());
bdInvmandocEntity.setPkCorp(pkCorp);
List<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月20日 16:11:46
*
* @author liuyang
*/
public OfsPoOrderData queryOfsPoOrder(String code) throws Exception {
if (code != null && !"".equals(code)) {
Long pageSize = 200L;
Long pageNo = 1L;
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setPageNo(pageNo);
queryOfsSoSaleOutVo.setPageSize(pageSize);
queryOfsSoSaleOutVo.setCode(code);
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.purchaseOrder.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
OfsPoOrderBean ofsPoOrderBean = (OfsPoOrderBean) ofsUnifiedService.unified(interfaceParamDto);
if (ofsPoOrderBean != null) {
if ("false".equals(ofsPoOrderBean.getError()) && "0".equals(ofsPoOrderBean.getCode()) && "Success".equals(ofsPoOrderBean.getMsg())) {
List<OfsPoOrderData> data = ofsPoOrderBean.getData();
if (data != null && data.size() > 0) {
return data.get(0);
}
} else {
logger.error("查询采购订单失败,失败原因:{}", JSON.toJSON(interfaceParamDto));
}
} else {
logger.error("ofsPoOrderBean为空interfaceParamDto接口入参{}", JSON.toJSON(interfaceParamDto));
}
} else {
Assert.state(false, "采购订单编码不能为空!");
}
return null;
}
/**
* 2024年8月20日 16:42:14
* 查找对应的采购订单明细行
* 2024年8月20日 17:42:15
* 应该通过明细行主键匹配但是只能根据sku匹配目前的实现逻辑
* 查找OFS采购订单明细行主要是为了带出实付金额通过实付金额/实收数量=含税单价
*
* @param ofsPoOrderDataDetails OFS采购订单明细行所有对象
* @param stockinB OFS采购入库单明细行对象
* @author liuyang
*/
private OfsPoOrderDetails findOfsPoOrderDetail(List<OfsPoOrderDetails> ofsPoOrderDataDetails, StockinOrderSearchResponse.StockinOrder.StockinB stockinB) {
if (ofsPoOrderDataDetails != null && ofsPoOrderDataDetails.size() > 0 && stockinB != null) {
//TODO 2024年8月20日 23:33:11 先使用sku验证然后O接口更新明细id使用明细id匹配
// 2024年8月20日 23:36:04 使用sku匹配在某种角度来说是错误的
for (int i = 0; i < ofsPoOrderDataDetails.size(); i++) {
if (ofsPoOrderDataDetails.get(i).getSkuCode().equals(stockinB.getSkuCode())) {
return ofsPoOrderDataDetails.get(0);
}
}
} else {
logger.error("findOfsPoOrderDetail方法对应的ofsPoOrderDataDetails不能为空否则业务目标无法完成");
}
Assert.state(false, "无法匹配到采购订单明细行业务逻辑无法完成根据sku编码{}查找,但是在采购订单中无法匹配!", stockinB.getSkuCode());
return null;
}
/**
* 2024年8月20日 23:58:13
* 推送U8C采购订单
*
* @author liuyang
*/
public SoSaleResultRootDto sendU8CPoOrder(String param) throws Exception {
long startLong = System.currentTimeMillis();
logger.info("代理品牌采购推送开始,推送参数:" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL);
String result = HttpRequest.post(ProfilesActiveConstant.U8C_URL).header("appId", "800037")//头信息多个头信息多次调用此方法即可
.header("usercode", "admin").header("password", "21232f297a57a5a743894a0e4a801fc3").header("system", "lz").header("trantype", "PK").header("apiCode", "8000370004")//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(param)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
logger.info("代理品牌采购推送结束,返回参数:" + result);
long endLong = System.currentTimeMillis();
logger.info("U8C采购订单接口请求耗时" + (endLong - startLong));
JSONObject jsonObject = JSON.parseObject(result);
result = String.valueOf(jsonObject.get("attribute"));
boolean isSuccess = false;
SoSaleResultRootDto soSaleResultRootDto = null;
if (result != null && !"".equals(result)) {
ReusltStrDto reusltStrDto = JSON.parseObject(result, ReusltStrDto.class);
if ("success".equals(reusltStrDto.getStatus())) {
soSaleResultRootDto = resultDataHandle(reusltStrDto.getData());
isSuccess = true;
}
}
if (!isSuccess) {
Assert.state(false, "代理品牌采购业务推送U8C采购订单失败 接口返回结果:{}", result);
}
return soSaleResultRootDto;
}
/**
* 返回结果解析处理在确认了success后调用
*
* @author liuyang
*/
private SoSaleResultRootDto resultDataHandle(String resultData) {
try {
if (resultData != null && !"".equals(resultData)) {
if (resultData.contains("[")) {
resultData = resultData.substring(1, resultData.length() - 1);
}
return JSON.parseObject(resultData, SoSaleResultRootDto.class);
}
} catch (Exception e) {
e.printStackTrace();
logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录
}
return null;
}
}

View File

@ -113,10 +113,10 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
@Autowired @Autowired
private IBdSalestruDao iBdSalestruDao; private IBdSalestruDao iBdSalestruDao;
@Autowired @Autowired
private IBdCumandocDao iBdCumandocDao; private IBdCumandocDao iBdCumandocDao;
@Autowired @Autowired
private IBdDeptdocDao iBdDeptdocDao; private IBdDeptdocDao iBdDeptdocDao;
@ -189,8 +189,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
* *
* @author liuyang * @author liuyang
*/ */
public void startImplement(String date) { public void startImplement(String code) {
String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单 出库单单号:{}", date); String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单 出库单单号:{}", code);
logger.info(threadNameStr); logger.info(threadNameStr);
Thread thread = new Thread(new Runnable() { Thread thread = new Thread(new Runnable() {
@ -203,11 +203,11 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); queryOfsSoSaleOutVo.setInternalInstructionType("SALES");
queryOfsSoSaleOutVo.setStatus(900L); // queryOfsSoSaleOutVo.setStatus(900L);
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop); queryOfsSoSaleOutVo.setStoreCode(tobShop);
queryOfsSoSaleOutVo.setCode(date); queryOfsSoSaleOutVo.setCode(code);
queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L); queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
logger.info("根据根据号拉群:数据返回行数:{}", headerDetailsDtoList.size()); logger.info("根据根据号拉群:数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
@ -670,6 +670,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
bdCumandocEntity1.setDr(0L); bdCumandocEntity1.setDr(0L);
bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp()); bdCumandocEntity1.setPkCorp(bdCorpEntityList.get(0).getPkCorp());
bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER); bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);
bdCumandocEntity1.setPkCubasdoc(bdCubasdocEntityList.get(0).getPkCubasdoc());
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) { if (bdCumandocEntityList == null || bdCumandocEntityList.size() == 0) {
Assert.state(false, "根据客商基本档案主键{},没有办法查询到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc()); Assert.state(false, "根据客商基本档案主键{},没有办法查询到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc());

View File

@ -160,6 +160,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop); queryOfsSoSaleOutVo.setStoreCode(tobShop);
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
@ -208,6 +209,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop); queryOfsSoSaleOutVo.setStoreCode(tobShop);
queryOfsSoSaleOutVo.setCode(code); queryOfsSoSaleOutVo.setCode(code);
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size());
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {

View File

@ -136,6 +136,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tocShop); queryOfsSoSaleOutVo.setStoreCode(tocShop);
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
// queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size()); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size());
@ -189,6 +190,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tocShop); queryOfsSoSaleOutVo.setStoreCode(tocShop);
queryOfsSoSaleOutVo.setCode(code); queryOfsSoSaleOutVo.setCode(code);
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L); queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size()); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size());
if (returnGoodHeaderDetailsDataDtoList.size() > 0) { if (returnGoodHeaderDetailsDataDtoList.size() > 0) {

View File

@ -2,18 +2,37 @@ package com.hzya.frame.plugin.lets.plugin.transfer;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.lets.constant.OverallConstant;
import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant;
import com.hzya.frame.plugin.lets.dao.IIcGeneralBDao;
import com.hzya.frame.plugin.lets.dao.IIcGeneralHDao;
import com.hzya.frame.plugin.lets.dao.IToBillDao;
import com.hzya.frame.plugin.lets.entity.IcGeneralBEntity;
import com.hzya.frame.plugin.lets.entity.IcGeneralHEntity;
import com.hzya.frame.plugin.lets.entity.ToBillEntity;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsTransferOrderRequestVO;
import com.hzya.frame.plugin.lets.u8cdto.BillVO;
import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO;
import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil;
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
import com.hzya.frame.plugin.lets.util.pushData.Attribute;
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto; import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.stock.StockoutOrderSearchResponse;
import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -25,6 +44,9 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
/**
* 丽知OFS调拨入库订单--->U8C调拨入库订单
*/
public class TransferInPluginInitializer extends PluginBaseEntity { public class TransferInPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class); Logger logger = LoggerFactory.getLogger(TransferInPluginInitializer.class);
@ -47,12 +69,12 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
@Override @Override
public String getPluginName() { public String getPluginName() {
return "丽知OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库"; return "丽知OFS调拨入库订单--->U8C调拨入库订单保存签字关联U8C调拨出库单";
} }
@Override @Override
public String getPluginLabel() { public String getPluginLabel() {
return "丽知OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库"; return "丽知OFS调拨入库订单--->U8C调拨入库订单保存签字关联U8C调拨出库单";
} }
@Override @Override
@ -65,13 +87,56 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
@Autowired @Autowired
private PushDataByU8cUtil pushDataByU8cUtil; private PushDataByU8cUtil pushDataByU8cUtil;
@Autowired @Autowired
private PushU8CByApiCode pushU8CByApiCode;
@Autowired
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
@Autowired @Autowired
private OfsUnifiedService ofsUnifiedService; private OfsUnifiedService ofsUnifiedService;
@Autowired
private IToBillDao toBillDao;
@Autowired
private IIcGeneralHDao icGeneralHDao;
@Autowired
private IIcGeneralBDao icGeneralBDao;
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
start(split[0], split[1]);
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
start(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails);
start(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
//默认
start();
}
} catch (Exception e) {
e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return null; return null;
} }
@ -89,24 +154,25 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss");
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
// queryOfsStockinOrderRequestVO.setCreated_start("2024-08-05 00:00:00"); queryOfsStockinOrderRequestVO.setClosedAt_start(startTimeStr);
// queryOfsStockinOrderRequestVO.setCreated_end("2024-08-09 23:59:59"); queryOfsStockinOrderRequestVO.setClosedAt_end(endTimeStr);
queryOfsStockinOrderRequestVO.setClosedAt_start("2024-08-05 00:00:00"); //状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setClosedAt_end("2024-08-09 23:59:59"); queryOfsStockinOrderRequestVO.setStatus("900");
// queryOfsStockinOrderRequestVO.setCompanyCode("SHXM"); List<StockinOrderSearchResponse.StockinOrder> transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageNo(1L);
queryOfsStockinOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
System.out.println(data);
if (transferInOrder == null || transferInOrder.size() == 0) {
return;
}
//过滤日志 //过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders = filterData(transferInOrder);
//推送 if (filterTransferInOrders.size() == 0) {
return;
}
implement(filterTransferInOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库订单--->U8C调拨订单(保存签字,自动生成调拨出入库,start()方法报错:", e); logger.error("丽知OFS调拨入库订单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start()方法报错:", e);
} }
} }
@ -118,15 +184,23 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setCode(stockinNo); queryOfsStockinOrderRequestVO.setCode(stockinNo);
queryOfsStockinOrderRequestVO.setPageNo(1L); //状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockinOrderRequestVO.setPageSize(500L); queryOfsStockinOrderRequestVO.setStatus("900");
List<StockinOrderSearchResponse.StockinOrder> data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); List<StockinOrderSearchResponse.StockinOrder> transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
System.out.println(data);
if (transferInOrder == null || transferInOrder.size() == 0) {
Assert.state(false, "丽知OFS调拨入库--->U8C调拨入库根据单据号[入库完成]{},未查询到调拨入库单", stockinNo);
}
//过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders = filterData(transferInOrder);
if (filterTransferInOrders.size() == 0) {
Assert.state(false, "丽知OFS调拨入库--->U8C调拨入库根据单据号[入库完成]{},该调拨入库单已被推送成功,请勿重新推送", stockinNo);
}
implement(filterTransferInOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库订单--->U8C调拨订单保存签字自动生成调拨出入库,start(String goodsName)方法报错:", e); logger.error("丽知OFS调拨入库订单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start(String goodsName)方法报错:", e);
} }
} }
@ -142,40 +216,320 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO(); QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO = new QueryOfsStockinOrderRequestVO();
queryOfsStockinOrderRequestVO.setClosedAt_start("2024-08-05 00:00:00"); queryOfsStockinOrderRequestVO.setClosedAt_start(start);
queryOfsStockinOrderRequestVO.setClosedAt_end("2024-08-09 23:59:59"); queryOfsStockinOrderRequestVO.setClosedAt_end(end);
// queryOfsStockinOrderRequestVO.setCompanyCode("SHXM"); //状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
// queryOfsTransferOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 queryOfsStockinOrderRequestVO.setStatus("900");
queryOfsStockinOrderRequestVO.setPageNo(1L); List<StockinOrderSearchResponse.StockinOrder> transferInOrder = queryOfsStockinOrder(queryOfsStockinOrderRequestVO);
queryOfsStockinOrderRequestVO.setPageSize(500L);
List<StockinOrderSearchResponse.StockinOrder> data = queryOfsStockinOrder(queryOfsStockinOrderRequestVO); if (transferInOrder == null || transferInOrder.size() == 0) {
System.out.println(data); Assert.state(false, "丽知OFS调拨入库订单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]{}-{},未查询到调拨入库单[入库完成]", startTime, endTime);
}
//过滤日志
List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders = filterData(transferInOrder);
if (filterTransferInOrders.size() == 0) {
Assert.state(false, "丽知OFS调拨入库订单--->U8C调拨入库订单根据日期期间[开始时间]-[结束时间]{}-{},该调期调拨入库单[入库完成]已被推送成功,请勿重新推送", startTime, endTime);
}
implement(filterTransferInOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨入库订单--->U8C调拨订单保存签字自动生成调拨出入库,start(String startTime, String endTime)方法报错:", e); logger.error("丽知OFS调拨入库订单--->U8C调拨入库订单保存签字关联U8C调拨出库单,start(String startTime, String endTime)方法报错:", e);
} }
} }
/**
* 过滤成功日志
*
* @return
*/
public List<StockinOrderSearchResponse.StockinOrder> filterData(List<StockinOrderSearchResponse.StockinOrder> stockinOrders) {
List<StockinOrderSearchResponse.StockinOrder> filterStockinOrders = new ArrayList<>();
for (StockinOrderSearchResponse.StockinOrder stockinOrder : stockinOrders) {
StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
String rootAppPk = header.getCode();
boolean isExis = true;
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
isExis = false;
}
if (!isExis) {
filterStockinOrders.add(stockinOrder);
}
}
return filterStockinOrders;
}
/**
* ofs调拨入库推送u8c调拨入库关联调拨订单
* <p>
* 根据ofs调拨订单可以查询到u8c调拨订单
* u8c调拨出库单子表的来源单据号vsourcebillcode调拨订单号
*
* @param filterTransferInOrders
*/
public void implement(List<StockinOrderSearchResponse.StockinOrder> filterTransferInOrders) {
for (StockinOrderSearchResponse.StockinOrder transferInOrders : filterTransferInOrders) {
System.out.println(transferInOrders);
String mapStr = "";
String format = "";
String response = "";
String ofsCode = "";
try {
StockinOrderSearchResponse.StockinOrder.StockinH ofsTransferHeader = transferInOrders.getHeader();
//ofs调拨订单号
String ofsSourceOrderCode = ofsTransferHeader.getSourceOrderCode();
//ofs调拨入库单单号
ofsCode = ofsTransferHeader.getCode();
//ofs最后修改时间调入时间
format = ofsTransferHeader.getLastUpdated();
GeneralBillVO generalBillVO = new GeneralBillVO();
//主表
GeneralBillVO.Parentvo parentvo = new GeneralBillVO.Parentvo();
//coperatorid 制单人
parentvo.setCoperatorid("tbadmin");
//cwarehouseid 仓库
parentvo.setCwarehouseid(ofsTransferHeader.getFacilityCode());
//pk_calbody 库存组织
parentvo.setPk_calbody(ofsTransferHeader.getCompanyCode());
//pk_corp 公司
parentvo.setPk_corp(ofsTransferHeader.getCompanyCode());
//pk_defdoc19 自定义项19ofs调拨订单号
parentvo.setPk_defdoc19(ofsSourceOrderCode);
//U8C调拨订单信息
// List<ToBillEntity> toBillEntityList = queryToBillByPkVdefdoc19(ofsSourceOrderCode);
//U8C调拨出库单主表信息
List<IcGeneralHEntity> icGeneralHEntityList = queryIcGeneralHByPkVdefdoc19(ofsSourceOrderCode);
if (icGeneralHEntityList == null) {
Assert.state(false, "在U8C内根据OFS调拨订单号pk_vdefdoc19:{},没有查询到调拨出库单,请检查。", ofsSourceOrderCode);
}
if (icGeneralHEntityList.size() > 1) {
Assert.state(false, "在U8C内根据OFS调拨订单号pk_vdefdoc19:{},查询到调拨出库单不唯一,请检查。", ofsSourceOrderCode);
}
IcGeneralHEntity icGeneralHEntity = icGeneralHEntityList.get(0);
//U8C调拨出库单子表信息
List<IcGeneralBEntity> icGeneralBEntityList = queryIcGeneralBByCgeneralhid(icGeneralHEntity.getCgeneralhid());
if (icGeneralBEntityList == null) {
Assert.state(false, "在U8C内根据U8C调拨出库单主表主键{},调拨出库单单号:{},未查询到调拨出库单子表信息,请检查。", icGeneralHEntity.getCgeneralhid(), icGeneralHEntity.getVbillcode());
}
List<GeneralBillVO.Childrenvo> ChildrenList = new ArrayList<>();
int i = 1;
for (StockinOrderSearchResponse.StockinOrder.StockinB ofsTransferDetail : transferInOrders.getDetails()) {
GeneralBillVO.Childrenvo childrenvo = new GeneralBillVO.Childrenvo();
//cinventoryid 存货
childrenvo.setCinventoryid(ofsTransferDetail.getSkuCode());
//ninnum 实收数量
childrenvo.setNinnum(ofsTransferDetail.getReceivedQty());
//csourcetype 来源单据类型编码
childrenvo.setCsourcetype("4Y");
//vsourcebillcode 来源单据号
childrenvo.setVsourcebillcode(icGeneralHEntity.getVbillcode());
for (IcGeneralBEntity icGeneralBEntity : icGeneralBEntityList) {
System.out.println(icGeneralBEntity);
//根据存货+行号匹配
if (ofsTransferDetail.getRefOrderDetailId().equals(icGeneralBEntity.getPkDefdoc20().trim()) && ofsTransferDetail.getSkuCode().equals(icGeneralBEntity.getCinvbascode())) {
//crowno 行号
childrenvo.setCrowno(i++ + "0");
//ofs来源单据行行号
childrenvo.setPk_defdoc20(ofsTransferDetail.getRefOrderDetailId());
//vsourcerowno 来源单据行号
childrenvo.setVsourcerowno(icGeneralBEntity.getCrowno());
break;
}
}
ChildrenList.add(childrenvo);
}
generalBillVO.setParentvo(parentvo);
generalBillVO.setChildrenvo(ChildrenList);
mapStr = "{\"GeneralBillVO\":[" + JSONUtil.toJsonStr(generalBillVO) + "]}";
ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveInqzCode"), mapStr);
System.out.println(ztResult);
//两层判断,一层中台转发,一层u8c返回
if ("false".equals(ztResult.getFlag())) {
//转发失败
Assert.state(false, "丽知OFS调拨入库订单--->U8C调拨入库订单.中台转发失败,失败原因:{}", ztResult.getMsg());
}
Attribute attribute = ztResult.getAttribute();
System.out.println(attribute);
boolean isSuccess = false;
String vbillcode = "";
if ("success".equals(attribute.getStatus())) {
isSuccess = true;
String data = attribute.getData();
GeneralBillVO generalBill = resultDataHandle(data);
System.out.println(generalBill);
vbillcode = generalBill.getParentvo().getVbillcode();
}
if (!isSuccess) {
Assert.state(false, "推送U8C--> 丽知OFS调拨入库订单--->U8C调拨入库订单 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
}
//成功
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setDef1(vbillcode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) {
e.printStackTrace();
logger.error("推送U8C丽知OFS调拨入库订单--->U8C调拨入库订单保存签字关联U8C调拨出库单失败失败原因" + e);
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
String ErrMessage = null;
if (reusltStrDto != null) {
ErrMessage = "推送U8C丽知OFS调整入库--->U8C其它入库失败失败原因" + reusltStrDto.getErrormsg();
} else {
ErrMessage = e.getMessage();
}
//失败
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
integrationTaskLivingDetailsEntity.setBusinessDate(format);
integrationTaskLivingDetailsEntity.setRootAppPk(ofsCode);
integrationTaskLivingDetailsEntity.setRootAppBill(ofsCode);
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
}
}
}
private GeneralBillVO resultDataHandle(String resultData) {
try {
if (resultData != null && !"".equals(resultData)) {
if (resultData.contains("[")) {
resultData = resultData.substring(1, resultData.length() - 1);
}
return JSON.parseObject(resultData, GeneralBillVO.class);
}
} catch (Exception e) {
e.printStackTrace();
logger.error("解析返回参数失败的错误", e);
//如果解析失败记录原因但是不能影响结果的记录
}
return null;
}
/**
* 查询ofs调拨入库单
*
* @param queryOfsStockinOrderRequestVO
* @return
* @throws Exception
*/
public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception { public List<StockinOrderSearchResponse.StockinOrder> queryOfsStockinOrder(QueryOfsStockinOrderRequestVO queryOfsStockinOrderRequestVO) throws Exception {
Long pageNo = 1L;
List<StockinOrderSearchResponse.StockinOrder> all = new ArrayList<>();
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.receipt.search"); interfaceParamDto.setApi("ofs.receipt.search");
queryOfsStockinOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockinOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
queryOfsStockinOrderRequestVO.setClientCode("LETS"); queryOfsStockinOrderRequestVO.setClientCode("LETS");
queryOfsStockinOrderRequestVO.setPageNo(pageNo);
queryOfsStockinOrderRequestVO.setPageSize(500L);
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); StockinOrderSearchResponse stockinOrderSearchResponse = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
System.out.println(stockinOrderSearchResponse);
all.addAll(stockinOrderSearchResponse.getData());
int count = stockinOrderSearchResponse.getData().size();
while (count >= 500) {//>=500,可能还有下一页
//还有下一页
pageNo++;
queryOfsStockinOrderRequestVO.setPageNo(pageNo);
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockinOrderRequestVO));
StockinOrderSearchResponse stockinOrderSearchResponse1 = (StockinOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto);
all.addAll(stockinOrderSearchResponse1.getData());
count=stockinOrderSearchResponse1.getData().size();
}
if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) { if (stockinOrderSearchResponse.getData() == null || stockinOrderSearchResponse.getData().size() == 0) {
return null; return null;
} }
//过滤ADJUST调整 return stockinOrderSearchResponse.getData();
List<StockinOrderSearchResponse.StockinOrder> adjustList=new ArrayList<>();
for (StockinOrderSearchResponse.StockinOrder datum : stockinOrderSearchResponse.getData()) {
StockinOrderSearchResponse.StockinOrder.StockinH header = datum.getHeader();
if("ADJUST".equals(header.getInternalInstructionType())){
adjustList.add(datum);
} }
/**
* 根据单号查询调拨单 to_bill 单据主表 单据
*
* @param vcode
*/
public List<ToBillEntity> queryToBillByVCode(String vcode) {
ToBillEntity toBillEntity = new ToBillEntity();
toBillEntity.setVcode(vcode);
toBillEntity.setCbilltype("5X");
List<ToBillEntity> toBillEntityList = toBillDao.queryToBillEntity(toBillEntity);
return toBillEntityList;
} }
return adjustList;
/**
* 根据自定义项19ofs调拨订单单号查询u8c调拨订单
*
* @param pkDefdoc19
* @return
*/
public List<ToBillEntity> queryToBillByPkVdefdoc19(String pkDefdoc19) {
ToBillEntity toBillEntity = new ToBillEntity();
toBillEntity.setPkDefdoc19(pkDefdoc19);
toBillEntity.setCbilltype("5X");
toBillEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<ToBillEntity> toBillEntityList = toBillDao.query(toBillEntity);
return toBillEntityList;
} }
/**
* 根据调拨出库单主表自定义项19ofs调拨订单号查询调拨出库单主表
*/
public List<IcGeneralHEntity> queryIcGeneralHByPkVdefdoc19(String pkDefdoc19) {
IcGeneralHEntity icGeneralHEntity = new IcGeneralHEntity();
icGeneralHEntity.setDr(0);
icGeneralHEntity.setPkDefdoc19(pkDefdoc19);
icGeneralHEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<IcGeneralHEntity> icGeneralHEntityList = icGeneralHDao.query(icGeneralHEntity);
if (icGeneralHEntityList == null || icGeneralHEntityList.size() == 0) {
return null;
}
return icGeneralHEntityList;
}
/**
* 根据调拨出库单主表主键查询调拨出库单子表
*/
public List<IcGeneralBEntity> queryIcGeneralBByCgeneralhid(String cgeneralhid) {
// IcGeneralBEntity icGeneralBEntity = new IcGeneralBEntity();
// icGeneralBEntity.setDr(0);
// icGeneralBEntity.setCgeneralhid(cgeneralhid);
// icGeneralBEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
List<IcGeneralBEntity> icGeneralBEntityList = icGeneralBDao.queryAndCinvbasCode(cgeneralhid);
if (icGeneralBEntityList == null || icGeneralBEntityList.size() == 0) {
return null;
}
return icGeneralBEntityList;
}
} }

View File

@ -96,6 +96,38 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
@Override @Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
start(split[0], split[1]);
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
start(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails);
start(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
//默认
start();
}
} catch (Exception e) {
e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return null; return null;
} }
@ -115,18 +147,18 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setClosedAt_start(startTimeStr); queryOfsStockoutOrderRequestVO.setClosedAt_start(startTimeStr);
queryOfsStockoutOrderRequestVO.setClosedAt_end(endTimeStr); queryOfsStockoutOrderRequestVO.setClosedAt_end(endTimeStr);
// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
queryOfsStockoutOrderRequestVO.setPageNo(1L); if(transferOutOrder.size()==0){
queryOfsStockoutOrderRequestVO.setPageSize(500L); return;
List<StockoutOrderSearchResponse.StockoutOrder> data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); }
System.out.println(data); //过滤成功日志
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
//过滤日志 if(filterTransferOutOrders.size()==0){
return;
//推送 }
//推送U8C
implement(filterTransferOutOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字,start()方法报错:", e); logger.error("丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字,start()方法报错:", e);
} }
@ -139,16 +171,16 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
try { try {
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setCode(stockoutNo); queryOfsStockoutOrderRequestVO.setCode(stockoutNo);
// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO); List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
System.out.println(transferOutOrder); if(transferOutOrder.size()==0){
Assert.state(false, "丽知OFS调拨出库订单[出库完成]--->U8C调拨订单自动生成调拨出库单保存签字未查询到调拨出库单", stockoutNo);
}
//过滤成功日志 //过滤成功日志
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder); List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
if(filterTransferOutOrders.size()==0){
Assert.state(false, "丽知OFS调拨出库订单[出库完成]--->U8C调拨订单自动生成调拨出库单保存签字该调拨出库单已被推送成功请勿重新推送", stockoutNo);
}
//推送U8C //推送U8C
implement(filterTransferOutOrders); implement(filterTransferOutOrders);
@ -170,13 +202,19 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO(); QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO = new QueryOfsStockoutOrderRequestVO();
queryOfsStockoutOrderRequestVO.setClosedAt_start(start); queryOfsStockoutOrderRequestVO.setClosedAt_start(start);
queryOfsStockoutOrderRequestVO.setClosedAt_end(end); queryOfsStockoutOrderRequestVO.setClosedAt_end(end);
// queryOfsStockoutOrderRequestVO.setCompanyCode("SHXM"); queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库
// queryOfsStockoutOrderRequestVO.setStatus("900");//状态 500待同步 510已同步 700收货中 900入库完成 911作废 100订单池 200暂挂 400待合单 410待出库单出库 List<StockoutOrderSearchResponse.StockoutOrder> transferOutOrder = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
queryOfsStockoutOrderRequestVO.setPageNo(1L);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
List<StockoutOrderSearchResponse.StockoutOrder> data = queryOfsStockoutOrder(queryOfsStockoutOrderRequestVO);
System.out.println(data);
if(transferOutOrder.size()==0){
Assert.state(false, "丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字根据日期期间[开始时间]-[结束时间]{}-{},未查询到调拨出库单[出库完成]", startTime, endTime);
}
//过滤成功日志
List<StockoutOrderSearchResponse.StockoutOrder> filterTransferOutOrders = filterData(transferOutOrder);
if(filterTransferOutOrders.size()==0){
Assert.state(false, "丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字根据日期期间[开始时间]-[结束时间]{}-{},该调期调拨出库单[出库完成]已被推送成功,请勿重新推送", startTime, endTime);
}
//推送U8C
implement(filterTransferOutOrders);
} catch (Exception e) { } catch (Exception e) {
logger.error("丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字,start(String startTime, String endTime)方法报错:", e); logger.error("丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字,start(String startTime, String endTime)方法报错:", e);
} }
@ -204,7 +242,6 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
} }
} }
return filterTransferOutOrders; return filterTransferOutOrders;
} }
/** /**
@ -227,7 +264,6 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
BillVO.Parentvo parentvo = new BillVO.Parentvo(); BillVO.Parentvo parentvo = new BillVO.Parentvo();
ofsCode = stockoutH.getCode(); ofsCode = stockoutH.getCode();
////////////////////////////////////////////////////////////////////////////////ofs调拨订单 ////////////////////////////////////////////////////////////////////////////////ofs调拨订单
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(stockoutH.getSourceOrderCode()); List<OFSTranseferOrderSearchResponse.OFSTranseferOrder> ofsTranseferOrders = queryOfsTransderOrder(stockoutH.getSourceOrderCode());
if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0 || ofsTranseferOrders.size() > 1) { if (ofsTranseferOrders == null || ofsTranseferOrders.size() == 0 || ofsTranseferOrders.size() > 1) {
@ -237,8 +273,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
System.out.println(ofsTranseferOrder); System.out.println(ofsTranseferOrder);
////////////////////////////////////////////////////////////////////////////////ofs调拨订单 ////////////////////////////////////////////////////////////////////////////////ofs调拨订单
//创建日期调拨出库创建时间
//创建日期
String created = stockoutH.getCreated(); String created = stockoutH.getCreated();
format = created; format = created;
//dbilldate 单据日期 //dbilldate 单据日期
@ -270,8 +305,8 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
//vnote 备注 //vnote 备注
parentvo.setVnote(ofsTranseferOrder.getHeader().getNotes()); parentvo.setVnote(ofsTranseferOrder.getHeader().getNotes());
//pk_defdoc19 //pk_defdoc19 OFS调拨订单号
parentvo.setPk_defdoc19(StringUtils.substring(ofsTranseferOrder.getHeader().getCode(),5)); parentvo.setPk_defdoc19(ofsTranseferOrder.getHeader().getCode());
//子表 //子表
List<OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB> ofsDetails = ofsTranseferOrder.getDetails(); List<OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB> ofsDetails = ofsTranseferOrder.getDetails();
@ -285,6 +320,9 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
//nnum 数量 //nnum 数量
children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty())); children.setNnum(BigDecimal.valueOf(ofsDetail.getShipQty()));
childrenvo.add(children); childrenvo.add(children);
//ofs行id
children.setPk_defdoc20(ofsDetail.getId());
} }
billVO.setParentvo(parentvo); billVO.setParentvo(parentvo);
billVO.setChildrenvo(childrenvo); billVO.setChildrenvo(childrenvo);
@ -325,14 +363,18 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("推送U8C丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字失败失败原因" + e); logger.error("推送U8C丽知OFS调拨出库订单--->U8C调拨订单自动生成调拨出库单保存签字失败失败原因" + e);
//失败 //失败
ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
String ErrMessage = "推送U8C丽知OFS调整出库--->U8C其它出库失败失败原因" + reusltStrDto.getErrormsg(); String ErrMessage=null;
if (reusltStrDto != null) {
ErrMessage = "推送U8C丽知OFS调整出库--->U8C其它出库失败失败原因" + reusltStrDto.getErrormsg();
}else {
ErrMessage=e.getMessage();
}
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
@ -359,19 +401,38 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
* @throws Exception * @throws Exception
*/ */
public List<StockoutOrderSearchResponse.StockoutOrder> queryOfsStockoutOrder(QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO) throws Exception { public List<StockoutOrderSearchResponse.StockoutOrder> queryOfsStockoutOrder(QueryOfsStockoutOrderRequestVO queryOfsStockoutOrderRequestVO) throws Exception {
Long pageNo = 1L;
List<StockoutOrderSearchResponse.StockoutOrder> all = new ArrayList<>();
InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.shipment.search"); interfaceParamDto.setApi("ofs.shipment.search");
queryOfsStockoutOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货 queryOfsStockoutOrderRequestVO.setInternalInstructionType("TRANSFER");//入库单类型 SALES销售 EXCHANGE换货 REISSUE补发RETURN销退 PURCHASE采购 PURCHASE_RETURN采退 TRANSFER调拨 WORK_ORDER加工 OTHER其他 ADJUST调整 EXCHANGE换货
queryOfsStockoutOrderRequestVO.setClientCode("LETS"); queryOfsStockoutOrderRequestVO.setClientCode("LETS");
queryOfsStockoutOrderRequestVO.setPageNo(pageNo);
queryOfsStockoutOrderRequestVO.setPageSize(500L);
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO)); interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO));
SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto);
System.out.println(saleOutReturnMessageDto);
StockoutOrderSearchResponse stockoutOrderSearchResponse = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto); StockoutOrderSearchResponse stockoutOrderSearchResponse = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto);
System.out.println(stockoutOrderSearchResponse);
all.addAll(stockoutOrderSearchResponse.getData());
int count = stockoutOrderSearchResponse.getData().size();
while (count >= 500) {//>=500,可能还有下一页
//还有下一页
pageNo++;
queryOfsStockoutOrderRequestVO.setPageNo(pageNo);
interfaceParamDto.setData(JSON.toJSONString(queryOfsStockoutOrderRequestVO));
SaleOutReturnMessageDto saleOutReturnMessageDto1 = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto);
StockoutOrderSearchResponse stockoutOrderSearchResponse1 = SaleOutReturnMessageDto2StockoutOrderSearchResponse(saleOutReturnMessageDto1);
all.addAll(stockoutOrderSearchResponse1.getData());
count=stockoutOrderSearchResponse1.getData().size();
}
if (stockoutOrderSearchResponse.getData() == null || stockoutOrderSearchResponse.getData().size() == 0) { if (stockoutOrderSearchResponse.getData() == null || stockoutOrderSearchResponse.getData().size() == 0) {
return null; return null;
} }
return stockoutOrderSearchResponse.getData(); return all;
} }
/** /**

View File

@ -1,16 +1,21 @@
package com.hzya.frame.plugin.lets.u8cdto; package com.hzya.frame.plugin.lets.u8cdto;
import lombok.Data;
import java.util.List; import java.util.List;
/** /**
* 出入库单实体 * 出入库单实体
*
* @Author zyd * @Author zyd
*/ */
@Data
public class GeneralBillVO { public class GeneralBillVO {
private Parentvo parentvo; private Parentvo parentvo;
private List<Childrenvo> childrenvo; private List<Childrenvo> childrenvo;
@Data
public static class Parentvo { public static class Parentvo {
/** /**
* 单据号 * 单据号
@ -49,79 +54,29 @@ public class GeneralBillVO {
* 备注 * 备注
*/ */
private String vnote; private String vnote;
private String pk_defdoc1;
public String getVbillcode() { private String pk_defdoc10;
return vbillcode; private String pk_defdoc11;
private String pk_defdoc12;
private String pk_defdoc13;
private String pk_defdoc14;
private String pk_defdoc15;
private String pk_defdoc16;
private String pk_defdoc17;
private String pk_defdoc18;
private String pk_defdoc19;
private String pk_defdoc2;
private String pk_defdoc20;
private String pk_defdoc3;
private String pk_defdoc4;
private String pk_defdoc5;
private String pk_defdoc6;
private String pk_defdoc7;
private String pk_defdoc8;
private String pk_defdoc9;
} }
public void setVbillcode(String vbillcode) { @Data
this.vbillcode = vbillcode;
}
public String getCbilltypecode() {
return cbilltypecode;
}
public void setCbilltypecode(String cbilltypecode) {
this.cbilltypecode = cbilltypecode;
}
public String getPk_calbody() {
return pk_calbody;
}
public void setPk_calbody(String pk_calbody) {
this.pk_calbody = pk_calbody;
}
public String getIsautopick() {
return isautopick;
}
public void setIsautopick(String isautopick) {
this.isautopick = isautopick;
}
public String getPk_corp() {
return pk_corp;
}
public void setPk_corp(String pk_corp) {
this.pk_corp = pk_corp;
}
public String getCoperatorid() {
return coperatorid;
}
public void setCoperatorid(String coperatorid) {
this.coperatorid = coperatorid;
}
public String getCdispatcherid() {
return cdispatcherid;
}
public void setCdispatcherid(String cdispatcherid) {
this.cdispatcherid = cdispatcherid;
}
public String getCwarehouseid() {
return cwarehouseid;
}
public void setCwarehouseid(String cwarehouseid) {
this.cwarehouseid = cwarehouseid;
}
public String getVnote() {
return vnote;
}
public void setVnote(String vnote) {
this.vnote = vnote;
}
}
public static class Childrenvo { public static class Childrenvo {
/** /**
* 存货ID * 存货ID
@ -175,126 +130,11 @@ public class GeneralBillVO {
* 行备注 * 行备注
*/ */
private String vnotebody; private String vnotebody;
/**
public String getNshouldinnum() { * ofs来源行号
return nshouldinnum; */
} private String pk_defdoc20;
public void setNshouldinnum(String nshouldinnum) {
this.nshouldinnum = nshouldinnum;
}
public String getCsourcebillhid() {
return csourcebillhid;
}
public void setCsourcebillhid(String csourcebillhid) {
this.csourcebillhid = csourcebillhid;
}
public String getCsourcebillbid() {
return csourcebillbid;
}
public void setCsourcebillbid(String csourcebillbid) {
this.csourcebillbid = csourcebillbid;
}
public String getVbatchcode() {
return vbatchcode;
}
public void setVbatchcode(String vbatchcode) {
this.vbatchcode = vbatchcode;
}
public String getNoutnum() {
return noutnum;
}
public void setNoutnum(String noutnum) {
this.noutnum = noutnum;
}
public String getCinventoryid() {
return cinventoryid;
}
public String getCrowno() {
return crowno;
}
public String getVsourcerowno() {
return vsourcerowno;
}
public void setVsourcerowno(String vsourcerowno) {
this.vsourcerowno = vsourcerowno;
}
public String getNinnum() {
return ninnum;
}
public void setNinnum(String ninnum) {
this.ninnum = ninnum;
}
public void setCrowno(String crowno) {
this.crowno = crowno;
} }
public void setCinventoryid(String cinventoryid) {
this.cinventoryid = cinventoryid;
}
public String getVsourcebillcode() {
return vsourcebillcode;
}
public void setVsourcebillcode(String vsourcebillcode) {
this.vsourcebillcode = vsourcebillcode;
}
public String getCsourcetype() {
return csourcetype;
}
public void setCsourcetype(String csourcetype) {
this.csourcetype = csourcetype;
}
public String getNshouldoutnum() {
return nshouldoutnum;
}
public void setNshouldoutnum(String nshouldoutnum) {
this.nshouldoutnum = nshouldoutnum;
}
public String getVnotebody() {
return vnotebody;
}
public void setVnotebody(String vnotebody) {
this.vnotebody = vnotebody;
}
}
public Parentvo getParentvo() {
return parentvo;
}
public void setParentvo(Parentvo parentvo) {
this.parentvo = parentvo;
}
public List<Childrenvo> getChildrenvo() {
return childrenvo;
}
public void setChildrenvo(List<Childrenvo> childrenvo) {
this.childrenvo = childrenvo;
}
} }

View File

@ -0,0 +1,103 @@
package com.hzya.frame.plugin.lets.u8cdto;
import lombok.Data;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.u8cdto
* @ProjectkangarooDataCenterV3
* @namePoOrderHaderDto
* @Date2024/8/20 15:17
* @FilenamePoOrderHaderDto
*/
@Data
public class PoOrderChildrenDto {
private String blargess;
private String cassistunit;
private String cbaseid;
private String ccurrencytypeid;
private String cmangid;
private String coperator;
private String corder_bid;
private String corderid;
private String cprojectid;
private String crowno;
private String csourcebillid;
private String csourcebilltype;
private String csourcerowid;
private String cupsourcebillid;
private String cupsourcebillrowid;
private String cupsourcebilltype;
private String cusedeptid;
private String cwarehouseid;
private String dplanarrvdate;
private String forderrowstatus;
private String idiscounttaxtype;
private String nassistnum;
private String ndiscountrate;
private String nexchangeotobrate;
private String nmoney;
private String nordernum;
private String norgnettaxprice;
private String norgtaxprice;
private String noriginalcurmny;
private String noriginalcurprice;
private String noriginalnetprice;
private String noriginaltaxmny;
private String noriginaltaxpricemny;
private String ntaxmny;
private String ntaxpricemny;
private String ntaxrate;
private String pk_arrvcorp;
private String pk_arrvstoorg;
private String pk_corp;
private String pk_defdoc1;
private String pk_defdoc10;
private String pk_defdoc11;
private String pk_defdoc12;
private String pk_defdoc13;
private String pk_defdoc14;
private String pk_defdoc15;
private String pk_defdoc16;
private String pk_defdoc17;
private String pk_defdoc18;
private String pk_defdoc19;
private String pk_defdoc2;
private String pk_defdoc20;
private String pk_defdoc3;
private String pk_defdoc4;
private String pk_defdoc5;
private String pk_defdoc6;
private String pk_defdoc7;
private String pk_defdoc8;
private String pk_defdoc9;
private String pk_invoicecorp;
private String vdef1;
private String vdef10;
private String vdef11;
private String vdef12;
private String vdef13;
private String vdef14;
private String vdef15;
private String vdef16;
private String vdef17;
private String vdef18;
private String vdef19;
private String vdef2;
private String vdef20;
private String vdef3;
private String vdef4;
private String vdef5;
private String vdef6;
private String vdef7;
private String vdef8;
private String vdef9;
private String vfree1;
private String vfree2;
private String vfree3;
private String vfree4;
private String vfree5;
private String vmemo;
private String vostatus;
private String vproducenum;
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.plugin.lets.u8cdto;
import lombok.Data;
import java.util.List;
/**
* U8C采购订单保存接口入参实体类
*
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.u8cdto
* @ProjectkangarooDataCenterV3
* @namePoOrderHaderDto
* @Date2024/8/20 15:17
* @FilenamePoOrderHaderDto
*/
@Data
public class PoOrderParentChildrenDto {
private PoOrderParentDto parentvo;
private List<PoOrderChildrenDto> childrenvo;
}

View File

@ -0,0 +1,94 @@
package com.hzya.frame.plugin.lets.u8cdto;
import lombok.Data;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.u8cdto
* @ProjectkangarooDataCenterV3
* @namePoOrderHaderDto
* @Date2024/8/20 15:17
* @FilenamePoOrderHaderDto
*/
@Data
public class PoOrderParentDto {
private String bcooptoso;
private String bislatest;
private String bisreplenish;
private String bpubtoec;
private String breturn;
private String bsocooptome;
private String caccountbankid;
private String caccountyear;
private String cauditpsn;
private String cbiztype;
private String ccontracttextpath;
private String ccurrencytypeid;
private String cdeliveraddress;
private String cdeptid;
private String cemployeeid;
private String cfreecustid;
private String cgiveinvoicevendo;
private String coperator;
private String corderid;
private String cpubpsn;
private String cpurorganization;
private String creciever;
private String cresppsn;
private String crevisepsn;
private String ctermprotocolid;
private String ctransmodeid;
private String cunfreeze;
private String cvendormangid;
private String dauditdate;
private String dorderdate;
private String drevisiondate;
private String forderstatus;
private String isSaveWhenOverSto;
private String nexchangeotobrate;
private String pk_corp;
private String pk_defdoc1;
private String pk_defdoc10;
private String pk_defdoc11;
private String pk_defdoc12;
private String pk_defdoc13;
private String pk_defdoc14;
private String pk_defdoc15;
private String pk_defdoc16;
private String pk_defdoc17;
private String pk_defdoc18;
private String pk_defdoc19;
private String pk_defdoc2;
private String pk_defdoc20;
private String pk_defdoc3;
private String pk_defdoc4;
private String pk_defdoc5;
private String pk_defdoc6;
private String pk_defdoc7;
private String pk_defdoc8;
private String pk_defdoc9;
private String tlastmaketime;
private String tmaketime;
private String vdef1;
private String vdef10;
private String vdef11;
private String vdef12;
private String vdef13;
private String vdef14;
private String vdef15;
private String vdef16;
private String vdef17;
private String vdef18;
private String vdef19;
private String vdef2;
private String vdef20;
private String vdef3;
private String vdef4;
private String vdef5;
private String vdef6;
private String vdef7;
private String vdef8;
private String vdef9;
private String vmemo;
private String vordercode;
}

View File

@ -0,0 +1,64 @@
package com.hzya.frame.plugin.lets.u8cdto;
import com.hzya.frame.plugin.lets.entity.*;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderData;
import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
import lombok.Data;
import java.util.List;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.u8cdto
* @ProjectkangarooDataCenterV3
* @namePoOrderSonDto
* @Date2024/8/20 14:51
* @FilenamePoOrderSonDto
*/
@Data
public class PoOrderSonDto extends StockinOrderSearchResponse.StockinOrder.StockinH {
/**
* 采购公司
*/
private BdCorpEntity bdCorpEntity;
/**
* 采购部门
*/
private BdDeptdocEntity bdDeptdocEntity;
/**
* 采购组织
*/
private BdPurorgEntity bdPurorgEntity;
/**
* 客商基本档案-供应商
*/
private BdCubasdocEntity bdCubasdocEntity;
/**
* 客商管理档案-供应商
*/
private BdCumandocEntity bdCumandocEntity;
/**
* 明细行
*/
private List<StockinOrderSearchResponse.StockinOrder.StockinB> details;
/**
* OFS采购订单
*/
private OfsPoOrderData ofsPoOrderData;
/**
* 收货库存组织
*/
private BdCalbodyEntity bdCalbodyEntity;
/**
* 收货仓库
*/
private BdStordocEntity bdStordocEntity;
}

View File

@ -47,4 +47,5 @@
<bean name="iTocofsReturngoodsDetailedDaoImpl" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl"/> <bean name="iTocofsReturngoodsDetailedDaoImpl" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl"/>
<bean name="tocofsSaleoutDao" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDaoImpl"/> <bean name="tocofsSaleoutDao" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDaoImpl"/>
<bean name="tocofsSaleoutDetailedDaoImpl" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl"/> <bean name="tocofsSaleoutDetailedDaoImpl" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl"/>
<bean name="bdPurorgDao" class="com.hzya.frame.plugin.lets.dao.impl.BdPurorgDaoImpl"/>
</beans> </beans>

View File

@ -23,4 +23,7 @@
<bean name="soSaleOutPluginInitializerToB" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB"/> <bean name="soSaleOutPluginInitializerToB" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleOutPluginInitializerToB"/>
<bean name="soSaleReturnPluginInitializerToB" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToB"/> <bean name="soSaleReturnPluginInitializerToB" class="com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToB"/>
<bean name="proxyPurchaseWarehous" class="com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseWarehous"/>
<bean name="proxyPurchaseReturn" class="com.hzya.frame.plugin.lets.plugin.purchase.ProxyPurchaseReturn"/>
</beans> </beans>

View File

@ -23,6 +23,10 @@ public class BaseTest {
public void t00(){ public void t00(){
skuPluginInitializer.start(); skuPluginInitializer.start();
} }
@Test
public void t01(){
skuPluginInitializer.start("2024-08-20","2024-08-20");
}
////////////////////////////////////////////////////////////////////////////////////SKU自动分配 ////////////////////////////////////////////////////////////////////////////////////SKU自动分配
@Test @Test
public void t10(){ public void t10(){

View File

@ -0,0 +1,35 @@
package com.hzya.frame.plugin.lets.plugin.purchase;
import com.hzya.frame.WebappApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.*;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.plugin.purchase
* @ProjectkangarooDataCenterV3
* @nameProxyPurchaseReturnTest
* @Date2024/8/20 18:19
* @FilenameProxyPurchaseReturnTest
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WebappApplication.class)
public class ProxyPurchaseReturnTest {
@Autowired
private ProxyPurchaseReturn proxyPurchaseReturn;
@Test
public void startImplement() {
try {
proxyPurchaseReturn.startImplement("LETS-SH2024082000000006");
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,45 @@
package com.hzya.frame.plugin.lets.plugin.purchase;
import com.hzya.frame.WebappApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.*;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.plugin.purchase
* @ProjectkangarooDataCenterV3
* @nameProxyPurchaseWarehousTest
* @Date2024/8/20 11:05
* @FilenameProxyPurchaseWarehousTest
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WebappApplication.class)
public class ProxyPurchaseWarehousTest {
@Autowired
private ProxyPurchaseWarehous proxyPurchaseWarehous;
@Test
public void startImplement() {
try {
proxyPurchaseWarehous.startImplement("LETS-RE2024010200000001");
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void startImplement2() {
try {
//2024年8月20日 16:17:24 测试查询OFS采购订单
proxyPurchaseWarehous.queryOfsPoOrder("LETS-PO2024010200000001");
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -1,6 +1,8 @@
package com.hzya.frame.plugin.lets.plugin.sales; package com.hzya.frame.plugin.lets.plugin.sales;
import com.hzya.frame.WebappApplication; import com.hzya.frame.WebappApplication;
import com.hzya.frame.plugin.lets.util.AfterSalesOrderUtil;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,8 +26,19 @@ public class SoSaleOutPluginInitializerToBTest {
@Autowired @Autowired
private SoSaleOutPluginInitializerToB soSaleOutPluginInitializerToB; private SoSaleOutPluginInitializerToB soSaleOutPluginInitializerToB;
@Autowired
private AfterSalesOrderUtil afterSalesOrderUtil;
@Test @Test
public void startImplement() { public void startImplement() {
soSaleOutPluginInitializerToB.startImplement(null, null); // soSaleOutPluginInitializerToB.startImplement(null, null);
soSaleOutPluginInitializerToB.startImplement("LETS-SH2024010900000008");
// try {
// SaleOrderMessageDto ofsOrder = afterSalesOrderUtil.getOfsOrder("LETS-SO2024081600000050");
// System.out.println(ofsOrder);
// } catch (Exception e) {
// e.printStackTrace();
// }
} }
} }

View File

@ -40,7 +40,7 @@ public class TransferTest {
@Test @Test
public void t10(){ public void t10(){
transferOutPluginInitializer.start("LETS-SH2024081400000001"); transferOutPluginInitializer.start("LETS-SH2024082200000005");
} }
@Test @Test
@ -55,7 +55,7 @@ public class TransferTest {
} }
@Test @Test
public void t21(){ public void t21(){
transferInPluginInitializer.start("LETS-RE2024081900000002"); transferInPluginInitializer.start("LETS-RE2024082200000001");
} }

View File

@ -5,6 +5,7 @@ import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OFSSKUSearchResponse;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsShopReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofsBaseSearch.OfsSupplierReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse; import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSTranseferOrderSearchResponse;
import com.hzya.frame.ttxofs.dto.ofspoorder.OfsPoOrderBean;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean; import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean;
@ -40,5 +41,7 @@ public class ApiDtoCacheMap {
apiDtoCacheMap.put("ofs.inventory.class.search", new OFSSKUClassSearchResponse());//OFS存货分类查询接口 apiDtoCacheMap.put("ofs.inventory.class.search", new OFSSKUClassSearchResponse());//OFS存货分类查询接口
apiDtoCacheMap.put("ofs.returnOrder.search", new RerturnGoodsOrderSearchJsonRootBean());//售后订单 apiDtoCacheMap.put("ofs.returnOrder.search", new RerturnGoodsOrderSearchJsonRootBean());//售后订单
apiDtoCacheMap.put("ofs.purchaseOrder.search", new OfsPoOrderBean());//采购订单
} }
} }

View File

@ -3,7 +3,6 @@ package com.hzya.frame.ttxofs.dto.ofsBaseSearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -15,19 +14,19 @@ public class OFSSKUSearchResponse extends ReturnMessageBasics {
@Data @Data
public static class OFSSKU{ public static class OFSSKU{
private int id; private String id;
private String clientCode; private String clientCode;
private String companyCode; private String companyCode;
private String code; private String code;
private String name; private String name;
private int listPrice; private String listPrice;
private int netPrice; private String netPrice;
private int msrPrice; private String msrPrice;
private int buyPrice; private String buyPrice;
private int status; private String status;
private Date created; private String created;
private String createdBy; private String createdBy;
private Date lastUpdated; private String lastUpdated;
private String lastUpdatedBy; private String lastUpdatedBy;
} }
} }

View File

@ -84,7 +84,7 @@ public class OFSTranseferOrderSearchResponse extends ReturnMessageBasics {
@Data @Data
public class OFSTranseferB{ public class OFSTranseferB{
/** id */ /** id */
private Integer id; private String id;
/** 订单ID */ /** 订单ID */
private Integer transferOrderId; private Integer transferOrderId;
/** 订单编号 */ /** 订单编号 */

View File

@ -0,0 +1,11 @@
package com.hzya.frame.ttxofs.dto.ofspoorder;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import lombok.Data;
import java.util.List;
@Data
public class OfsPoOrderBean extends ReturnMessageBasics {
private List<OfsPoOrderData> data;
}

View File

@ -0,0 +1,11 @@
package com.hzya.frame.ttxofs.dto.ofspoorder;
import lombok.Data;
import java.util.List;
@Data
public class OfsPoOrderData {
private OfsPoOrderHeader header;
private List<OfsPoOrderDetails> details;
}

View File

@ -0,0 +1,37 @@
package com.hzya.frame.ttxofs.dto.ofspoorder;
import lombok.Data;
@Data
public class OfsPoOrderDetails {
private String clientCode;
private String id;
private String purchaseOrderId;
private String purchaseOrderCode;
private String skuCode;
private String skuName;
private String requestQty;
private String openQty;
private String fulfillQty;
private String asnPendingQty;
private String returnableQty;
private String quantityUM;
private String buyPrice;
private String discountPrice;
private String discount;
private String totalAmount;
private String totalWeight;
private String totalVolume;
private String totalVolumeWeight;
private String fulfillAmount;
private String fulfillWeight;
private String fulfillVolume;
private String weightUM;
private String volumeUM;
private String inventorySts;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
}

View File

@ -0,0 +1,52 @@
package com.hzya.frame.ttxofs.dto.ofspoorder;
import lombok.Data;
@Data
public class OfsPoOrderHeader {
private String id;
private String clientCode;
private String companyCode;
private String facilityCode;
private String code;
private String internalOrderType;
private String bizChannel;
private String sourceAsnCode;
private String status;
private String vendorName;
private String shipFromAttentionTo;
private String shipFromCountry;
private String shipFromAddress;
private String shipFromPostalCode;
private String shipFromPhone;
private String shipFromMobile;
private String shipFromFax;
private String shipFromEmail;
private String totalAmount;
private String totalLines;
private String totalQty;
private String totalWeight;
private String totalVolume;
private String totalVolumeWeight;
private String totalFulfillQty;
private String totalFulfillAmount;
private String totalFulfillWeight;
private String totalFulfillVolume;
private String totalFulfillVolumeWeight;
private String weightUM;
private String volumeUM;
private String sourcePlatformCode;
private String sourceOrderId;
private String sourceOrderCode;
private String auditBy;
private String auditAt;
private String closedBy;
private String closedAt;
private String errorCode;
private String errorDesc;
private String note;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
}

View File

@ -10,15 +10,15 @@ import java.util.List;
*/ */
@Data @Data
public class StockinOrderSearchResponse extends ReturnMessageBasics { public class StockinOrderSearchResponse extends ReturnMessageBasics {
private List<StockinOrder> data; public List<StockinOrder> data;
@Data @Data
public class StockinOrder { public static class StockinOrder {
private StockinH header; private StockinH header;
private List<StockinB> details; private List<StockinB> details;
@Data @Data
public class StockinH { public static class StockinH {
private String id; private String id;
private String clientCode; private String clientCode;
@ -62,10 +62,13 @@ public class StockinOrderSearchResponse extends ReturnMessageBasics {
private String lastUpdatedBy; private String lastUpdatedBy;
private String sourcePlatformCode; private String sourcePlatformCode;
private String storeCode; private String storeCode;
private String shipFromCode;
private String shipFromAddressCode;
private String shipAt;
} }
@Data @Data
public class StockinB { public static class StockinB {
private String id; private String id;
private String receiptId; private String receiptId;