优化TOB销售发票的业务流程
This commit is contained in:
parent
130bacee77
commit
e89ce86954
|
@ -16,6 +16,7 @@ public interface IIcGeneralBDao extends IBaseDao<IcGeneralBEntity, String> {
|
|||
* 根据cgeneralhid表头主键查询
|
||||
*/
|
||||
public List<IcGeneralBEntity> queryByCgeneralhid(String cgeneralhid);
|
||||
|
||||
public List<IcGeneralBEntity> queryAndCinvbasCode(String cgeneralhid);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.hzya.frame.plugin.lets.dao;
|
|||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity;
|
||||
import com.hzya.frame.plugin.lets.queryvo.ExtIntegrationTaskLivingDetailsQueryVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -25,5 +26,5 @@ public interface ISoSaleorderBDao extends IBaseDao<SoSaleorderBEntity, String> {
|
|||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
List queryErrorDetailsId(SoSaleorderBEntity soSaleorderBEntity) throws Exception;
|
||||
List<ExtIntegrationTaskLivingDetailsQueryVo> queryErrorDetailsId(SoSaleorderBEntity soSaleorderBEntity) throws Exception;
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.plugin.lets.dao.ISoSaleorderBDao;
|
||||
import com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity;
|
||||
import com.hzya.frame.plugin.lets.queryvo.ExtIntegrationTaskLivingDetailsQueryVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,15 +17,15 @@ import java.util.List;
|
|||
//@Repository("SoSaleorderBDaoImpl")
|
||||
public class SoSaleorderBDaoImpl extends MybatisGenericDao<SoSaleorderBEntity, String> implements ISoSaleorderBDao {
|
||||
|
||||
@DS("sowow_sqlserver_test")
|
||||
@DS("lets_u8c")
|
||||
@Override
|
||||
public List<SoSaleorderBEntity> querySoSaleBEntity(SoSaleorderBEntity soSaleorderBEntity) throws Exception {
|
||||
return query("com.hzya.frame.plugin.lets.dao.impl.SoSaleorderBDaoImpl.querySoSaleBEntity", soSaleorderBEntity);
|
||||
}
|
||||
|
||||
@DS("sowow_sqlserver_test")
|
||||
@DS("lets_u8c")
|
||||
@Override
|
||||
public List queryErrorDetailsId(SoSaleorderBEntity soSaleorderBEntity) throws Exception {
|
||||
return super.selectList(getSqlIdPrifx() + "queryErrorDetailsId", soSaleorderBEntity);
|
||||
public List<ExtIntegrationTaskLivingDetailsQueryVo> queryErrorDetailsId(SoSaleorderBEntity soSaleorderBEntity) throws Exception {
|
||||
return (List<ExtIntegrationTaskLivingDetailsQueryVo>) super.selectList(getSqlIdPrifx() + "queryErrorDetailsId", soSaleorderBEntity);
|
||||
}
|
||||
}
|
|
@ -44,7 +44,9 @@ public class IcGeneralBEntity extends BaseEntity {
|
|||
private String cfreezeid;
|
||||
private String cgeneralbid;
|
||||
private String cgeneralhid;
|
||||
/** 存货档案code */
|
||||
/**
|
||||
* 存货档案code
|
||||
*/
|
||||
private String cinvbascode;
|
||||
private String cinvbasid;
|
||||
private String cinventoryid;
|
||||
|
@ -229,8 +231,7 @@ public class IcGeneralBEntity extends BaseEntity {
|
|||
private String vuserdef9;
|
||||
private String vvehiclecode;
|
||||
private String writeofftype;
|
||||
|
||||
|
||||
private String cupsourcebillbodyid;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.hzya.frame.plugin.lets.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* (IcGeneralH)实体类
|
||||
*
|
||||
|
@ -108,12 +109,29 @@ public class IcGeneralHEntity extends BaseEntity {
|
|||
private String vuserdef8;
|
||||
private String vuserdef9;
|
||||
|
||||
/** 签字开始时间*/
|
||||
/**
|
||||
* 签字开始时间
|
||||
*/
|
||||
private String start_signatureTime;
|
||||
|
||||
/** 签字结束时间*/
|
||||
/**
|
||||
* 签字结束时间
|
||||
*/
|
||||
private String end_signatureTime;
|
||||
|
||||
/**
|
||||
* 来源表头id
|
||||
*/
|
||||
private String csourcebillhid;
|
||||
|
||||
public String getCsourcebillhid() {
|
||||
return csourcebillhid;
|
||||
}
|
||||
|
||||
public void setCsourcebillhid(String csourcebillhid) {
|
||||
this.csourcebillhid = csourcebillhid;
|
||||
}
|
||||
|
||||
public String getStart_signatureTime() {
|
||||
return start_signatureTime;
|
||||
}
|
||||
|
|
|
@ -340,6 +340,9 @@
|
|||
<if test="vuserdef7 != null and vuserdef7 != ''">and vuserdef7 = #{vuserdef7}</if>
|
||||
<if test="vuserdef8 != null and vuserdef8 != ''">and vuserdef8 = #{vuserdef8}</if>
|
||||
<if test="vuserdef9 != null and vuserdef9 != ''">and vuserdef9 = #{vuserdef9}</if>
|
||||
<if test="csourcebillhid!=null and csourcebillhid!=''">
|
||||
and cgeneralhid IN ( SELECT cgeneralhid FROM ic_general_b WHERE dr = 0 AND csourcebillhid = #{csourcebillhid} )
|
||||
</if>
|
||||
and dr=0
|
||||
</trim>
|
||||
</select>
|
||||
|
|
|
@ -141,6 +141,16 @@ public class SoSaleorderBEntity extends BaseEntity {
|
|||
*/
|
||||
private String vdef19ByIn;
|
||||
|
||||
private String vdef20;
|
||||
|
||||
public String getVdef20() {
|
||||
return vdef20;
|
||||
}
|
||||
|
||||
public void setVdef20(String vdef20) {
|
||||
this.vdef20 = vdef20;
|
||||
}
|
||||
|
||||
public String getCsaleids() {
|
||||
return csaleids;
|
||||
}
|
||||
|
|
|
@ -1268,13 +1268,16 @@ update so_saleorder_b set sts= 'N'
|
|||
</select>
|
||||
|
||||
<resultMap id="queryErrorDetailsIdResultMap" type="com.hzya.frame.plugin.lets.queryvo.ExtIntegrationTaskLivingDetailsQueryVo">
|
||||
<!--错误id -->
|
||||
<result property="errorId" column="errorId" />
|
||||
<result property="vdef19" column="vdef19" />
|
||||
<result property="vdef20" column="vdef20" />
|
||||
<result property="csale_bid" column="csale_bid" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryErrorDetailsId" parameterType="com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" resultMap="queryErrorDetailsIdResultMap">
|
||||
select
|
||||
d.vdef19 errorId
|
||||
d.vdef19,
|
||||
d.vdef20,
|
||||
d.csale_bid
|
||||
from so_saleorder_b a
|
||||
left join bd_invmandoc b on a.cinventoryid = b.pk_invmandoc and b.dr = 0
|
||||
left join bd_invbasdoc c on c.pk_invbasdoc = b.pk_invbasdoc
|
||||
|
@ -1290,6 +1293,9 @@ update so_saleorder_b set sts= 'N'
|
|||
<if test="cbiztype!=null and cbiztype!=''">
|
||||
and cbiztype = #{cbiztype}
|
||||
</if>
|
||||
<if test="csaleid!=null and csaleid!=''">
|
||||
and csaleid = #{csaleid}
|
||||
</if>
|
||||
)
|
||||
<if test="vdef19!=null and vdef19!=''">
|
||||
and d.vdef19 = #{vdef19}
|
||||
|
|
|
@ -16,17 +16,14 @@ import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDao;
|
|||
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao;
|
||||
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity;
|
||||
import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity;
|
||||
import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService;
|
||||
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
|
||||
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
|
||||
import com.hzya.frame.plugin.lets.queryvo.ExtIntegrationTaskLivingDetailsQueryVo;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.*;
|
||||
import com.hzya.frame.plugin.lets.util.*;
|
||||
import com.hzya.frame.split.SplitListByCountUtil;
|
||||
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
|
||||
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
@ -36,13 +33,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* OFS销售出库单(TOB)生成U8C销售订单
|
||||
*
|
||||
* @author makejava
|
||||
* @see com.hzya.frame.plugin.lets.plugin.sales.SoSaleReturnPluginInitializerToB TOB退货
|
||||
* @since 2024年8月12日 15:03:51
|
||||
*/
|
||||
public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
||||
|
@ -58,6 +54,9 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
@Autowired
|
||||
private ISoSaleDao iSoSaleDao;
|
||||
|
||||
@Autowired
|
||||
private ISoSaleorderBDao iSoSaleorderBDao;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
|
@ -116,10 +115,10 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
@Autowired
|
||||
private IBdSalestruDao iBdSalestruDao;
|
||||
|
||||
@Autowired
|
||||
private IBdCumandocDao iBdCumandocDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IBdDeptdocDao iBdDeptdocDao;
|
||||
|
||||
|
@ -144,6 +143,12 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
@Autowired
|
||||
private RdclUtil rdclUtil;
|
||||
|
||||
@Autowired
|
||||
private IIcGeneralHDao iIcGeneralHDao;
|
||||
|
||||
@Autowired
|
||||
private IIcGeneralBDao iIcGeneralBDao;
|
||||
|
||||
/**
|
||||
* 库存同步,按指定时间拉取
|
||||
*
|
||||
|
@ -562,6 +567,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
// saleorderRequestChildrenDto.setNoriginalcurtaxnetprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税净价
|
||||
saleorderRequestChildrenDto.setNoriginalcurtaxprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税单价
|
||||
saleorderRequestChildrenDto.setNtaxrate(new BigDecimal(bdTaxitemsEntity1.getTaxratio()).stripTrailingZeros().toPlainString());//税率
|
||||
// saleorderRequestChildrenDto.setVdef19(header.getCode());//原单单号
|
||||
saleorderRequestChildrenDto.setVdef20(detailsDto.getId());//原单明细主键
|
||||
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto);
|
||||
}
|
||||
//记录成功
|
||||
|
@ -617,7 +624,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private String createSuccessFulTradeDate(OrderOutTobHeaderDto orderOutTobHeaderDto) {
|
||||
private String createSuccessFulTradeDate(OrderOutTobHeaderDto orderOutTobHeaderDto) throws Exception {
|
||||
if (orderOutTobHeaderDto != null && orderOutTobHeaderDto.getHeader() != null && orderOutTobHeaderDto.getHeader().getTradeSuccessAt() != null) {
|
||||
HeaderDto header = orderOutTobHeaderDto.getHeader();
|
||||
String shipAt = header.getTradeSuccessAt();
|
||||
|
@ -630,8 +637,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
}
|
||||
return businessFormat;
|
||||
} else {
|
||||
logger.error("生成出库日期失败,或者tradeSuccessAt为空! json:{}", JSON.toJSON(orderOutTobHeaderDto));
|
||||
Assert.state(false, "生成出库日期失败,或者tradeSuccessAt为空! json:{}", JSON.toJSON(orderOutTobHeaderDto));
|
||||
logger.error("生成发票业务日期失败,或者tradeSuccessAt为空! json:{}", JSON.toJSON(orderOutTobHeaderDto));
|
||||
Assert.state(false, "生成发票业务日期失败,或者tradeSuccessAt为空! json:{}", JSON.toJSON(orderOutTobHeaderDto));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -651,7 +658,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
HeaderDto header = headerDetailsDto.getHeader();
|
||||
List<DetailsDto> details = headerDetailsDto.getDetails();
|
||||
|
||||
//根据销售出库单,查询得到销售订单
|
||||
//根据OFS销售出库单,查询得到OFS销售订单
|
||||
SaleOrderMessageDto saleOrderMessageDto = null;
|
||||
try {
|
||||
saleOrderMessageDto = afterSalesOrderUtil.getOfsOrder(header.getRefOrderCode());
|
||||
|
@ -970,18 +977,18 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
result = String.valueOf(jsonObject.get("attribute"));
|
||||
|
||||
boolean isSuccess = false;
|
||||
SoSaleResultRootDto soSaleResultRootDto = null;
|
||||
SoSaleResultRootDto saleinvoiceDto = null;
|
||||
if (result != null && !"".equals(result)) {
|
||||
ReusltStrDto reusltStrDto = JSON.parseObject(result, ReusltStrDto.class);
|
||||
if ("success".equals(reusltStrDto.getStatus())) {
|
||||
soSaleResultRootDto = resultDataHandle(reusltStrDto.getData());
|
||||
saleinvoiceDto = resultDataHandleV2(reusltStrDto.getData());
|
||||
isSuccess = true;
|
||||
}
|
||||
}
|
||||
if (!isSuccess) {
|
||||
Assert.state(false, "TOB业务O出库单推送U8C销售订单失败 接口返回结果:{}", result);
|
||||
}
|
||||
return soSaleResultRootDto;
|
||||
return saleinvoiceDto;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -989,7 +996,27 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private SoSaleResultRootDto resultDataHandle(String resultData) {
|
||||
private SaleinvoiceDto resultDataHandle(String resultData) {
|
||||
try {
|
||||
if (resultData != null && !"".equals(resultData)) {
|
||||
if (resultData.contains("[")) {
|
||||
resultData = resultData.substring(1, resultData.length() - 1);
|
||||
}
|
||||
return JSON.parseObject(resultData, SaleinvoiceDto.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("解析返回参数失败的错误", e);
|
||||
//如果解析失败,记录原因,但是不能影响结果的记录
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回结果解析处理,在确认了success后调用
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private SoSaleResultRootDto resultDataHandleV2(String resultData) {
|
||||
try {
|
||||
if (resultData != null && !"".equals(resultData)) {
|
||||
if (resultData.contains("[")) {
|
||||
|
@ -1078,8 +1105,52 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
List<SoSaleEntity> soSaleEntityList = iSoSaleDao.query(soSaleEntity);
|
||||
if (soSaleEntityList == null || soSaleEntityList.size() == 0) {
|
||||
Assert.state(false, "根据O出库单主键:{} 单号:{} 无法匹配到U8C销售订单(传到U8C可能失败了!)", header.getId(), header.getCode());
|
||||
} else if (soSaleEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据O出库单主键:{} 单号:{} 匹配到{}个U8C销售订单", header.getId(), header.getCode(), soSaleEntityList.size());
|
||||
}
|
||||
//TODO 测试
|
||||
// else if (soSaleEntityList.size() >= 2) {
|
||||
// Assert.state(false, "根据O出库单主键:{} 单号:{} 匹配到{}个U8C销售订单", header.getId(), header.getCode(), soSaleEntityList.size());
|
||||
// }
|
||||
|
||||
//查询销售订单明细行表体
|
||||
SoSaleorderBEntity soSaleorderBEntity = new SoSaleorderBEntity();
|
||||
soSaleorderBEntity.setDr(0L);
|
||||
soSaleorderBEntity.setCsaleid(soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
soSaleorderBEntity.setDataSourceCode("lets_u8c");
|
||||
List<SoSaleorderBEntity> soSaleorderBEntityList = iSoSaleorderBDao.query(soSaleorderBEntity);
|
||||
if (soSaleorderBEntityList == null || soSaleorderBEntityList.size() == 0) {
|
||||
Assert.state(false, "根据O销售订单主键:{},无法匹配到U8C销售订单明细行(传到U8C可能失败了!)", soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
} else if (soSaleorderBEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据O销售订单主键:{},无法匹配到U8C销售订单明细行(传到U8C可能失败了!)", soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
}
|
||||
|
||||
//查询U8C销售订单对应的销售出库单表头
|
||||
IcGeneralHEntity icGeneralHEntity = new IcGeneralHEntity();
|
||||
icGeneralHEntity.setCsourcebillhid(soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
icGeneralHEntity.setDr(0);
|
||||
icGeneralHEntity.setDataSourceCode("lets_u8c");
|
||||
List<IcGeneralHEntity> icGeneralHEntityList = iIcGeneralHDao.query(icGeneralHEntity);
|
||||
if (icGeneralHEntityList == null || icGeneralHEntityList.size() == 0) {
|
||||
Assert.state(false, "根据U8C销售订单表头id:{},无法查询到销售出库单", soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
} else if (icGeneralHEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据U8C销售订单表头id:{},查询到{}个销售出库单", soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid(), icGeneralHEntityList.size());
|
||||
}
|
||||
|
||||
//查询U8C销售订单对应的销售出库单表体
|
||||
IcGeneralBEntity icGeneralBEntity = new IcGeneralBEntity();
|
||||
icGeneralBEntity.setCsourcebillhid(soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
icGeneralBEntity.setDr(0);
|
||||
icGeneralBEntity.setDataSourceCode("lets_u8c");
|
||||
List<IcGeneralBEntity> icGeneralBEntityList = iIcGeneralBDao.query(icGeneralBEntity);
|
||||
if (icGeneralBEntityList == null || icGeneralBEntityList.size() == 0) {
|
||||
Assert.state(false, "根据U8C销售订单表头id:{},无法查询到销售出库单明细行", soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
}
|
||||
|
||||
//查询U8C销售订单执行情况明细表
|
||||
SoSaleorderBEntity soSaleorderBEntity1 = new SoSaleorderBEntity();
|
||||
soSaleorderBEntity1.setCsaleid(soSaleEntityList.get(soSaleEntityList.size() - 1).getCsaleid());
|
||||
List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos = iSoSaleorderBDao.queryErrorDetailsId(soSaleorderBEntity1);
|
||||
if (extIntegrationTaskLivingDetailsQueryVos == null || extIntegrationTaskLivingDetailsQueryVos.size() == 0) {
|
||||
Assert.state(false, "根据销售订单主键:{},无法匹配到销售订单执行情况明细");
|
||||
}
|
||||
|
||||
// 销售公司、发货公司
|
||||
|
@ -1179,40 +1250,40 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
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());
|
||||
Assert.state(false, "根据客商基本档案主键{},无法匹配到客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc());
|
||||
} else if (bdCumandocEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据客商基本档案主键{},匹配到{}哥客商管理档案", bdCubasdocEntityList.get(0).getPkCubasdoc(), bdCumandocEntityList.size());
|
||||
}
|
||||
|
||||
//查找平台
|
||||
// String platformZdyId = "0001A210000000000JUD";
|
||||
// String sourcePlatformCode = header.getSourcePlatformCode();
|
||||
// BdDefdocEntity bdDefdocEntity = new BdDefdocEntity();
|
||||
// bdDefdocEntity.setPkDefdoclist(platformZdyId);
|
||||
// bdDefdocEntity.setDr(0);
|
||||
// bdDefdocEntity.setDataSourceCode("lets_u8c");
|
||||
// bdDefdocEntity.setDoccode(sourcePlatformCode);
|
||||
// List<BdDefdocEntity> bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity);
|
||||
// if (bdDefdocEntityList.size() == 0) {
|
||||
// Assert.state(false, "根据O平台编码{},无法匹配到U8C平台自定义档案 自定义档案主键:{}", sourcePlatformCode, platformZdyId);
|
||||
// } else if (bdDefdocEntityList.size() >= 2) {
|
||||
// Assert.state(false, "根据O平台编码{},无法匹配到U8C平台自定义档案 自定义档案主键:{}", sourcePlatformCode, platformZdyId);
|
||||
// }
|
||||
String platformZdyId = "0001A210000000000JUD";
|
||||
String sourcePlatformCode = header.getSourcePlatformCode();
|
||||
BdDefdocEntity bdDefdocEntity = new BdDefdocEntity();
|
||||
bdDefdocEntity.setPkDefdoclist(platformZdyId);
|
||||
bdDefdocEntity.setDr(0);
|
||||
bdDefdocEntity.setDataSourceCode("lets_u8c");
|
||||
bdDefdocEntity.setDoccode(sourcePlatformCode);
|
||||
List<BdDefdocEntity> bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity);
|
||||
if (bdDefdocEntityList.size() == 0) {
|
||||
Assert.state(false, "根据O平台编码{},无法匹配到U8C平台自定义档案 自定义档案主键:{}", sourcePlatformCode, platformZdyId);
|
||||
} else if (bdDefdocEntityList.size() >= 2) {
|
||||
Assert.state(false, "根据O平台编码{},无法匹配到U8C平台自定义档案 自定义档案主键:{}", sourcePlatformCode, platformZdyId);
|
||||
}
|
||||
|
||||
//查询U8C店铺档案
|
||||
// String platformZdyId2 = "0001A210000000000XZX";
|
||||
// String ofsStoreCode = header.getStoreCode();
|
||||
// BdDefdocEntity bdDefdocEntity2 = new BdDefdocEntity();
|
||||
// bdDefdocEntity2.setPkDefdoclist(platformZdyId2);
|
||||
// bdDefdocEntity2.setDr(0);
|
||||
// bdDefdocEntity2.setDataSourceCode("lets_u8c");
|
||||
// bdDefdocEntity2.setDoccode(ofsStoreCode);
|
||||
// List<BdDefdocEntity> bdDefdocEntityList2 = iBdDefdocDao.query(bdDefdocEntity2);
|
||||
// if (bdDefdocEntityList2.size() == 0) {
|
||||
// Assert.state(false, "根据O店铺编码{},无法匹配到U8C店铺自定义档案 自定义档案主键:{}", ofsStoreCode, platformZdyId);
|
||||
// } else if (bdDefdocEntityList2.size() >= 2) {
|
||||
// Assert.state(false, "根据O店铺编码{},无法匹配到U8C店铺自定义档案 自定义档案主键:{}", ofsStoreCode, platformZdyId);
|
||||
// }
|
||||
//业务流程
|
||||
|
||||
String platformZdyId2 = "0001A210000000000XZX";
|
||||
String ofsStoreCode = header.getStoreCode();
|
||||
BdDefdocEntity bdDefdocEntity2 = new BdDefdocEntity();
|
||||
bdDefdocEntity2.setPkDefdoclist(platformZdyId2);
|
||||
bdDefdocEntity2.setDr(0);
|
||||
bdDefdocEntity2.setDataSourceCode("lets_u8c");
|
||||
bdDefdocEntity2.setDoccode(ofsStoreCode);
|
||||
List<BdDefdocEntity> bdDefdocEntityList2 = iBdDefdocDao.query(bdDefdocEntity2);
|
||||
if (bdDefdocEntityList2.size() == 0) {
|
||||
Assert.state(false, "根据O店铺编码{},无法匹配到U8C店铺自定义档案 自定义档案主键:{}", ofsStoreCode, platformZdyId);
|
||||
} else if (bdDefdocEntityList2.size() >= 2) {
|
||||
Assert.state(false, "根据O店铺编码{},无法匹配到U8C店铺自定义档案 自定义档案主键:{}", ofsStoreCode, platformZdyId);
|
||||
}
|
||||
|
||||
OrderOutTobHeaderDto orderOutTobHeaderDto = new OrderOutTobHeaderDto();
|
||||
orderOutTobHeaderDto.setBdCorpEntity(bdCorpEntityList.get(0));
|
||||
|
@ -1223,10 +1294,14 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
orderOutTobHeaderDto.setBdCumandocEntity(bdCumandocEntityList.get(0));
|
||||
orderOutTobHeaderDto.setBdCubasdocEntity(bdCubasdocEntityList.get(0));
|
||||
orderOutTobHeaderDto.setDeliverGoodsCorp(bdCorpEntityList.get(0));
|
||||
// orderOutTobHeaderDto.setPlatformArchives(bdDefdocEntityList.get(0));
|
||||
// orderOutTobHeaderDto.setShopArchives(bdDefdocEntityList2.get(0));
|
||||
orderOutTobHeaderDto.setPlatformArchives(bdDefdocEntityList.get(0));
|
||||
orderOutTobHeaderDto.setShopArchives(bdDefdocEntityList2.get(0));
|
||||
orderOutTobHeaderDto.setSaleOrderMessageDto(saleOrderMessageDto);
|
||||
orderOutTobHeaderDto.setSoSaleEntity(soSaleEntityList.get(0));
|
||||
orderOutTobHeaderDto.setSoSaleEntity(soSaleEntityList.get(soSaleEntityList.size() - 1));
|
||||
orderOutTobHeaderDto.setIcGeneralHEntity(icGeneralHEntityList.get(0));
|
||||
orderOutTobHeaderDto.setIcGeneralBEntityList(icGeneralBEntityList);
|
||||
orderOutTobHeaderDto.setSoSaleorderBEntityList(soSaleorderBEntityList);
|
||||
orderOutTobHeaderDto.setExtIntegrationTaskLivingDetailsQueryVos(extIntegrationTaskLivingDetailsQueryVos);
|
||||
|
||||
orderOutTobHeaderDto.setHeader(header);
|
||||
orderOutTobHeaderDto.setDetails(details);
|
||||
|
@ -1259,6 +1334,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
List<OrderOutTobHeaderDto> orderOutTobHeaderDtos = queryBasicArchivesSaleinvoice(headerDetailsDtoList);
|
||||
//查询U8C业务流程
|
||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow();
|
||||
// 查询销售收发类别
|
||||
BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("201");
|
||||
|
||||
logger.info("TOB销售业务交易成功同步,档案转换成功对应的数量:{}行需要进行数据转换", orderOutTobHeaderDtos.size());
|
||||
logger.info("TOB销售发票业务流程编码:{}", bdBusitypeEntity.getBusicode());
|
||||
|
@ -1272,7 +1349,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
BdCorpEntity bdCorpEntity = orderOutTobHeaderDto.getBdCorpEntity();
|
||||
//发货库存组织
|
||||
BdCalbodyEntity bdCalbodyEntity = orderOutTobHeaderDto.getBdCalbodyEntity();
|
||||
//入库参数
|
||||
//入库仓库
|
||||
BdStordocEntity bdStordocEntity = orderOutTobHeaderDto.getBdStordocEntity();
|
||||
//销售组织
|
||||
BdSalestruEntity bdSalestruEntity = orderOutTobHeaderDto.getBdSalestruEntity();
|
||||
|
@ -1292,6 +1369,14 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
BdDefdocEntity shopArchives = orderOutTobHeaderDto.getShopArchives();
|
||||
//U8C销售订单
|
||||
SoSaleEntity soSaleEntity = orderOutTobHeaderDto.getSoSaleEntity();
|
||||
//U8C销售订单明细行
|
||||
List<SoSaleorderBEntity> soSaleorderBEntityList = orderOutTobHeaderDto.getSoSaleorderBEntityList();
|
||||
//U8C销售出库单
|
||||
IcGeneralHEntity icGeneralHEntity = orderOutTobHeaderDto.getIcGeneralHEntity();
|
||||
//U8C销售出库单明细行
|
||||
List<IcGeneralBEntity> icGeneralBEntityList = orderOutTobHeaderDto.getIcGeneralBEntityList();
|
||||
//U8C销售订单执行情况明细表
|
||||
List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos = orderOutTobHeaderDto.getExtIntegrationTaskLivingDetailsQueryVos();
|
||||
|
||||
SalesInvoiceHeadDto salesInvoiceHeadDto = new SalesInvoiceHeadDto();
|
||||
salesInvoiceHeadDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
|
||||
|
@ -1302,9 +1387,23 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
salesInvoiceHeadDto.setPk_corp(bdCorpEntity.getPkCorp());
|
||||
salesInvoiceHeadDto.setDbilldate(successfulTradeDate);
|
||||
salesInvoiceHeadDto.setFinvoicetype("1");//不传默认为1
|
||||
salesInvoiceHeadDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//部门
|
||||
salesInvoiceHeadDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//仓库
|
||||
salesInvoiceHeadDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
|
||||
salesInvoiceHeadDto.setCreceiptcustomerid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
salesInvoiceHeadDto.setCreceipttype("32");//单据类型
|
||||
salesInvoiceHeadDto.setDmakedate(successfulTradeDate);//制单日期
|
||||
salesInvoiceHeadDto.setNdiscountrate("100");
|
||||
salesInvoiceHeadDto.setDapprovedate(successfulTradeDate);//审批日期
|
||||
salesInvoiceHeadDto.setVdef17(ProfilesActiveConstant.sourceSystem1);
|
||||
salesInvoiceHeadDto.setVdef19(header.getCode());
|
||||
salesInvoiceHeadDto.setVdef20(header.getId());
|
||||
//平台
|
||||
salesInvoiceHeadDto.setPk_defdoc2(platformArchives.getPkDefdoc());
|
||||
salesInvoiceHeadDto.setVdef2(platformArchives.getDocname());
|
||||
//店铺
|
||||
salesInvoiceHeadDto.setPk_defdoc1(shopArchives.getPkDefdoc());
|
||||
salesInvoiceHeadDto.setVdef1(shopArchives.getDocname());
|
||||
|
||||
List<SalesInvoiceBodyDto> salesInvoiceBodyDtoList = new ArrayList<>();
|
||||
for (int j = 0; j < details.size(); j++) {
|
||||
|
@ -1315,6 +1414,10 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
BdInvbasdocEntity bdInvbasdocEntity = queryStockBasicArchives(bdInvmandocEntity.getPkInvmandoc(), deliverGoodsCorp.getPkCorp());
|
||||
//根据存货基础档案编码,查询当前存货的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity1 = queryBdTaxitems(bdInvbasdocEntity.getInvcode());
|
||||
//查找来源单据,销售发票的来源单据为销售出库单
|
||||
IcGeneralBEntity sourceDocuments = findSourceDocuments(header, detailsDto, soSaleorderBEntityList, icGeneralBEntityList, extIntegrationTaskLivingDetailsQueryVos);
|
||||
//查找来源销售订单明细行
|
||||
SoSaleorderBEntity sourceDocumentsV2 = findSourceDocumentsV2(header, detailsDto, soSaleorderBEntityList, extIntegrationTaskLivingDetailsQueryVos);
|
||||
|
||||
BigDecimal noriginalcurtaxprice = null;//含税单价
|
||||
try {
|
||||
|
@ -1327,15 +1430,33 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
if (noriginalcurtaxprice == null) {
|
||||
isblargessflag = true;
|
||||
}
|
||||
|
||||
//TODO 测试
|
||||
detailsDto.setShipQty("1");
|
||||
SalesInvoiceBodyDto salesInvoiceBodyDto = new SalesInvoiceBodyDto();
|
||||
salesInvoiceBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());
|
||||
salesInvoiceBodyDto.setCupreceipttype("4C");
|
||||
salesInvoiceBodyDto.setCupsourcebillcode(soSaleEntity.getVreceiptcode());
|
||||
salesInvoiceBodyDto.setCupreceipttype("4C");//来源单据类型
|
||||
salesInvoiceBodyDto.setCupsourcebillcode(icGeneralHEntity.getVbillcode());//来源单据号
|
||||
salesInvoiceBodyDto.setNnumber(detailsDto.getShipQty());
|
||||
salesInvoiceBodyDto.setNoriginalcurtaxprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税单价
|
||||
salesInvoiceBodyDto.setNtaxrate(new BigDecimal(bdTaxitemsEntity1.getTaxratio()).stripTrailingZeros().toPlainString());//税率
|
||||
salesInvoiceBodyDto.setBlargessflag(isblargessflag);
|
||||
salesInvoiceBodyDto.setCoriginalbillcode(soSaleEntity.getVreceiptcode());//源头单据号
|
||||
salesInvoiceBodyDto.setCsourcebillbodyid(sourceDocumentsV2.getCorderBid());//源头单据明细行主键 (数据字典上是来源单据明细行主键,实际上是源头)
|
||||
salesInvoiceBodyDto.setCsourcebillid(soSaleEntity.getCsaleid());//源头单据主表主键(数据字典上是来源单据主表主键,实际上是源头)
|
||||
salesInvoiceBodyDto.setCupsourcebillbodyid(sourceDocuments.getCgeneralbid());//上层来源明细行主键
|
||||
salesInvoiceBodyDto.setCupsourcebillcode(icGeneralHEntity.getVbillcode());//直接来源单据号
|
||||
salesInvoiceBodyDto.setCupsourcebillid(icGeneralHEntity.getCgeneralhid());//来源主表主键
|
||||
// salesInvoiceBodyDto.setCbodywarehouseid("1009A2100000000002BV");//附表仓库
|
||||
// salesInvoiceBodyDto.setCcurrencytypeid("00010000000000000001");//原币
|
||||
// salesInvoiceBodyDto.setCcustomerid("0001A210000000002Q1E");//订单客户
|
||||
// salesInvoiceBodyDto.setCinvbasdocid("0001A210000000001GF0");//存货档案主键
|
||||
// salesInvoiceBodyDto.setCquoteunitid("0001A210000000000EYM");//报价计量单位
|
||||
// salesInvoiceBodyDto.setCreceiptcorpid("0001A210000000002Q1E");//收货单位
|
||||
// salesInvoiceBodyDto.setCreceipttype("30");//来源单据类型
|
||||
// salesInvoiceBodyDto.setCsaleid("1009A2100000000004WK");//销售主表id
|
||||
// salesInvoiceBodyDto.setCunitid("0001A210000000000EYM");//主计量单位
|
||||
// salesInvoiceBodyDto.setCupsourcebillbodyid("1009A2100000000004R3");//上层来源单据行
|
||||
|
||||
salesInvoiceBodyDtoList.add(salesInvoiceBodyDto);
|
||||
}
|
||||
SalesInvoiceDto salesInvoiceDto = new SalesInvoiceDto();
|
||||
|
@ -1349,8 +1470,13 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
stringListMap.put("billvos", salesInvoiceDtoList);
|
||||
|
||||
//推送到U8C
|
||||
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap));
|
||||
SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap));
|
||||
//成功
|
||||
if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) {
|
||||
SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo();
|
||||
List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo();
|
||||
logger.info("TOB销售发票生成成功 编码:{} 发票公司:{}", parentvo.getVreceiptcode(), parentvo.getPk_corp());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("OTOB的销售发票传输失败,抛出异常", e);
|
||||
//失败
|
||||
|
@ -1365,7 +1491,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
public SoSaleResultRootDto sendU8CTOCSoSaleinvoiceB(String param) throws Exception {
|
||||
public SaleinvoiceDto sendU8CTOCSoSaleinvoiceB(String param) throws Exception {
|
||||
long startLong = System.currentTimeMillis();
|
||||
logger.info("TOB销售发票推送开始,推送参数:" + param + ",U8C_URL:" + ProfilesActiveConstant.U8C_URL);
|
||||
String result = HttpRequest.post(ProfilesActiveConstant.U8C_URL).header("appId", "800037")//头信息,多个头信息多次调用此方法即可
|
||||
|
@ -1375,7 +1501,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
.body(param)//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
logger.info("TOB销售发票结束,返回参数:" + result);
|
||||
//2024年8月29日 17:56:50 如果http请求超时,则会抛给上层方法,上层方法会完成异常的捕捉
|
||||
logger.info("TOB销售发票推送结束,返回参数:" + result);
|
||||
long endLong = System.currentTimeMillis();
|
||||
logger.info("TOB销售发票接口请求耗时:" + (endLong - startLong));
|
||||
|
||||
|
@ -1383,7 +1510,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
result = String.valueOf(jsonObject.get("attribute"));
|
||||
|
||||
boolean isSuccess = false;
|
||||
SoSaleResultRootDto soSaleResultRootDto = null;
|
||||
SaleinvoiceDto soSaleResultRootDto = null;
|
||||
if (result != null && !"".equals(result)) {
|
||||
ReusltStrDto reusltStrDto = JSON.parseObject(result, ReusltStrDto.class);
|
||||
if ("success".equals(reusltStrDto.getStatus())) {
|
||||
|
@ -1396,4 +1523,84 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
}
|
||||
return soSaleResultRootDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找来源单据,销售发票的来源单据为销售出库单,生成TOB销售订单时,明细行传O的明细行主键,查找逻辑
|
||||
* O明细行主键 -> 定位到U8C销售订单明细行 -> 销售出库单明细行
|
||||
*
|
||||
* @param header O表头明细行
|
||||
* @param detailsDto O明细行
|
||||
* @param soSaleorderBEntityList U8C销售订单明细集合
|
||||
* @param icGeneralBEntityList U8C销售出库单明细集合
|
||||
* @param extIntegrationTaskLivingDetailsQueryVos U8C销售订单执行情况明细表
|
||||
* @author liuyang
|
||||
*/
|
||||
private IcGeneralBEntity findSourceDocuments(HeaderDto header, DetailsDto detailsDto, List<SoSaleorderBEntity> soSaleorderBEntityList, List<IcGeneralBEntity> icGeneralBEntityList, List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos) {
|
||||
Assert.notNull(header, "header不能为空");
|
||||
Assert.notNull(detailsDto, "detailsDto不能为空");
|
||||
Assert.notNull(soSaleorderBEntityList, "soSaleorderBEntityList不能为空");
|
||||
Assert.notNull(icGeneralBEntityList, "icGeneralBEntityList不能为空");
|
||||
Assert.notNull(extIntegrationTaskLivingDetailsQueryVos, "extIntegrationTaskLivingDetailsQueryVos不能为空");
|
||||
|
||||
ExtIntegrationTaskLivingDetailsQueryVo targetExtIntegrationTaskLivingDetailsQueryVo = null;
|
||||
for (int i = 0; i < extIntegrationTaskLivingDetailsQueryVos.size(); i++) {
|
||||
ExtIntegrationTaskLivingDetailsQueryVo extIntegrationTaskLivingDetailsQueryVo = extIntegrationTaskLivingDetailsQueryVos.get(i);
|
||||
if (extIntegrationTaskLivingDetailsQueryVo.getVdef20().equals(detailsDto.getId())) {
|
||||
targetExtIntegrationTaskLivingDetailsQueryVo = extIntegrationTaskLivingDetailsQueryVo;
|
||||
}
|
||||
}
|
||||
Assert.notNull(targetExtIntegrationTaskLivingDetailsQueryVo, "无法匹配到销售订单执行情况明细行,O明细行主键", detailsDto.getId());
|
||||
|
||||
SoSaleorderBEntity targetSoSaleorderBEntity = null;
|
||||
for (int i = 0; i < soSaleorderBEntityList.size(); i++) {
|
||||
SoSaleorderBEntity soSaleorderBEntity = soSaleorderBEntityList.get(i);
|
||||
if (targetExtIntegrationTaskLivingDetailsQueryVo.getCsale_bid().equals(soSaleorderBEntity.getCorderBid())) {
|
||||
targetSoSaleorderBEntity = soSaleorderBEntity;
|
||||
}
|
||||
}
|
||||
Assert.notNull(targetSoSaleorderBEntity, "根据O出库单明细主键:{},无法匹配到U8C销售订单明细行");
|
||||
|
||||
for (int i = 0; i < icGeneralBEntityList.size(); i++) {
|
||||
IcGeneralBEntity icGeneralBEntity = icGeneralBEntityList.get(i);
|
||||
if (icGeneralBEntity.getCsourcebillbid().equals(targetSoSaleorderBEntity.getCorderBid())) {
|
||||
return icGeneralBEntity;
|
||||
}
|
||||
}
|
||||
Assert.state(false, "根据销售订单明细行主键:{} 无法匹配到销售出库单明细行", targetSoSaleorderBEntity.getCorderBid());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找销售订单明细行
|
||||
*
|
||||
* @param header O表头明细行
|
||||
* @param detailsDto O明细行
|
||||
* @param soSaleorderBEntityList U8C销售订单明细集合
|
||||
* @author liuyang
|
||||
*/
|
||||
private SoSaleorderBEntity findSourceDocumentsV2(HeaderDto header, DetailsDto detailsDto, List<SoSaleorderBEntity> soSaleorderBEntityList, List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos) {
|
||||
Assert.notNull(header, "header不能为空");
|
||||
Assert.notNull(detailsDto, "detailsDto不能为空");
|
||||
Assert.notNull(soSaleorderBEntityList, "soSaleorderBEntityList不能为空");
|
||||
Assert.notNull(extIntegrationTaskLivingDetailsQueryVos, "extIntegrationTaskLivingDetailsQueryVos不能为空!");
|
||||
|
||||
ExtIntegrationTaskLivingDetailsQueryVo targetExtIntegrationTaskLivingDetailsQueryVo = null;
|
||||
for (int i = 0; i < extIntegrationTaskLivingDetailsQueryVos.size(); i++) {
|
||||
ExtIntegrationTaskLivingDetailsQueryVo extIntegrationTaskLivingDetailsQueryVo = extIntegrationTaskLivingDetailsQueryVos.get(i);
|
||||
if (extIntegrationTaskLivingDetailsQueryVo.getVdef20().equals(detailsDto.getId())) {
|
||||
targetExtIntegrationTaskLivingDetailsQueryVo = extIntegrationTaskLivingDetailsQueryVo;
|
||||
}
|
||||
}
|
||||
Assert.notNull(targetExtIntegrationTaskLivingDetailsQueryVo, "无法匹配到销售订单执行情况明细行,O明细行主键", detailsDto.getId());
|
||||
|
||||
SoSaleorderBEntity targetSoSaleorderBEntity = null;
|
||||
for (int i = 0; i < soSaleorderBEntityList.size(); i++) {
|
||||
SoSaleorderBEntity soSaleorderBEntity = soSaleorderBEntityList.get(i);
|
||||
if (targetExtIntegrationTaskLivingDetailsQueryVo.getCsale_bid().equals(soSaleorderBEntity.getCorderBid())) {
|
||||
targetSoSaleorderBEntity = soSaleorderBEntity;
|
||||
}
|
||||
}
|
||||
Assert.notNull(targetSoSaleorderBEntity, "根据O出库单明细主键:{},无法匹配到U8C销售订单明细行");
|
||||
return targetSoSaleorderBEntity;
|
||||
}
|
||||
}
|
|
@ -41,6 +41,7 @@ import java.util.*;
|
|||
* OFS售后入库单(TOB)生成U8C红字销售订单
|
||||
*
|
||||
* @author makejava
|
||||
* @see SoSaleOutPluginInitializerToB TOB销售
|
||||
* @since 2024年8月12日 15:03:51
|
||||
*/
|
||||
public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.hzya.frame.plugin.lets.queryvo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.queryvo
|
||||
|
@ -8,15 +10,9 @@ package com.hzya.frame.plugin.lets.queryvo;
|
|||
* @Date:2024/2/20 11:34
|
||||
* @Filename:ExtIntegrationTaskLivingDetailsQueryVo
|
||||
*/
|
||||
@Data
|
||||
public class ExtIntegrationTaskLivingDetailsQueryVo {
|
||||
|
||||
private String errorId;
|
||||
|
||||
public String getErrorId() {
|
||||
return errorId;
|
||||
}
|
||||
|
||||
public void setErrorId(String errorId) {
|
||||
this.errorId = errorId;
|
||||
}
|
||||
private String vdef19;
|
||||
private String vdef20;
|
||||
private String csale_bid;
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package com.hzya.frame.plugin.lets.u8cdto;
|
||||
|
||||
import com.hzya.frame.plugin.lets.entity.*;
|
||||
import com.hzya.frame.plugin.lets.queryvo.ExtIntegrationTaskLivingDetailsQueryVo;
|
||||
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
|
||||
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.u8cdto
|
||||
|
@ -86,4 +89,24 @@ public class OrderOutTobHeaderDto extends HeaderDetailsDto {
|
|||
* U8C销售订单
|
||||
*/
|
||||
private SoSaleEntity soSaleEntity;
|
||||
|
||||
/**
|
||||
* U8C销售出库单表头
|
||||
*/
|
||||
private IcGeneralHEntity icGeneralHEntity;
|
||||
|
||||
/**
|
||||
* U8C销售出库单明细行
|
||||
*/
|
||||
private List<IcGeneralBEntity> icGeneralBEntityList;
|
||||
|
||||
/**
|
||||
* U8C销售订单明细行
|
||||
*/
|
||||
private List<SoSaleorderBEntity> soSaleorderBEntityList;
|
||||
|
||||
/**
|
||||
* 执行情况自定义项
|
||||
*/
|
||||
private List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.hzya.frame.plugin.lets.u8cdto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.u8cdto
|
||||
* @Project:kangarooDataCenterV3
|
||||
* @name:SaleinvoiceHead
|
||||
* @Date:2024/8/29 17:38
|
||||
* @Filename:SaleinvoiceHead
|
||||
*/
|
||||
@Data
|
||||
public class SaleinvoiceBodyDto {
|
||||
private String cinventoryid;
|
||||
private String inventory_code;
|
||||
private String inventory_name;
|
||||
private String nnumber;
|
||||
private String noriginalcursummny;
|
||||
private String cunitid;
|
||||
private String unit_code;
|
||||
private String unit_name;
|
||||
private String csaleid;
|
||||
private String creceiptcorpid;
|
||||
private String ccalbodyid;
|
||||
private String advisecalbody_code;
|
||||
private String advisecalbody_name;
|
||||
private String cbodywarehouseid;
|
||||
private String warehouse_code;
|
||||
private String warehouse_name;
|
||||
private String cquoteunitid;
|
||||
private String quoteunit_code;
|
||||
private String quoteunit_name;
|
||||
private String blargessflag;
|
||||
private String noriginalcurprice;
|
||||
private String crowno;
|
||||
private String ntaxrate;
|
||||
private String noriginalcurtaxprice;
|
||||
private String noriginalcurmny;
|
||||
private String noriginalcurtaxmny;
|
||||
private String ndiscountrate;
|
||||
private String nitemdiscountrate;
|
||||
private String noriginalcurnetprice;
|
||||
private String noriginalcurtaxnetprice;
|
||||
private String noriginalcurdiscountmny;
|
||||
private String ccustomerid;
|
||||
private String ddeliverdate;
|
||||
private String cupreceipttype;
|
||||
private String cupsourcebillcode;
|
||||
private String nexchangeotobrate;
|
||||
private String coriginalbillcode;
|
||||
private String csourcebillbodyid;
|
||||
private String csourcebillid;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.plugin.lets.u8cdto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.u8cdto
|
||||
* @Project:kangarooDataCenterV3
|
||||
* @name:SaleinvoiceHead
|
||||
* @Date:2024/8/29 17:38
|
||||
* @Filename:SaleinvoiceHead
|
||||
*/
|
||||
@Data
|
||||
public class SaleinvoiceDto {
|
||||
private SaleinvoiceHeadDto parentvo;
|
||||
private List<SaleinvoiceBodyDto> childrenvo;
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.hzya.frame.plugin.lets.u8cdto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.plugin.lets.u8cdto
|
||||
* @Project:kangarooDataCenterV3
|
||||
* @name:SaleinvoiceHead
|
||||
* @Date:2024/8/29 17:38
|
||||
* @Filename:SaleinvoiceHead
|
||||
*/
|
||||
@Data
|
||||
public class SaleinvoiceHeadDto {
|
||||
private String pk_corp;
|
||||
private String corp_code;
|
||||
private String corp_name;
|
||||
private String cbiztype;
|
||||
private String biztype_code;
|
||||
private String biztype_name;
|
||||
private String creceiptcorpid;
|
||||
private String creceiptcorpid_code;
|
||||
private String creceiptcorpid_name;
|
||||
private String csalecorpid;
|
||||
private String salecorp_code;
|
||||
private String salecorp_name;
|
||||
private String ccalbodyid;
|
||||
private String calbody_code;
|
||||
private String calbody_name;
|
||||
private String coperatorid;
|
||||
private String operator_code;
|
||||
private String operator_name;
|
||||
private String cdeptid;
|
||||
private String dept_code;
|
||||
private String dept_name;
|
||||
private String vreceiptcode;
|
||||
private String dbilldate;
|
||||
private String dmakedate;
|
||||
private String dbilltime;
|
||||
private String dapprovedate;
|
||||
private String daudittime;
|
||||
private String dmoditime;
|
||||
private String capproveid;
|
||||
private String approver_code;
|
||||
private String approver_name;
|
||||
private String creceiptcustomerid;
|
||||
private String receiptcustomer_code;
|
||||
private String receiptcustomer_name;
|
||||
private String fstatus;
|
||||
private String ndiscountrate;
|
||||
private String cwarehouseid;
|
||||
private String warehouse_code;
|
||||
private String warehouse_name;
|
||||
private String csaleid;
|
||||
private String pk_defdoc1;
|
||||
private String vdef1;
|
||||
private String pk_defdoc2;
|
||||
private String vdef2;
|
||||
private String vdef17;
|
||||
private String vdef19;
|
||||
private String vdef20;
|
||||
private String cdispatcherid;
|
||||
private String cdispatcherid_code;
|
||||
private String cdispatcherid_name;
|
||||
private String nexchangeotobrate;
|
||||
private String ccurrencyid;
|
||||
private String ccurrencyid_code;
|
||||
private String ccurrencyid_name;
|
||||
private String ntotalsummny;
|
||||
private String nstrikemny;
|
||||
private String nnetmny;
|
||||
private String ntotalnum;
|
||||
private String finvoicetype;
|
||||
private String feinvstatus;
|
||||
}
|
|
@ -36,4 +36,17 @@ public class SalesInvoiceBodyDto {
|
|||
private String vdef1;
|
||||
private String vfree1;
|
||||
private String vsourcerowno;
|
||||
private String coriginalbillcode;
|
||||
private String csourcebillbodyid;
|
||||
private String csourcebillid;
|
||||
private String cupsourcebillbodyid;
|
||||
private String cupsourcebillid;
|
||||
private String cbodywarehouseid;
|
||||
private String ccurrencytypeid;
|
||||
private String ccustomerid;
|
||||
private String cinvbasdocid;
|
||||
private String creceiptcorpid;
|
||||
private String creceipttype;
|
||||
private String csaleid;
|
||||
private String cunitid;
|
||||
}
|
||||
|
|
|
@ -32,4 +32,11 @@ public class SalesInvoiceHeadDto {
|
|||
private String vdef20;
|
||||
private String vnote;
|
||||
private String vreceiptcode;
|
||||
private String pk_defdoc2;
|
||||
private String vdef2;
|
||||
private String cdispatcherid;
|
||||
private String creceiptcustomerid;
|
||||
private String creceipttype;
|
||||
private String dmakedate;
|
||||
private String dapprovedate;
|
||||
}
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class DetailsDto {
|
||||
|
||||
private String id;
|
||||
private String clientCode;
|
||||
private String companyCode;
|
||||
private String facilityCode;
|
||||
|
|
|
@ -66,6 +66,7 @@ public class HeaderDto {
|
|||
private String shipToCityName;
|
||||
private String shipToDistrictName;
|
||||
private String tradeSuccessAt;
|
||||
private String sourceOrderStatus;
|
||||
|
||||
/**
|
||||
* 发货日期
|
||||
|
|
Loading…
Reference in New Issue