调整TOC报错逻辑

This commit is contained in:
liuy 2024-08-09 22:38:29 +08:00
parent 27b03a6628
commit 6374eb91a8
25 changed files with 3198 additions and 216 deletions

View File

@ -0,0 +1,22 @@
package com.hzya.frame.plugin.lets.ofs.dao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* OFS售后入库单(tocofs_returngoods: table)表数据库访问层
*
* @author makejava
* @since 2024-08-09 11:08:40
*/
public interface ITocofsReturngoodsDao extends IBaseDao<TocofsReturngoodsEntity, String> {
/**
* 批量插入
*
* @author liuyang
*/
void entityInsertBatchV2(List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList) throws Exception;
}

View File

@ -0,0 +1,22 @@
package com.hzya.frame.plugin.lets.ofs.dao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import java.util.List;
/**
* root(tocofs_returngoods_detailed: table)表数据库访问层
*
* @author makejava
* @since 2024-08-09 13:45:47
*/
public interface ITocofsReturngoodsDetailedDao extends IBaseDao<TocofsReturngoodsDetailedEntity, String> {
/**
* 批量插入
*
* @author liuyang
*/
void entityInsertBatchV2(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsEntityList) throws Exception;
}

View File

@ -0,0 +1,22 @@
package com.hzya.frame.plugin.lets.ofs.dao.impl;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* OFS售后入库单(TocofsReturngoods)表数据库访问层
*
* @author makejava
* @since 2024-08-09 11:08:40
*/
public class TocofsReturngoodsDaoImpl extends MybatisGenericDao<TocofsReturngoodsEntity, String> implements ITocofsReturngoodsDao {
@Override
public void entityInsertBatchV2(List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList) throws Exception {
this.insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDaoImpl.entityInsertBatchV2", tocofsReturngoodsEntityList);
}
}

View File

@ -0,0 +1,22 @@
package com.hzya.frame.plugin.lets.ofs.dao.impl;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* root(TocofsReturngoodsDetailed)表数据库访问层
*
* @author makejava
* @since 2024-08-09 13:45:47
*/
public class TocofsReturngoodsDetailedDaoImpl extends MybatisGenericDao<TocofsReturngoodsDetailedEntity, String> implements ITocofsReturngoodsDetailedDao {
@Override
public void entityInsertBatchV2(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
this.insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertBatchV2", tocofsReturngoodsDetailedEntityList);
}
}

View File

@ -0,0 +1,445 @@
package com.hzya.frame.plugin.lets.ofs.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* root(TocofsReturngoodsDetailed)实体类
*
* @author makejava
* @since 2024-08-09 13:45:47
*/
public class TocofsReturngoodsDetailedEntity extends BaseEntity {
/**
* 81159
*/
private String receiptId;
/**
* LETS-RE2024071600000001
*/
private String receiptCode;
/**
* 128
*/
private String refOrderId;
/**
* 299
*/
private String refOrderDetailId;
/**
* LETS-SO2024070500000001
*/
private String sourceOrderCode;
/**
* LETS
*/
private String clientCode;
/**
* SHLZ
*/
private String companyCode;
/**
* intoyou-tmxs
*/
private String facilityCode;
/**
* 6973391730617
*/
private String skuCode;
/**
* INTOYOU心慕与你水感裸雾唇釉W01
*/
private String skuName;
/**
* 2
*/
private String requestQty;
/**
* 2
*/
private String receivedQty;
/**
* 0
*/
private String openQty;
/**
* EA
*/
private String quantityUM;
/**
* 0
*/
private String totalWeight;
/**
* 0
*/
private String totalVolume;
/**
* 0
*/
private String totalVolumeWeight;
/**
* 118
*/
private String totalAmount;
/**
* G
*/
private String weightUM;
/**
* CM3
*/
private String volumeUM;
/**
* AVAILABLE
*/
private String inventorySts;
/**
* 30796
*/
private String inTransInvId;
/**
* 0
*/
private String closed;
/**
* 2024-07-16 15:35:36
*/
private String created;
/**
* admin
*/
private String createdBy;
/**
* 2024-07-16 16:44:01
*/
private String lastUpdated;
/**
* api
*/
private String lastUpdatedBy;
/**
* 59
*/
private String discountPrice;
/**
* 报错内容
*/
private String newTransmitinfo;
/**
* 推送时间
*/
private String newPushdate;
/**
* 是否成功
*/
private String newState;
/**
* 下游系统编码
*/
private String newSystemNumber;
/**
* 下游系统主键
*/
private String newSystemPrimary;
/**
* 主表主键
*/
private String primaryKey;
/**
* 业务日期
*/
private String businessDate;
/**
* 主表主键
*/
private String returngoodsId;
public String getReceiptId() {
return receiptId;
}
public void setReceiptId(String receiptId) {
this.receiptId = receiptId;
}
public String getReceiptCode() {
return receiptCode;
}
public void setReceiptCode(String receiptCode) {
this.receiptCode = receiptCode;
}
public String getRefOrderId() {
return refOrderId;
}
public void setRefOrderId(String refOrderId) {
this.refOrderId = refOrderId;
}
public String getRefOrderDetailId() {
return refOrderDetailId;
}
public void setRefOrderDetailId(String refOrderDetailId) {
this.refOrderDetailId = refOrderDetailId;
}
public String getSourceOrderCode() {
return sourceOrderCode;
}
public void setSourceOrderCode(String sourceOrderCode) {
this.sourceOrderCode = sourceOrderCode;
}
public String getClientCode() {
return clientCode;
}
public void setClientCode(String clientCode) {
this.clientCode = clientCode;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getFacilityCode() {
return facilityCode;
}
public void setFacilityCode(String facilityCode) {
this.facilityCode = facilityCode;
}
public String getSkuCode() {
return skuCode;
}
public void setSkuCode(String skuCode) {
this.skuCode = skuCode;
}
public String getSkuName() {
return skuName;
}
public void setSkuName(String skuName) {
this.skuName = skuName;
}
public String getRequestQty() {
return requestQty;
}
public void setRequestQty(String requestQty) {
this.requestQty = requestQty;
}
public String getReceivedQty() {
return receivedQty;
}
public void setReceivedQty(String receivedQty) {
this.receivedQty = receivedQty;
}
public String getOpenQty() {
return openQty;
}
public void setOpenQty(String openQty) {
this.openQty = openQty;
}
public String getQuantityUM() {
return quantityUM;
}
public void setQuantityUM(String quantityUM) {
this.quantityUM = quantityUM;
}
public String getTotalWeight() {
return totalWeight;
}
public void setTotalWeight(String totalWeight) {
this.totalWeight = totalWeight;
}
public String getTotalVolume() {
return totalVolume;
}
public void setTotalVolume(String totalVolume) {
this.totalVolume = totalVolume;
}
public String getTotalVolumeWeight() {
return totalVolumeWeight;
}
public void setTotalVolumeWeight(String totalVolumeWeight) {
this.totalVolumeWeight = totalVolumeWeight;
}
public String getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(String totalAmount) {
this.totalAmount = totalAmount;
}
public String getWeightUM() {
return weightUM;
}
public void setWeightUM(String weightUM) {
this.weightUM = weightUM;
}
public String getVolumeUM() {
return volumeUM;
}
public void setVolumeUM(String volumeUM) {
this.volumeUM = volumeUM;
}
public String getInventorySts() {
return inventorySts;
}
public void setInventorySts(String inventorySts) {
this.inventorySts = inventorySts;
}
public String getInTransInvId() {
return inTransInvId;
}
public void setInTransInvId(String inTransInvId) {
this.inTransInvId = inTransInvId;
}
public String getClosed() {
return closed;
}
public void setClosed(String closed) {
this.closed = closed;
}
public String getCreated() {
return created;
}
public void setCreated(String created) {
this.created = created;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(String lastUpdated) {
this.lastUpdated = lastUpdated;
}
public String getLastUpdatedBy() {
return lastUpdatedBy;
}
public void setLastUpdatedBy(String lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}
public String getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(String discountPrice) {
this.discountPrice = discountPrice;
}
public String getNewTransmitinfo() {
return newTransmitinfo;
}
public void setNewTransmitinfo(String newTransmitinfo) {
this.newTransmitinfo = newTransmitinfo;
}
public String getNewPushdate() {
return newPushdate;
}
public void setNewPushdate(String newPushdate) {
this.newPushdate = newPushdate;
}
public String getNewState() {
return newState;
}
public void setNewState(String newState) {
this.newState = newState;
}
public String getNewSystemNumber() {
return newSystemNumber;
}
public void setNewSystemNumber(String newSystemNumber) {
this.newSystemNumber = newSystemNumber;
}
public String getNewSystemPrimary() {
return newSystemPrimary;
}
public void setNewSystemPrimary(String newSystemPrimary) {
this.newSystemPrimary = newSystemPrimary;
}
public String getPrimaryKey() {
return primaryKey;
}
public void setPrimaryKey(String primaryKey) {
this.primaryKey = primaryKey;
}
public String getBusinessDate() {
return businessDate;
}
public void setBusinessDate(String businessDate) {
this.businessDate = businessDate;
}
public String getReturngoodsId() {
return returngoodsId;
}
public void setReturngoodsId(String returngoodsId) {
this.returngoodsId = returngoodsId;
}
}

View File

@ -0,0 +1,526 @@
<?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.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl">
<resultMap id="get-TocofsReturngoodsDetailedEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="receiptId" column="receipt_id" jdbcType="VARCHAR"/>
<result property="receiptCode" column="receipt_code" jdbcType="VARCHAR"/>
<result property="refOrderId" column="ref_order_id" jdbcType="VARCHAR"/>
<result property="refOrderDetailId" column="ref_order_detail_id" jdbcType="VARCHAR"/>
<result property="sourceOrderCode" column="source_order_code" jdbcType="VARCHAR"/>
<result property="clientCode" column="client_code" jdbcType="VARCHAR"/>
<result property="companyCode" column="company_code" jdbcType="VARCHAR"/>
<result property="facilityCode" column="facility_code" jdbcType="VARCHAR"/>
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
<result property="skuName" column="sku_name" jdbcType="VARCHAR"/>
<result property="requestQty" column="request_qty" jdbcType="VARCHAR"/>
<result property="receivedQty" column="received_qty" jdbcType="VARCHAR"/>
<result property="openQty" column="open_qty" jdbcType="VARCHAR"/>
<result property="quantityUM" column="quantity_u_m" jdbcType="VARCHAR"/>
<result property="totalWeight" column="total_weight" jdbcType="VARCHAR"/>
<result property="totalVolume" column="total_volume" jdbcType="VARCHAR"/>
<result property="totalVolumeWeight" column="total_volume_weight" jdbcType="VARCHAR"/>
<result property="totalAmount" column="total_amount" jdbcType="VARCHAR"/>
<result property="weightUM" column="weight_u_m" jdbcType="VARCHAR"/>
<result property="volumeUM" column="volume_u_m" jdbcType="VARCHAR"/>
<result property="inventorySts" column="inventory_sts" jdbcType="VARCHAR"/>
<result property="inTransInvId" column="in_trans_inv_id" jdbcType="VARCHAR"/>
<result property="closed" column="closed" jdbcType="VARCHAR"/>
<result property="created" column="created" jdbcType="VARCHAR"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="lastUpdated" column="last_updated" jdbcType="VARCHAR"/>
<result property="lastUpdatedBy" column="last_updated_by" jdbcType="VARCHAR"/>
<result property="discountPrice" column="discount_price" jdbcType="VARCHAR"/>
<result property="newTransmitinfo" column="new_transmitInfo" jdbcType="VARCHAR"/>
<result property="newPushdate" column="new_pushDate" jdbcType="VARCHAR"/>
<result property="newState" column="new_state" jdbcType="VARCHAR"/>
<result property="newSystemNumber" column="new_system_number" jdbcType="VARCHAR"/>
<result property="newSystemPrimary" column="new_system_primary" jdbcType="VARCHAR"/>
<result property="primaryKey" column="primary_key" jdbcType="VARCHAR"/>
<result property="businessDate" column="business_date" jdbcType="VARCHAR"/>
<result property="returngoodsId" column="returngoods_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "TocofsReturngoodsDetailedEntity_Base_Column_List">
id
,receipt_id
,receipt_code
,ref_order_id
,ref_order_detail_id
,source_order_code
,client_code
,company_code
,facility_code
,sku_code
,sku_name
,request_qty
,received_qty
,open_qty
,quantity_u_m
,total_weight
,total_volume
,total_volume_weight
,total_amount
,weight_u_m
,volume_u_m
,inventory_sts
,in_trans_inv_id
,closed
,created
,created_by
,last_updated
,last_updated_by
,discount_price
,new_transmitInfo
,new_pushDate
,new_state
,new_system_number
,new_system_primary
,primary_key
,business_date
,returngoods_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-TocofsReturngoodsDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity">
select
<include refid="TocofsReturngoodsDetailedEntity_Base_Column_List" />
from tocofs_returngoods_detailed
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="receiptId != null and receiptId != ''"> and receipt_id = #{receiptId} </if>
<if test="receiptCode != null and receiptCode != ''"> and receipt_code = #{receiptCode} </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id = #{refOrderDetailId} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="skuName != null and skuName != ''"> and sku_name = #{skuName} </if>
<if test="requestQty != null and requestQty != ''"> and request_qty = #{requestQty} </if>
<if test="receivedQty != null and receivedQty != ''"> and received_qty = #{receivedQty} </if>
<if test="openQty != null and openQty != ''"> and open_qty = #{openQty} </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
<if test="inventorySts != null and inventorySts != ''"> and inventory_sts = #{inventorySts} </if>
<if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id = #{inTransInvId} </if>
<if test="closed != null and closed != ''"> and closed = #{closed} </if>
<if test="created != null and created != ''"> and created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
<if test="discountPrice != null and discountPrice != ''"> and discount_price = #{discountPrice} </if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo = #{newTransmitinfo} </if>
<if test="newPushdate != null and newPushdate != ''"> and new_pushDate = #{newPushdate} </if>
<if test="newState != null and newState != ''"> and new_state = #{newState} </if>
<if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number = #{newSystemNumber} </if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary = #{newSystemPrimary} </if>
<if test="primaryKey != null and primaryKey != ''"> and primary_key = #{primaryKey} </if>
<if test="businessDate != null and businessDate != ''"> and business_date = #{businessDate} </if>
<if test="returngoodsId != null and returngoodsId != ''"> and returngoods_id = #{returngoodsId} </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.ofs.entity.TocofsReturngoodsDetailedEntity">
select count(1) from tocofs_returngoods_detailed
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="receiptId != null and receiptId != ''"> and receipt_id = #{receiptId} </if>
<if test="receiptCode != null and receiptCode != ''"> and receipt_code = #{receiptCode} </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id = #{refOrderDetailId} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="skuName != null and skuName != ''"> and sku_name = #{skuName} </if>
<if test="requestQty != null and requestQty != ''"> and request_qty = #{requestQty} </if>
<if test="receivedQty != null and receivedQty != ''"> and received_qty = #{receivedQty} </if>
<if test="openQty != null and openQty != ''"> and open_qty = #{openQty} </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
<if test="inventorySts != null and inventorySts != ''"> and inventory_sts = #{inventorySts} </if>
<if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id = #{inTransInvId} </if>
<if test="closed != null and closed != ''"> and closed = #{closed} </if>
<if test="created != null and created != ''"> and created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
<if test="discountPrice != null and discountPrice != ''"> and discount_price = #{discountPrice} </if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo = #{newTransmitinfo} </if>
<if test="newPushdate != null and newPushdate != ''"> and new_pushDate = #{newPushdate} </if>
<if test="newState != null and newState != ''"> and new_state = #{newState} </if>
<if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number = #{newSystemNumber} </if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary = #{newSystemPrimary} </if>
<if test="primaryKey != null and primaryKey != ''"> and primary_key = #{primaryKey} </if>
<if test="businessDate != null and businessDate != ''"> and business_date = #{businessDate} </if>
<if test="returngoodsId != null and returngoodsId != ''"> and returngoods_id = #{returngoodsId} </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-TocofsReturngoodsDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity">
select
<include refid="TocofsReturngoodsDetailedEntity_Base_Column_List" />
from tocofs_returngoods_detailed
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="receiptId != null and receiptId != ''"> and receipt_id like concat('%',#{receiptId},'%') </if>
<if test="receiptCode != null and receiptCode != ''"> and receipt_code like concat('%',#{receiptCode},'%') </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id like concat('%',#{refOrderId},'%') </if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id like concat('%',#{refOrderDetailId},'%') </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code like concat('%',#{sourceOrderCode},'%') </if>
<if test="clientCode != null and clientCode != ''"> and client_code like concat('%',#{clientCode},'%') </if>
<if test="companyCode != null and companyCode != ''"> and company_code like concat('%',#{companyCode},'%') </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code like concat('%',#{facilityCode},'%') </if>
<if test="skuCode != null and skuCode != ''"> and sku_code like concat('%',#{skuCode},'%') </if>
<if test="skuName != null and skuName != ''"> and sku_name like concat('%',#{skuName},'%') </if>
<if test="requestQty != null and requestQty != ''"> and request_qty like concat('%',#{requestQty},'%') </if>
<if test="receivedQty != null and receivedQty != ''"> and received_qty like concat('%',#{receivedQty},'%') </if>
<if test="openQty != null and openQty != ''"> and open_qty like concat('%',#{openQty},'%') </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m like concat('%',#{quantityUM},'%') </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight like concat('%',#{totalWeight},'%') </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume like concat('%',#{totalVolume},'%') </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight like concat('%',#{totalVolumeWeight},'%') </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount like concat('%',#{totalAmount},'%') </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m like concat('%',#{weightUM},'%') </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m like concat('%',#{volumeUM},'%') </if>
<if test="inventorySts != null and inventorySts != ''"> and inventory_sts like concat('%',#{inventorySts},'%') </if>
<if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id like concat('%',#{inTransInvId},'%') </if>
<if test="closed != null and closed != ''"> and closed like concat('%',#{closed},'%') </if>
<if test="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
<if test="createdBy != null and createdBy != ''"> and created_by like concat('%',#{createdBy},'%') </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated like concat('%',#{lastUpdated},'%') </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by like concat('%',#{lastUpdatedBy},'%') </if>
<if test="discountPrice != null and discountPrice != ''"> and discount_price like concat('%',#{discountPrice},'%') </if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo like concat('%',#{newTransmitinfo},'%') </if>
<if test="newPushdate != null and newPushdate != ''"> and new_pushDate like concat('%',#{newPushdate},'%') </if>
<if test="newState != null and newState != ''"> and new_state like concat('%',#{newState},'%') </if>
<if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number like concat('%',#{newSystemNumber},'%') </if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary like concat('%',#{newSystemPrimary},'%') </if>
<if test="primaryKey != null and primaryKey != ''"> and primary_key like concat('%',#{primaryKey},'%') </if>
<if test="businessDate != null and businessDate != ''"> and business_date like concat('%',#{businessDate},'%') </if>
<if test="returngoodsId != null and returngoodsId != ''"> and returngoods_id like concat('%',#{returngoodsId},'%') </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="TocofsReturngoodsDetailedentity_list_or" resultMap="get-TocofsReturngoodsDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity">
select
<include refid="TocofsReturngoodsDetailedEntity_Base_Column_List" />
from tocofs_returngoods_detailed
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="receiptId != null and receiptId != ''"> or receipt_id = #{receiptId} </if>
<if test="receiptCode != null and receiptCode != ''"> or receipt_code = #{receiptCode} </if>
<if test="refOrderId != null and refOrderId != ''"> or ref_order_id = #{refOrderId} </if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> or ref_order_detail_id = #{refOrderDetailId} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> or source_order_code = #{sourceOrderCode} </if>
<if test="clientCode != null and clientCode != ''"> or client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> or company_code = #{companyCode} </if>
<if test="facilityCode != null and facilityCode != ''"> or facility_code = #{facilityCode} </if>
<if test="skuCode != null and skuCode != ''"> or sku_code = #{skuCode} </if>
<if test="skuName != null and skuName != ''"> or sku_name = #{skuName} </if>
<if test="requestQty != null and requestQty != ''"> or request_qty = #{requestQty} </if>
<if test="receivedQty != null and receivedQty != ''"> or received_qty = #{receivedQty} </if>
<if test="openQty != null and openQty != ''"> or open_qty = #{openQty} </if>
<if test="quantityUM != null and quantityUM != ''"> or quantity_u_m = #{quantityUM} </if>
<if test="totalWeight != null and totalWeight != ''"> or total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> or total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> or total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalAmount != null and totalAmount != ''"> or total_amount = #{totalAmount} </if>
<if test="weightUM != null and weightUM != ''"> or weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> or volume_u_m = #{volumeUM} </if>
<if test="inventorySts != null and inventorySts != ''"> or inventory_sts = #{inventorySts} </if>
<if test="inTransInvId != null and inTransInvId != ''"> or in_trans_inv_id = #{inTransInvId} </if>
<if test="closed != null and closed != ''"> or closed = #{closed} </if>
<if test="created != null and created != ''"> or created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> or created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> or last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> or last_updated_by = #{lastUpdatedBy} </if>
<if test="discountPrice != null and discountPrice != ''"> or discount_price = #{discountPrice} </if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> or new_transmitInfo = #{newTransmitinfo} </if>
<if test="newPushdate != null and newPushdate != ''"> or new_pushDate = #{newPushdate} </if>
<if test="newState != null and newState != ''"> or new_state = #{newState} </if>
<if test="newSystemNumber != null and newSystemNumber != ''"> or new_system_number = #{newSystemNumber} </if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> or new_system_primary = #{newSystemPrimary} </if>
<if test="primaryKey != null and primaryKey != ''"> or primary_key = #{primaryKey} </if>
<if test="businessDate != null and businessDate != ''"> or business_date = #{businessDate} </if>
<if test="returngoodsId != null and returngoodsId != ''"> or returngoods_id = #{returngoodsId} </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.ofs.entity.TocofsReturngoodsDetailedEntity" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_returngoods_detailed(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="receiptId != null and receiptId != ''"> receipt_id , </if>
<if test="receiptCode != null and receiptCode != ''"> receipt_code , </if>
<if test="refOrderId != null and refOrderId != ''"> ref_order_id , </if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> ref_order_detail_id , </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code , </if>
<if test="clientCode != null and clientCode != ''"> client_code , </if>
<if test="companyCode != null and companyCode != ''"> company_code , </if>
<if test="facilityCode != null and facilityCode != ''"> facility_code , </if>
<if test="skuCode != null and skuCode != ''"> sku_code , </if>
<if test="skuName != null and skuName != ''"> sku_name , </if>
<if test="requestQty != null and requestQty != ''"> request_qty , </if>
<if test="receivedQty != null and receivedQty != ''"> received_qty , </if>
<if test="openQty != null and openQty != ''"> open_qty , </if>
<if test="quantityUM != null and quantityUM != ''"> quantity_u_m , </if>
<if test="totalWeight != null and totalWeight != ''"> total_weight , </if>
<if test="totalVolume != null and totalVolume != ''"> total_volume , </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight , </if>
<if test="totalAmount != null and totalAmount != ''"> total_amount , </if>
<if test="weightUM != null and weightUM != ''"> weight_u_m , </if>
<if test="volumeUM != null and volumeUM != ''"> volume_u_m , </if>
<if test="inventorySts != null and inventorySts != ''"> inventory_sts , </if>
<if test="inTransInvId != null and inTransInvId != ''"> in_trans_inv_id , </if>
<if test="closed != null and closed != ''"> closed , </if>
<if test="created != null and created != ''"> created , </if>
<if test="createdBy != null and createdBy != ''"> created_by , </if>
<if test="lastUpdated != null and lastUpdated != ''"> last_updated , </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by , </if>
<if test="discountPrice != null and discountPrice != ''"> discount_price , </if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> new_transmitInfo , </if>
<if test="newPushdate != null and newPushdate != ''"> new_pushDate , </if>
<if test="newState != null and newState != ''"> new_state , </if>
<if test="newSystemNumber != null and newSystemNumber != ''"> new_system_number , </if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> new_system_primary , </if>
<if test="primaryKey != null and primaryKey != ''"> primary_key , </if>
<if test="businessDate != null and businessDate != ''"> business_date , </if>
<if test="returngoodsId != null and returngoodsId != ''"> returngoods_id , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="receiptId != null and receiptId != ''"> #{receiptId} ,</if>
<if test="receiptCode != null and receiptCode != ''"> #{receiptCode} ,</if>
<if test="refOrderId != null and refOrderId != ''"> #{refOrderId} ,</if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> #{refOrderDetailId} ,</if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> #{sourceOrderCode} ,</if>
<if test="clientCode != null and clientCode != ''"> #{clientCode} ,</if>
<if test="companyCode != null and companyCode != ''"> #{companyCode} ,</if>
<if test="facilityCode != null and facilityCode != ''"> #{facilityCode} ,</if>
<if test="skuCode != null and skuCode != ''"> #{skuCode} ,</if>
<if test="skuName != null and skuName != ''"> #{skuName} ,</if>
<if test="requestQty != null and requestQty != ''"> #{requestQty} ,</if>
<if test="receivedQty != null and receivedQty != ''"> #{receivedQty} ,</if>
<if test="openQty != null and openQty != ''"> #{openQty} ,</if>
<if test="quantityUM != null and quantityUM != ''"> #{quantityUM} ,</if>
<if test="totalWeight != null and totalWeight != ''"> #{totalWeight} ,</if>
<if test="totalVolume != null and totalVolume != ''"> #{totalVolume} ,</if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> #{totalVolumeWeight} ,</if>
<if test="totalAmount != null and totalAmount != ''"> #{totalAmount} ,</if>
<if test="weightUM != null and weightUM != ''"> #{weightUM} ,</if>
<if test="volumeUM != null and volumeUM != ''"> #{volumeUM} ,</if>
<if test="inventorySts != null and inventorySts != ''"> #{inventorySts} ,</if>
<if test="inTransInvId != null and inTransInvId != ''"> #{inTransInvId} ,</if>
<if test="closed != null and closed != ''"> #{closed} ,</if>
<if test="created != null and created != ''"> #{created} ,</if>
<if test="createdBy != null and createdBy != ''"> #{createdBy} ,</if>
<if test="lastUpdated != null and lastUpdated != ''"> #{lastUpdated} ,</if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> #{lastUpdatedBy} ,</if>
<if test="discountPrice != null and discountPrice != ''"> #{discountPrice} ,</if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> #{newTransmitinfo} ,</if>
<if test="newPushdate != null and newPushdate != ''"> #{newPushdate} ,</if>
<if test="newState != null and newState != ''"> #{newState} ,</if>
<if test="newSystemNumber != null and newSystemNumber != ''"> #{newSystemNumber} ,</if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> #{newSystemPrimary} ,</if>
<if test="primaryKey != null and primaryKey != ''"> #{primaryKey} ,</if>
<if test="businessDate != null and businessDate != ''"> #{businessDate} ,</if>
<if test="returngoodsId != null and returngoodsId != ''"> #{returngoodsId} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods_detailed a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date, returngoods_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.returngoodsId}, 'Y')
</foreach>
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatchV2" keyProperty="id" useGeneratedKeys="true">
insert IGNORE into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date, returngoods_id)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.returngoodsId})
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date, returngoods_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.returngoodsId})
</foreach>
on duplicate key update
receipt_id = values(receipt_id),
receipt_code = values(receipt_code),
ref_order_id = values(ref_order_id),
ref_order_detail_id = values(ref_order_detail_id),
source_order_code = values(source_order_code),
client_code = values(client_code),
company_code = values(company_code),
facility_code = values(facility_code),
sku_code = values(sku_code),
sku_name = values(sku_name),
request_qty = values(request_qty),
received_qty = values(received_qty),
open_qty = values(open_qty),
quantity_u_m = values(quantity_u_m),
total_weight = values(total_weight),
total_volume = values(total_volume),
total_volume_weight = values(total_volume_weight),
total_amount = values(total_amount),
weight_u_m = values(weight_u_m),
volume_u_m = values(volume_u_m),
inventory_sts = values(inventory_sts),
in_trans_inv_id = values(in_trans_inv_id),
closed = values(closed),
created = values(created),
created_by = values(created_by),
last_updated = values(last_updated),
last_updated_by = values(last_updated_by),
discount_price = values(discount_price),
new_transmitInfo = values(new_transmitInfo),
new_pushDate = values(new_pushDate),
new_state = values(new_state),
new_system_number = values(new_system_number),
new_system_primary = values(new_system_primary),
primary_key = values(primary_key),
business_date = values(business_date),
returngoods_id = values(returngoods_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
update tocofs_returngoods_detailed set
<trim suffix="" suffixOverrides=",">
<if test="receiptId != null and receiptId != ''"> receipt_id = #{receiptId},</if>
<if test="receiptCode != null and receiptCode != ''"> receipt_code = #{receiptCode},</if>
<if test="refOrderId != null and refOrderId != ''"> ref_order_id = #{refOrderId},</if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> ref_order_detail_id = #{refOrderDetailId},</if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code = #{sourceOrderCode},</if>
<if test="clientCode != null and clientCode != ''"> client_code = #{clientCode},</if>
<if test="companyCode != null and companyCode != ''"> company_code = #{companyCode},</if>
<if test="facilityCode != null and facilityCode != ''"> facility_code = #{facilityCode},</if>
<if test="skuCode != null and skuCode != ''"> sku_code = #{skuCode},</if>
<if test="skuName != null and skuName != ''"> sku_name = #{skuName},</if>
<if test="requestQty != null and requestQty != ''"> request_qty = #{requestQty},</if>
<if test="receivedQty != null and receivedQty != ''"> received_qty = #{receivedQty},</if>
<if test="openQty != null and openQty != ''"> open_qty = #{openQty},</if>
<if test="quantityUM != null and quantityUM != ''"> quantity_u_m = #{quantityUM},</if>
<if test="totalWeight != null and totalWeight != ''"> total_weight = #{totalWeight},</if>
<if test="totalVolume != null and totalVolume != ''"> total_volume = #{totalVolume},</if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight = #{totalVolumeWeight},</if>
<if test="totalAmount != null and totalAmount != ''"> total_amount = #{totalAmount},</if>
<if test="weightUM != null and weightUM != ''"> weight_u_m = #{weightUM},</if>
<if test="volumeUM != null and volumeUM != ''"> volume_u_m = #{volumeUM},</if>
<if test="inventorySts != null and inventorySts != ''"> inventory_sts = #{inventorySts},</if>
<if test="inTransInvId != null and inTransInvId != ''"> in_trans_inv_id = #{inTransInvId},</if>
<if test="closed != null and closed != ''"> closed = #{closed},</if>
<if test="created != null and created != ''"> created = #{created},</if>
<if test="createdBy != null and createdBy != ''"> created_by = #{createdBy},</if>
<if test="lastUpdated != null and lastUpdated != ''"> last_updated = #{lastUpdated},</if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by = #{lastUpdatedBy},</if>
<if test="discountPrice != null and discountPrice != ''"> discount_price = #{discountPrice},</if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> new_transmitInfo = #{newTransmitinfo},</if>
<if test="newPushdate != null and newPushdate != ''"> new_pushDate = #{newPushdate},</if>
<if test="newState != null and newState != ''"> new_state = #{newState},</if>
<if test="newSystemNumber != null and newSystemNumber != ''"> new_system_number = #{newSystemNumber},</if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> new_system_primary = #{newSystemPrimary},</if>
<if test="primaryKey != null and primaryKey != ''"> primary_key = #{primaryKey},</if>
<if test="businessDate != null and businessDate != ''"> business_date = #{businessDate},</if>
<if test="returngoodsId != null and returngoodsId != ''"> returngoods_id = #{returngoodsId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
update tocofs_returngoods_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
update tocofs_returngoods_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="receiptId != null and receiptId != ''"> and receipt_id = #{receiptId} </if>
<if test="receiptCode != null and receiptCode != ''"> and receipt_code = #{receiptCode} </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
<if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id = #{refOrderDetailId} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="skuName != null and skuName != ''"> and sku_name = #{skuName} </if>
<if test="requestQty != null and requestQty != ''"> and request_qty = #{requestQty} </if>
<if test="receivedQty != null and receivedQty != ''"> and received_qty = #{receivedQty} </if>
<if test="openQty != null and openQty != ''"> and open_qty = #{openQty} </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
<if test="inventorySts != null and inventorySts != ''"> and inventory_sts = #{inventorySts} </if>
<if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id = #{inTransInvId} </if>
<if test="closed != null and closed != ''"> and closed = #{closed} </if>
<if test="created != null and created != ''"> and created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
<if test="discountPrice != null and discountPrice != ''"> and discount_price = #{discountPrice} </if>
<if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo = #{newTransmitinfo} </if>
<if test="newPushdate != null and newPushdate != ''"> and new_pushDate = #{newPushdate} </if>
<if test="newState != null and newState != ''"> and new_state = #{newState} </if>
<if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number = #{newSystemNumber} </if>
<if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary = #{newSystemPrimary} </if>
<if test="primaryKey != null and primaryKey != ''"> and primary_key = #{primaryKey} </if>
<if test="businessDate != null and businessDate != ''"> and business_date = #{businessDate} </if>
<if test="returngoodsId != null and returngoodsId != ''"> and returngoods_id = #{returngoodsId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from tocofs_returngoods_detailed where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,603 @@
package com.hzya.frame.plugin.lets.ofs.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* OFS售后入库单(TocofsReturngoods)实体类
*
* @author makejava
* @since 2024-08-09 11:08:40
*/
public class TocofsReturngoodsEntity extends BaseEntity {
/**
* LETS
*/
private String clientCode;
/**
* SHLZ
*/
private String companyCode;
/**
* tm-intoyou
*/
private String storeCode;
/**
* intoyou-tmxs
*/
private String facilityCode;
/**
* LETS-RE2024071600000001
*/
private String code;
/**
* RETURN
*/
private String internalInstructionType;
/**
* B2C
*/
private String bizChannel;
/**
* 128
*/
private String refOrderId;
/**
* LETS-RO2024071600000001
*/
private String refOrderCode;
/**
* RETURN
*/
private String refOrderType;
/**
* 1
*/
private String closed;
/**
* api
*/
private String closedBy;
/**
* 900
*/
private String status;
/**
* 0
*/
private String allowOverReceive;
/**
* 张三
*/
private String shipFromAttentionTo;
/**
* 测试售后流程
*/
private String shipFromAddress;
/**
* 中国
*/
private String shipFromCountry;
/**
* 上海市
*/
private String shipFromState;
/**
* 上海市
*/
private String shipFromCity;
/**
* 金山区
*/
private String shipFromDistrict;
/**
* 17878787878
*/
private String shipFromMobile;
/**
* 2
*/
private String totalLines;
/**
* 4
*/
private String totalQty;
/**
* 236
*/
private String totalAmount;
/**
* 0
*/
private String totalWeight;
/**
* 0
*/
private String totalVolume;
/**
* 0
*/
private String totalVolumeWeight;
/**
* 236
*/
private String totalFulfillAmount;
/**
* 0
*/
private String totalFulfillWeight;
/**
* 0
*/
private String totalFulfillVolume;
/**
* 0
*/
private String totalFulfillVolumeWeight;
/**
* 4
*/
private String totalFulfillQty;
/**
* 0
*/
private String totalCases;
/**
* 0
*/
private String totalContainers;
/**
* 0
*/
private String closeAtQty;
/**
* EA
*/
private String quantityUM;
/**
* G
*/
private String weightUM;
/**
* CM3
*/
private String volumeUM;
/**
* 2024-07-16 16:44:00
*/
private String checkInFrom;
/**
* 2024-07-16 16:44:01
*/
private String checkInTo;
/**
* 2024-07-16 16:44:01
*/
private String closedAt;
/**
* OFS
*/
private String sourcePlatformCode;
/**
* LETS-SO2024070500000001
*/
private String sourceOrderCode;
/**
* 2024-07-16 15:35:36
*/
private String created;
/**
* admin
*/
private String createdBy;
/**
* 2024-07-16 16:44:01
*/
private String lastUpdated;
/**
* api
*/
private String lastUpdatedBy;
/**
* YT7478903028607
*/
private String returnWaybillCode;
/**
* YTO
*/
private String returnCarrier;
public String getClientCode() {
return clientCode;
}
public void setClientCode(String clientCode) {
this.clientCode = clientCode;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getFacilityCode() {
return facilityCode;
}
public void setFacilityCode(String facilityCode) {
this.facilityCode = facilityCode;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getInternalInstructionType() {
return internalInstructionType;
}
public void setInternalInstructionType(String internalInstructionType) {
this.internalInstructionType = internalInstructionType;
}
public String getBizChannel() {
return bizChannel;
}
public void setBizChannel(String bizChannel) {
this.bizChannel = bizChannel;
}
public String getRefOrderId() {
return refOrderId;
}
public void setRefOrderId(String refOrderId) {
this.refOrderId = refOrderId;
}
public String getRefOrderCode() {
return refOrderCode;
}
public void setRefOrderCode(String refOrderCode) {
this.refOrderCode = refOrderCode;
}
public String getRefOrderType() {
return refOrderType;
}
public void setRefOrderType(String refOrderType) {
this.refOrderType = refOrderType;
}
public String getClosed() {
return closed;
}
public void setClosed(String closed) {
this.closed = closed;
}
public String getClosedBy() {
return closedBy;
}
public void setClosedBy(String closedBy) {
this.closedBy = closedBy;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getAllowOverReceive() {
return allowOverReceive;
}
public void setAllowOverReceive(String allowOverReceive) {
this.allowOverReceive = allowOverReceive;
}
public String getShipFromAttentionTo() {
return shipFromAttentionTo;
}
public void setShipFromAttentionTo(String shipFromAttentionTo) {
this.shipFromAttentionTo = shipFromAttentionTo;
}
public String getShipFromAddress() {
return shipFromAddress;
}
public void setShipFromAddress(String shipFromAddress) {
this.shipFromAddress = shipFromAddress;
}
public String getShipFromCountry() {
return shipFromCountry;
}
public void setShipFromCountry(String shipFromCountry) {
this.shipFromCountry = shipFromCountry;
}
public String getShipFromState() {
return shipFromState;
}
public void setShipFromState(String shipFromState) {
this.shipFromState = shipFromState;
}
public String getShipFromCity() {
return shipFromCity;
}
public void setShipFromCity(String shipFromCity) {
this.shipFromCity = shipFromCity;
}
public String getShipFromDistrict() {
return shipFromDistrict;
}
public void setShipFromDistrict(String shipFromDistrict) {
this.shipFromDistrict = shipFromDistrict;
}
public String getShipFromMobile() {
return shipFromMobile;
}
public void setShipFromMobile(String shipFromMobile) {
this.shipFromMobile = shipFromMobile;
}
public String getTotalLines() {
return totalLines;
}
public void setTotalLines(String totalLines) {
this.totalLines = totalLines;
}
public String getTotalQty() {
return totalQty;
}
public void setTotalQty(String totalQty) {
this.totalQty = totalQty;
}
public String getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(String totalAmount) {
this.totalAmount = totalAmount;
}
public String getTotalWeight() {
return totalWeight;
}
public void setTotalWeight(String totalWeight) {
this.totalWeight = totalWeight;
}
public String getTotalVolume() {
return totalVolume;
}
public void setTotalVolume(String totalVolume) {
this.totalVolume = totalVolume;
}
public String getTotalVolumeWeight() {
return totalVolumeWeight;
}
public void setTotalVolumeWeight(String totalVolumeWeight) {
this.totalVolumeWeight = totalVolumeWeight;
}
public String getTotalFulfillAmount() {
return totalFulfillAmount;
}
public void setTotalFulfillAmount(String totalFulfillAmount) {
this.totalFulfillAmount = totalFulfillAmount;
}
public String getTotalFulfillWeight() {
return totalFulfillWeight;
}
public void setTotalFulfillWeight(String totalFulfillWeight) {
this.totalFulfillWeight = totalFulfillWeight;
}
public String getTotalFulfillVolume() {
return totalFulfillVolume;
}
public void setTotalFulfillVolume(String totalFulfillVolume) {
this.totalFulfillVolume = totalFulfillVolume;
}
public String getTotalFulfillVolumeWeight() {
return totalFulfillVolumeWeight;
}
public void setTotalFulfillVolumeWeight(String totalFulfillVolumeWeight) {
this.totalFulfillVolumeWeight = totalFulfillVolumeWeight;
}
public String getTotalFulfillQty() {
return totalFulfillQty;
}
public void setTotalFulfillQty(String totalFulfillQty) {
this.totalFulfillQty = totalFulfillQty;
}
public String getTotalCases() {
return totalCases;
}
public void setTotalCases(String totalCases) {
this.totalCases = totalCases;
}
public String getTotalContainers() {
return totalContainers;
}
public void setTotalContainers(String totalContainers) {
this.totalContainers = totalContainers;
}
public String getCloseAtQty() {
return closeAtQty;
}
public void setCloseAtQty(String closeAtQty) {
this.closeAtQty = closeAtQty;
}
public String getQuantityUM() {
return quantityUM;
}
public void setQuantityUM(String quantityUM) {
this.quantityUM = quantityUM;
}
public String getWeightUM() {
return weightUM;
}
public void setWeightUM(String weightUM) {
this.weightUM = weightUM;
}
public String getVolumeUM() {
return volumeUM;
}
public void setVolumeUM(String volumeUM) {
this.volumeUM = volumeUM;
}
public String getCheckInFrom() {
return checkInFrom;
}
public void setCheckInFrom(String checkInFrom) {
this.checkInFrom = checkInFrom;
}
public String getCheckInTo() {
return checkInTo;
}
public void setCheckInTo(String checkInTo) {
this.checkInTo = checkInTo;
}
public String getClosedAt() {
return closedAt;
}
public void setClosedAt(String closedAt) {
this.closedAt = closedAt;
}
public String getSourcePlatformCode() {
return sourcePlatformCode;
}
public void setSourcePlatformCode(String sourcePlatformCode) {
this.sourcePlatformCode = sourcePlatformCode;
}
public String getSourceOrderCode() {
return sourceOrderCode;
}
public void setSourceOrderCode(String sourceOrderCode) {
this.sourceOrderCode = sourceOrderCode;
}
public String getCreated() {
return created;
}
public void setCreated(String created) {
this.created = created;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(String lastUpdated) {
this.lastUpdated = lastUpdated;
}
public String getLastUpdatedBy() {
return lastUpdatedBy;
}
public void setLastUpdatedBy(String lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}
public String getReturnWaybillCode() {
return returnWaybillCode;
}
public void setReturnWaybillCode(String returnWaybillCode) {
this.returnWaybillCode = returnWaybillCode;
}
public String getReturnCarrier() {
return returnCarrier;
}
public void setReturnCarrier(String returnCarrier) {
this.returnCarrier = returnCarrier;
}
}

View File

@ -0,0 +1,670 @@
<?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.ofs.dao.impl.TocofsReturngoodsDaoImpl">
<resultMap id="get-TocofsReturngoodsEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="clientCode" column="client_code" jdbcType="VARCHAR"/>
<result property="companyCode" column="company_code" jdbcType="VARCHAR"/>
<result property="storeCode" column="store_code" jdbcType="VARCHAR"/>
<result property="facilityCode" column="facility_code" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="internalInstructionType" column="internal_instruction_type" jdbcType="VARCHAR"/>
<result property="bizChannel" column="biz_channel" jdbcType="VARCHAR"/>
<result property="refOrderId" column="ref_order_id" jdbcType="VARCHAR"/>
<result property="refOrderCode" column="ref_order_code" jdbcType="VARCHAR"/>
<result property="refOrderType" column="ref_order_type" jdbcType="VARCHAR"/>
<result property="closed" column="closed" jdbcType="VARCHAR"/>
<result property="closedBy" column="closed_by" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="allowOverReceive" column="allow_over_receive" jdbcType="VARCHAR"/>
<result property="shipFromAttentionTo" column="ship_from_attention_to" jdbcType="VARCHAR"/>
<result property="shipFromAddress" column="ship_from_address" jdbcType="VARCHAR"/>
<result property="shipFromCountry" column="ship_from_country" jdbcType="VARCHAR"/>
<result property="shipFromState" column="ship_from_state" jdbcType="VARCHAR"/>
<result property="shipFromCity" column="ship_from_city" jdbcType="VARCHAR"/>
<result property="shipFromDistrict" column="ship_from_district" jdbcType="VARCHAR"/>
<result property="shipFromMobile" column="ship_from_mobile" jdbcType="VARCHAR"/>
<result property="totalLines" column="total_lines" jdbcType="VARCHAR"/>
<result property="totalQty" column="total_qty" jdbcType="VARCHAR"/>
<result property="totalAmount" column="total_amount" jdbcType="VARCHAR"/>
<result property="totalWeight" column="total_weight" jdbcType="VARCHAR"/>
<result property="totalVolume" column="total_volume" jdbcType="VARCHAR"/>
<result property="totalVolumeWeight" column="total_volume_weight" jdbcType="VARCHAR"/>
<result property="totalFulfillAmount" column="total_fulfill_amount" jdbcType="VARCHAR"/>
<result property="totalFulfillWeight" column="total_fulfill_weight" jdbcType="VARCHAR"/>
<result property="totalFulfillVolume" column="total_fulfill_volume" jdbcType="VARCHAR"/>
<result property="totalFulfillVolumeWeight" column="total_fulfill_volume_weight" jdbcType="VARCHAR"/>
<result property="totalFulfillQty" column="total_fulfill_qty" jdbcType="VARCHAR"/>
<result property="totalCases" column="total_cases" jdbcType="VARCHAR"/>
<result property="totalContainers" column="total_containers" jdbcType="VARCHAR"/>
<result property="closeAtQty" column="close_at_qty" jdbcType="VARCHAR"/>
<result property="quantityUM" column="quantity_u_m" jdbcType="VARCHAR"/>
<result property="weightUM" column="weight_u_m" jdbcType="VARCHAR"/>
<result property="volumeUM" column="volume_u_m" jdbcType="VARCHAR"/>
<result property="checkInFrom" column="check_in_from" jdbcType="VARCHAR"/>
<result property="checkInTo" column="check_in_to" jdbcType="VARCHAR"/>
<result property="closedAt" column="closed_at" jdbcType="VARCHAR"/>
<result property="sourcePlatformCode" column="source_platform_code" jdbcType="VARCHAR"/>
<result property="sourceOrderCode" column="source_order_code" jdbcType="VARCHAR"/>
<result property="created" column="created" jdbcType="VARCHAR"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="lastUpdated" column="last_updated" jdbcType="VARCHAR"/>
<result property="lastUpdatedBy" column="last_updated_by" jdbcType="VARCHAR"/>
<result property="returnWaybillCode" column="return_waybill_code" jdbcType="VARCHAR"/>
<result property="returnCarrier" column="return_carrier" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "TocofsReturngoodsEntity_Base_Column_List">
id
,client_code
,company_code
,store_code
,facility_code
,code
,internal_instruction_type
,biz_channel
,ref_order_id
,ref_order_code
,ref_order_type
,closed
,closed_by
,status
,allow_over_receive
,ship_from_attention_to
,ship_from_address
,ship_from_country
,ship_from_state
,ship_from_city
,ship_from_district
,ship_from_mobile
,total_lines
,total_qty
,total_amount
,total_weight
,total_volume
,total_volume_weight
,total_fulfill_amount
,total_fulfill_weight
,total_fulfill_volume
,total_fulfill_volume_weight
,total_fulfill_qty
,total_cases
,total_containers
,close_at_qty
,quantity_u_m
,weight_u_m
,volume_u_m
,check_in_from
,check_in_to
,closed_at
,source_platform_code
,source_order_code
,created
,created_by
,last_updated
,last_updated_by
,return_waybill_code
,return_carrier
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
select
<include refid="TocofsReturngoodsEntity_Base_Column_List" />
from tocofs_returngoods
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type = #{internalInstructionType} </if>
<if test="bizChannel != null and bizChannel != ''"> and biz_channel = #{bizChannel} </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
<if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code = #{refOrderCode} </if>
<if test="refOrderType != null and refOrderType != ''"> and ref_order_type = #{refOrderType} </if>
<if test="closed != null and closed != ''"> and closed = #{closed} </if>
<if test="closedBy != null and closedBy != ''"> and closed_by = #{closedBy} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive = #{allowOverReceive} </if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to = #{shipFromAttentionTo} </if>
<if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address = #{shipFromAddress} </if>
<if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country = #{shipFromCountry} </if>
<if test="shipFromState != null and shipFromState != ''"> and ship_from_state = #{shipFromState} </if>
<if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city = #{shipFromCity} </if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district = #{shipFromDistrict} </if>
<if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile = #{shipFromMobile} </if>
<if test="totalLines != null and totalLines != ''"> and total_lines = #{totalLines} </if>
<if test="totalQty != null and totalQty != ''"> and total_qty = #{totalQty} </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount = #{totalFulfillAmount} </if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight = #{totalFulfillWeight} </if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume = #{totalFulfillVolume} </if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty = #{totalFulfillQty} </if>
<if test="totalCases != null and totalCases != ''"> and total_cases = #{totalCases} </if>
<if test="totalContainers != null and totalContainers != ''"> and total_containers = #{totalContainers} </if>
<if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty = #{closeAtQty} </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
<if test="checkInFrom != null and checkInFrom != ''"> and check_in_from = #{checkInFrom} </if>
<if test="checkInTo != null and checkInTo != ''"> and check_in_to = #{checkInTo} </if>
<if test="closedAt != null and closedAt != ''"> and closed_at = #{closedAt} </if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code = #{sourcePlatformCode} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
<if test="created != null and created != ''"> and created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code = #{returnWaybillCode} </if>
<if test="returnCarrier != null and returnCarrier != ''"> and return_carrier = #{returnCarrier} </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.ofs.entity.TocofsReturngoodsEntity">
select count(1) from tocofs_returngoods
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type = #{internalInstructionType} </if>
<if test="bizChannel != null and bizChannel != ''"> and biz_channel = #{bizChannel} </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
<if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code = #{refOrderCode} </if>
<if test="refOrderType != null and refOrderType != ''"> and ref_order_type = #{refOrderType} </if>
<if test="closed != null and closed != ''"> and closed = #{closed} </if>
<if test="closedBy != null and closedBy != ''"> and closed_by = #{closedBy} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive = #{allowOverReceive} </if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to = #{shipFromAttentionTo} </if>
<if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address = #{shipFromAddress} </if>
<if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country = #{shipFromCountry} </if>
<if test="shipFromState != null and shipFromState != ''"> and ship_from_state = #{shipFromState} </if>
<if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city = #{shipFromCity} </if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district = #{shipFromDistrict} </if>
<if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile = #{shipFromMobile} </if>
<if test="totalLines != null and totalLines != ''"> and total_lines = #{totalLines} </if>
<if test="totalQty != null and totalQty != ''"> and total_qty = #{totalQty} </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount = #{totalFulfillAmount} </if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight = #{totalFulfillWeight} </if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume = #{totalFulfillVolume} </if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty = #{totalFulfillQty} </if>
<if test="totalCases != null and totalCases != ''"> and total_cases = #{totalCases} </if>
<if test="totalContainers != null and totalContainers != ''"> and total_containers = #{totalContainers} </if>
<if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty = #{closeAtQty} </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
<if test="checkInFrom != null and checkInFrom != ''"> and check_in_from = #{checkInFrom} </if>
<if test="checkInTo != null and checkInTo != ''"> and check_in_to = #{checkInTo} </if>
<if test="closedAt != null and closedAt != ''"> and closed_at = #{closedAt} </if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code = #{sourcePlatformCode} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
<if test="created != null and created != ''"> and created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code = #{returnWaybillCode} </if>
<if test="returnCarrier != null and returnCarrier != ''"> and return_carrier = #{returnCarrier} </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-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
select
<include refid="TocofsReturngoodsEntity_Base_Column_List" />
from tocofs_returngoods
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="clientCode != null and clientCode != ''"> and client_code like concat('%',#{clientCode},'%') </if>
<if test="companyCode != null and companyCode != ''"> and company_code like concat('%',#{companyCode},'%') </if>
<if test="storeCode != null and storeCode != ''"> and store_code like concat('%',#{storeCode},'%') </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code like concat('%',#{facilityCode},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type like concat('%',#{internalInstructionType},'%') </if>
<if test="bizChannel != null and bizChannel != ''"> and biz_channel like concat('%',#{bizChannel},'%') </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id like concat('%',#{refOrderId},'%') </if>
<if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code like concat('%',#{refOrderCode},'%') </if>
<if test="refOrderType != null and refOrderType != ''"> and ref_order_type like concat('%',#{refOrderType},'%') </if>
<if test="closed != null and closed != ''"> and closed like concat('%',#{closed},'%') </if>
<if test="closedBy != null and closedBy != ''"> and closed_by like concat('%',#{closedBy},'%') </if>
<if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
<if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive like concat('%',#{allowOverReceive},'%') </if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to like concat('%',#{shipFromAttentionTo},'%') </if>
<if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address like concat('%',#{shipFromAddress},'%') </if>
<if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country like concat('%',#{shipFromCountry},'%') </if>
<if test="shipFromState != null and shipFromState != ''"> and ship_from_state like concat('%',#{shipFromState},'%') </if>
<if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city like concat('%',#{shipFromCity},'%') </if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district like concat('%',#{shipFromDistrict},'%') </if>
<if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile like concat('%',#{shipFromMobile},'%') </if>
<if test="totalLines != null and totalLines != ''"> and total_lines like concat('%',#{totalLines},'%') </if>
<if test="totalQty != null and totalQty != ''"> and total_qty like concat('%',#{totalQty},'%') </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount like concat('%',#{totalAmount},'%') </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight like concat('%',#{totalWeight},'%') </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume like concat('%',#{totalVolume},'%') </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight like concat('%',#{totalVolumeWeight},'%') </if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount like concat('%',#{totalFulfillAmount},'%') </if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight like concat('%',#{totalFulfillWeight},'%') </if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume like concat('%',#{totalFulfillVolume},'%') </if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight like concat('%',#{totalFulfillVolumeWeight},'%') </if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty like concat('%',#{totalFulfillQty},'%') </if>
<if test="totalCases != null and totalCases != ''"> and total_cases like concat('%',#{totalCases},'%') </if>
<if test="totalContainers != null and totalContainers != ''"> and total_containers like concat('%',#{totalContainers},'%') </if>
<if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty like concat('%',#{closeAtQty},'%') </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m like concat('%',#{quantityUM},'%') </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m like concat('%',#{weightUM},'%') </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m like concat('%',#{volumeUM},'%') </if>
<if test="checkInFrom != null and checkInFrom != ''"> and check_in_from like concat('%',#{checkInFrom},'%') </if>
<if test="checkInTo != null and checkInTo != ''"> and check_in_to like concat('%',#{checkInTo},'%') </if>
<if test="closedAt != null and closedAt != ''"> and closed_at like concat('%',#{closedAt},'%') </if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code like concat('%',#{sourcePlatformCode},'%') </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code like concat('%',#{sourceOrderCode},'%') </if>
<if test="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
<if test="createdBy != null and createdBy != ''"> and created_by like concat('%',#{createdBy},'%') </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated like concat('%',#{lastUpdated},'%') </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by like concat('%',#{lastUpdatedBy},'%') </if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code like concat('%',#{returnWaybillCode},'%') </if>
<if test="returnCarrier != null and returnCarrier != ''"> and return_carrier like concat('%',#{returnCarrier},'%') </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="TocofsReturngoodsentity_list_or" resultMap="get-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
select
<include refid="TocofsReturngoodsEntity_Base_Column_List" />
from tocofs_returngoods
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="clientCode != null and clientCode != ''"> or client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> or company_code = #{companyCode} </if>
<if test="storeCode != null and storeCode != ''"> or store_code = #{storeCode} </if>
<if test="facilityCode != null and facilityCode != ''"> or facility_code = #{facilityCode} </if>
<if test="code != null and code != ''"> or code = #{code} </if>
<if test="internalInstructionType != null and internalInstructionType != ''"> or internal_instruction_type = #{internalInstructionType} </if>
<if test="bizChannel != null and bizChannel != ''"> or biz_channel = #{bizChannel} </if>
<if test="refOrderId != null and refOrderId != ''"> or ref_order_id = #{refOrderId} </if>
<if test="refOrderCode != null and refOrderCode != ''"> or ref_order_code = #{refOrderCode} </if>
<if test="refOrderType != null and refOrderType != ''"> or ref_order_type = #{refOrderType} </if>
<if test="closed != null and closed != ''"> or closed = #{closed} </if>
<if test="closedBy != null and closedBy != ''"> or closed_by = #{closedBy} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="allowOverReceive != null and allowOverReceive != ''"> or allow_over_receive = #{allowOverReceive} </if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> or ship_from_attention_to = #{shipFromAttentionTo} </if>
<if test="shipFromAddress != null and shipFromAddress != ''"> or ship_from_address = #{shipFromAddress} </if>
<if test="shipFromCountry != null and shipFromCountry != ''"> or ship_from_country = #{shipFromCountry} </if>
<if test="shipFromState != null and shipFromState != ''"> or ship_from_state = #{shipFromState} </if>
<if test="shipFromCity != null and shipFromCity != ''"> or ship_from_city = #{shipFromCity} </if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> or ship_from_district = #{shipFromDistrict} </if>
<if test="shipFromMobile != null and shipFromMobile != ''"> or ship_from_mobile = #{shipFromMobile} </if>
<if test="totalLines != null and totalLines != ''"> or total_lines = #{totalLines} </if>
<if test="totalQty != null and totalQty != ''"> or total_qty = #{totalQty} </if>
<if test="totalAmount != null and totalAmount != ''"> or total_amount = #{totalAmount} </if>
<if test="totalWeight != null and totalWeight != ''"> or total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> or total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> or total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> or total_fulfill_amount = #{totalFulfillAmount} </if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> or total_fulfill_weight = #{totalFulfillWeight} </if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> or total_fulfill_volume = #{totalFulfillVolume} </if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> or total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> or total_fulfill_qty = #{totalFulfillQty} </if>
<if test="totalCases != null and totalCases != ''"> or total_cases = #{totalCases} </if>
<if test="totalContainers != null and totalContainers != ''"> or total_containers = #{totalContainers} </if>
<if test="closeAtQty != null and closeAtQty != ''"> or close_at_qty = #{closeAtQty} </if>
<if test="quantityUM != null and quantityUM != ''"> or quantity_u_m = #{quantityUM} </if>
<if test="weightUM != null and weightUM != ''"> or weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> or volume_u_m = #{volumeUM} </if>
<if test="checkInFrom != null and checkInFrom != ''"> or check_in_from = #{checkInFrom} </if>
<if test="checkInTo != null and checkInTo != ''"> or check_in_to = #{checkInTo} </if>
<if test="closedAt != null and closedAt != ''"> or closed_at = #{closedAt} </if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> or source_platform_code = #{sourcePlatformCode} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> or source_order_code = #{sourceOrderCode} </if>
<if test="created != null and created != ''"> or created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> or created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> or last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> or last_updated_by = #{lastUpdatedBy} </if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> or return_waybill_code = #{returnWaybillCode} </if>
<if test="returnCarrier != null and returnCarrier != ''"> or return_carrier = #{returnCarrier} </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.ofs.entity.TocofsReturngoodsEntity" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_returngoods(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="clientCode != null and clientCode != ''"> client_code , </if>
<if test="companyCode != null and companyCode != ''"> company_code , </if>
<if test="storeCode != null and storeCode != ''"> store_code , </if>
<if test="facilityCode != null and facilityCode != ''"> facility_code , </if>
<if test="code != null and code != ''"> code , </if>
<if test="internalInstructionType != null and internalInstructionType != ''"> internal_instruction_type , </if>
<if test="bizChannel != null and bizChannel != ''"> biz_channel , </if>
<if test="refOrderId != null and refOrderId != ''"> ref_order_id , </if>
<if test="refOrderCode != null and refOrderCode != ''"> ref_order_code , </if>
<if test="refOrderType != null and refOrderType != ''"> ref_order_type , </if>
<if test="closed != null and closed != ''"> closed , </if>
<if test="closedBy != null and closedBy != ''"> closed_by , </if>
<if test="status != null and status != ''"> status , </if>
<if test="allowOverReceive != null and allowOverReceive != ''"> allow_over_receive , </if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> ship_from_attention_to , </if>
<if test="shipFromAddress != null and shipFromAddress != ''"> ship_from_address , </if>
<if test="shipFromCountry != null and shipFromCountry != ''"> ship_from_country , </if>
<if test="shipFromState != null and shipFromState != ''"> ship_from_state , </if>
<if test="shipFromCity != null and shipFromCity != ''"> ship_from_city , </if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> ship_from_district , </if>
<if test="shipFromMobile != null and shipFromMobile != ''"> ship_from_mobile , </if>
<if test="totalLines != null and totalLines != ''"> total_lines , </if>
<if test="totalQty != null and totalQty != ''"> total_qty , </if>
<if test="totalAmount != null and totalAmount != ''"> total_amount , </if>
<if test="totalWeight != null and totalWeight != ''"> total_weight , </if>
<if test="totalVolume != null and totalVolume != ''"> total_volume , </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight , </if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> total_fulfill_amount , </if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> total_fulfill_weight , </if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> total_fulfill_volume , </if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> total_fulfill_volume_weight , </if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> total_fulfill_qty , </if>
<if test="totalCases != null and totalCases != ''"> total_cases , </if>
<if test="totalContainers != null and totalContainers != ''"> total_containers , </if>
<if test="closeAtQty != null and closeAtQty != ''"> close_at_qty , </if>
<if test="quantityUM != null and quantityUM != ''"> quantity_u_m , </if>
<if test="weightUM != null and weightUM != ''"> weight_u_m , </if>
<if test="volumeUM != null and volumeUM != ''"> volume_u_m , </if>
<if test="checkInFrom != null and checkInFrom != ''"> check_in_from , </if>
<if test="checkInTo != null and checkInTo != ''"> check_in_to , </if>
<if test="closedAt != null and closedAt != ''"> closed_at , </if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> source_platform_code , </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code , </if>
<if test="created != null and created != ''"> created , </if>
<if test="createdBy != null and createdBy != ''"> created_by , </if>
<if test="lastUpdated != null and lastUpdated != ''"> last_updated , </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by , </if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> return_waybill_code , </if>
<if test="returnCarrier != null and returnCarrier != ''"> return_carrier , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="clientCode != null and clientCode != ''"> #{clientCode} ,</if>
<if test="companyCode != null and companyCode != ''"> #{companyCode} ,</if>
<if test="storeCode != null and storeCode != ''"> #{storeCode} ,</if>
<if test="facilityCode != null and facilityCode != ''"> #{facilityCode} ,</if>
<if test="code != null and code != ''"> #{code} ,</if>
<if test="internalInstructionType != null and internalInstructionType != ''"> #{internalInstructionType} ,</if>
<if test="bizChannel != null and bizChannel != ''"> #{bizChannel} ,</if>
<if test="refOrderId != null and refOrderId != ''"> #{refOrderId} ,</if>
<if test="refOrderCode != null and refOrderCode != ''"> #{refOrderCode} ,</if>
<if test="refOrderType != null and refOrderType != ''"> #{refOrderType} ,</if>
<if test="closed != null and closed != ''"> #{closed} ,</if>
<if test="closedBy != null and closedBy != ''"> #{closedBy} ,</if>
<if test="status != null and status != ''"> #{status} ,</if>
<if test="allowOverReceive != null and allowOverReceive != ''"> #{allowOverReceive} ,</if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> #{shipFromAttentionTo} ,</if>
<if test="shipFromAddress != null and shipFromAddress != ''"> #{shipFromAddress} ,</if>
<if test="shipFromCountry != null and shipFromCountry != ''"> #{shipFromCountry} ,</if>
<if test="shipFromState != null and shipFromState != ''"> #{shipFromState} ,</if>
<if test="shipFromCity != null and shipFromCity != ''"> #{shipFromCity} ,</if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> #{shipFromDistrict} ,</if>
<if test="shipFromMobile != null and shipFromMobile != ''"> #{shipFromMobile} ,</if>
<if test="totalLines != null and totalLines != ''"> #{totalLines} ,</if>
<if test="totalQty != null and totalQty != ''"> #{totalQty} ,</if>
<if test="totalAmount != null and totalAmount != ''"> #{totalAmount} ,</if>
<if test="totalWeight != null and totalWeight != ''"> #{totalWeight} ,</if>
<if test="totalVolume != null and totalVolume != ''"> #{totalVolume} ,</if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> #{totalVolumeWeight} ,</if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> #{totalFulfillAmount} ,</if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> #{totalFulfillWeight} ,</if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> #{totalFulfillVolume} ,</if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> #{totalFulfillVolumeWeight} ,</if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> #{totalFulfillQty} ,</if>
<if test="totalCases != null and totalCases != ''"> #{totalCases} ,</if>
<if test="totalContainers != null and totalContainers != ''"> #{totalContainers} ,</if>
<if test="closeAtQty != null and closeAtQty != ''"> #{closeAtQty} ,</if>
<if test="quantityUM != null and quantityUM != ''"> #{quantityUM} ,</if>
<if test="weightUM != null and weightUM != ''"> #{weightUM} ,</if>
<if test="volumeUM != null and volumeUM != ''"> #{volumeUM} ,</if>
<if test="checkInFrom != null and checkInFrom != ''"> #{checkInFrom} ,</if>
<if test="checkInTo != null and checkInTo != ''"> #{checkInTo} ,</if>
<if test="closedAt != null and closedAt != ''"> #{closedAt} ,</if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> #{sourcePlatformCode} ,</if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> #{sourceOrderCode} ,</if>
<if test="created != null and created != ''"> #{created} ,</if>
<if test="createdBy != null and createdBy != ''"> #{createdBy} ,</if>
<if test="lastUpdated != null and lastUpdated != ''"> #{lastUpdated} ,</if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> #{lastUpdatedBy} ,</if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> #{returnWaybillCode} ,</if>
<if test="returnCarrier != null and returnCarrier != ''"> #{returnCarrier} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier}, 'Y')
</foreach>
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatchV2" keyProperty="id" useGeneratedKeys="true">
insert IGNORE into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier,id)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier},#{entity.id})
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier})
</foreach>
on duplicate key update
client_code = values(client_code),
company_code = values(company_code),
store_code = values(store_code),
facility_code = values(facility_code),
code = values(code),
internal_instruction_type = values(internal_instruction_type),
biz_channel = values(biz_channel),
ref_order_id = values(ref_order_id),
ref_order_code = values(ref_order_code),
ref_order_type = values(ref_order_type),
closed = values(closed),
closed_by = values(closed_by),
status = values(status),
allow_over_receive = values(allow_over_receive),
ship_from_attention_to = values(ship_from_attention_to),
ship_from_address = values(ship_from_address),
ship_from_country = values(ship_from_country),
ship_from_state = values(ship_from_state),
ship_from_city = values(ship_from_city),
ship_from_district = values(ship_from_district),
ship_from_mobile = values(ship_from_mobile),
total_lines = values(total_lines),
total_qty = values(total_qty),
total_amount = values(total_amount),
total_weight = values(total_weight),
total_volume = values(total_volume),
total_volume_weight = values(total_volume_weight),
total_fulfill_amount = values(total_fulfill_amount),
total_fulfill_weight = values(total_fulfill_weight),
total_fulfill_volume = values(total_fulfill_volume),
total_fulfill_volume_weight = values(total_fulfill_volume_weight),
total_fulfill_qty = values(total_fulfill_qty),
total_cases = values(total_cases),
total_containers = values(total_containers),
close_at_qty = values(close_at_qty),
quantity_u_m = values(quantity_u_m),
weight_u_m = values(weight_u_m),
volume_u_m = values(volume_u_m),
check_in_from = values(check_in_from),
check_in_to = values(check_in_to),
closed_at = values(closed_at),
source_platform_code = values(source_platform_code),
source_order_code = values(source_order_code),
created = values(created),
created_by = values(created_by),
last_updated = values(last_updated),
last_updated_by = values(last_updated_by),
return_waybill_code = values(return_waybill_code),
return_carrier = values(return_carrier)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
update tocofs_returngoods set
<trim suffix="" suffixOverrides=",">
<if test="clientCode != null and clientCode != ''"> client_code = #{clientCode},</if>
<if test="companyCode != null and companyCode != ''"> company_code = #{companyCode},</if>
<if test="storeCode != null and storeCode != ''"> store_code = #{storeCode},</if>
<if test="facilityCode != null and facilityCode != ''"> facility_code = #{facilityCode},</if>
<if test="code != null and code != ''"> code = #{code},</if>
<if test="internalInstructionType != null and internalInstructionType != ''"> internal_instruction_type = #{internalInstructionType},</if>
<if test="bizChannel != null and bizChannel != ''"> biz_channel = #{bizChannel},</if>
<if test="refOrderId != null and refOrderId != ''"> ref_order_id = #{refOrderId},</if>
<if test="refOrderCode != null and refOrderCode != ''"> ref_order_code = #{refOrderCode},</if>
<if test="refOrderType != null and refOrderType != ''"> ref_order_type = #{refOrderType},</if>
<if test="closed != null and closed != ''"> closed = #{closed},</if>
<if test="closedBy != null and closedBy != ''"> closed_by = #{closedBy},</if>
<if test="status != null and status != ''"> status = #{status},</if>
<if test="allowOverReceive != null and allowOverReceive != ''"> allow_over_receive = #{allowOverReceive},</if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> ship_from_attention_to = #{shipFromAttentionTo},</if>
<if test="shipFromAddress != null and shipFromAddress != ''"> ship_from_address = #{shipFromAddress},</if>
<if test="shipFromCountry != null and shipFromCountry != ''"> ship_from_country = #{shipFromCountry},</if>
<if test="shipFromState != null and shipFromState != ''"> ship_from_state = #{shipFromState},</if>
<if test="shipFromCity != null and shipFromCity != ''"> ship_from_city = #{shipFromCity},</if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> ship_from_district = #{shipFromDistrict},</if>
<if test="shipFromMobile != null and shipFromMobile != ''"> ship_from_mobile = #{shipFromMobile},</if>
<if test="totalLines != null and totalLines != ''"> total_lines = #{totalLines},</if>
<if test="totalQty != null and totalQty != ''"> total_qty = #{totalQty},</if>
<if test="totalAmount != null and totalAmount != ''"> total_amount = #{totalAmount},</if>
<if test="totalWeight != null and totalWeight != ''"> total_weight = #{totalWeight},</if>
<if test="totalVolume != null and totalVolume != ''"> total_volume = #{totalVolume},</if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight = #{totalVolumeWeight},</if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> total_fulfill_amount = #{totalFulfillAmount},</if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> total_fulfill_weight = #{totalFulfillWeight},</if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> total_fulfill_volume = #{totalFulfillVolume},</if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> total_fulfill_volume_weight = #{totalFulfillVolumeWeight},</if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> total_fulfill_qty = #{totalFulfillQty},</if>
<if test="totalCases != null and totalCases != ''"> total_cases = #{totalCases},</if>
<if test="totalContainers != null and totalContainers != ''"> total_containers = #{totalContainers},</if>
<if test="closeAtQty != null and closeAtQty != ''"> close_at_qty = #{closeAtQty},</if>
<if test="quantityUM != null and quantityUM != ''"> quantity_u_m = #{quantityUM},</if>
<if test="weightUM != null and weightUM != ''"> weight_u_m = #{weightUM},</if>
<if test="volumeUM != null and volumeUM != ''"> volume_u_m = #{volumeUM},</if>
<if test="checkInFrom != null and checkInFrom != ''"> check_in_from = #{checkInFrom},</if>
<if test="checkInTo != null and checkInTo != ''"> check_in_to = #{checkInTo},</if>
<if test="closedAt != null and closedAt != ''"> closed_at = #{closedAt},</if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> source_platform_code = #{sourcePlatformCode},</if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code = #{sourceOrderCode},</if>
<if test="created != null and created != ''"> created = #{created},</if>
<if test="createdBy != null and createdBy != ''"> created_by = #{createdBy},</if>
<if test="lastUpdated != null and lastUpdated != ''"> last_updated = #{lastUpdated},</if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by = #{lastUpdatedBy},</if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> return_waybill_code = #{returnWaybillCode},</if>
<if test="returnCarrier != null and returnCarrier != ''"> return_carrier = #{returnCarrier},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
update tocofs_returngoods set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
update tocofs_returngoods set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
<if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type = #{internalInstructionType} </if>
<if test="bizChannel != null and bizChannel != ''"> and biz_channel = #{bizChannel} </if>
<if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
<if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code = #{refOrderCode} </if>
<if test="refOrderType != null and refOrderType != ''"> and ref_order_type = #{refOrderType} </if>
<if test="closed != null and closed != ''"> and closed = #{closed} </if>
<if test="closedBy != null and closedBy != ''"> and closed_by = #{closedBy} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive = #{allowOverReceive} </if>
<if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to = #{shipFromAttentionTo} </if>
<if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address = #{shipFromAddress} </if>
<if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country = #{shipFromCountry} </if>
<if test="shipFromState != null and shipFromState != ''"> and ship_from_state = #{shipFromState} </if>
<if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city = #{shipFromCity} </if>
<if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district = #{shipFromDistrict} </if>
<if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile = #{shipFromMobile} </if>
<if test="totalLines != null and totalLines != ''"> and total_lines = #{totalLines} </if>
<if test="totalQty != null and totalQty != ''"> and total_qty = #{totalQty} </if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
<if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
<if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
<if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
<if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount = #{totalFulfillAmount} </if>
<if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight = #{totalFulfillWeight} </if>
<if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume = #{totalFulfillVolume} </if>
<if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
<if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty = #{totalFulfillQty} </if>
<if test="totalCases != null and totalCases != ''"> and total_cases = #{totalCases} </if>
<if test="totalContainers != null and totalContainers != ''"> and total_containers = #{totalContainers} </if>
<if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty = #{closeAtQty} </if>
<if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
<if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
<if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
<if test="checkInFrom != null and checkInFrom != ''"> and check_in_from = #{checkInFrom} </if>
<if test="checkInTo != null and checkInTo != ''"> and check_in_to = #{checkInTo} </if>
<if test="closedAt != null and closedAt != ''"> and closed_at = #{closedAt} </if>
<if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code = #{sourcePlatformCode} </if>
<if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
<if test="created != null and created != ''"> and created = #{created} </if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
<if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
<if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
<if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code = #{returnWaybillCode} </if>
<if test="returnCarrier != null and returnCarrier != ''"> and return_carrier = #{returnCarrier} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from tocofs_returngoods where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.lets.ofs.service;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* root(TocofsReturngoodsDetailed)表服务接口
*
* @author makejava
* @since 2024-08-09 13:45:47
*/
public interface ITocofsReturngoodsDetailedService extends IBaseService<TocofsReturngoodsDetailedEntity, String>{
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.lets.ofs.service;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* OFS售后入库单(TocofsReturngoods)表服务接口
*
* @author makejava
* @since 2024-08-09 11:08:40
*/
public interface ITocofsReturngoodsService extends IBaseService<TocofsReturngoodsEntity, String>{
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.plugin.lets.ofs.service.impl;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao;
import com.hzya.frame.plugin.lets.ofs.service.ITocofsReturngoodsDetailedService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* root(TocofsReturngoodsDetailed)表服务实现类
*
* @author makejava
* @since 2024-08-09 13:45:47
*/
public class TocofsReturngoodsDetailedServiceImpl extends BaseService<TocofsReturngoodsDetailedEntity, String> implements ITocofsReturngoodsDetailedService {
private ITocofsReturngoodsDetailedDao tocofsReturngoodsDetailedDao;
@Autowired
public void setTocofsReturngoodsDetailedDao(ITocofsReturngoodsDetailedDao dao) {
this.tocofsReturngoodsDetailedDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.plugin.lets.ofs.service.impl;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao;
import com.hzya.frame.plugin.lets.ofs.service.ITocofsReturngoodsService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* OFS售后入库单(TocofsReturngoods)表服务实现类
*
* @author makejava
* @since 2024-08-09 11:08:40
*/
public class TocofsReturngoodsServiceImpl extends BaseService<TocofsReturngoodsEntity, String> implements ITocofsReturngoodsService {
private ITocofsReturngoodsDao tocofsReturngoodsDao;
@Autowired
public void setTocofsReturngoodsDao(ITocofsReturngoodsDao dao) {
this.tocofsReturngoodsDao = dao;
this.dao = dao;
}
}

View File

@ -18,7 +18,7 @@ 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.u8cdto.*;
import com.hzya.frame.plugin.lets.util.BasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.TocOrderBasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.DateStrUtil;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
import com.hzya.frame.split.SplitListByCountUtil;
@ -89,7 +89,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
private OfsUnifiedService ofsUnifiedService;
@Autowired
private BasicArchivesCacheUtil basicArchivesCacheUtil;
private TocOrderBasicArchivesCacheUtil basicArchivesCacheUtil;
@Autowired
private ITocofsSaleoutService iTocofsSaleoutService;
@ -205,7 +205,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto> headerDtoList = ofssaleorderoutsearchList.get(i);
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = copyHeaderDto(headerDtoList);
if (tocofsSaleoutEntityList.size() > 0) {
logger.info("tocofsSaleoutDetailedEntities插入底表{}个对象(表头)", tocofsSaleoutEntityList.size());
iTocofsSaleoutDao.entityInsertBatchV2(tocofsSaleoutEntityList);
} else {
logger.info("tocofsSaleoutEntityList没有对象被插入表头底表");
}
}
@ -215,7 +218,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> detailsDtos = detailsDtoList.get(i);
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos);
if (tocofsSaleoutDetailedEntities.size() > 0) {
logger.info("tocofsSaleoutDetailedEntities插入底表{}个对象(表体)", tocofsSaleoutDetailedEntities.size());
iTocofsSaleoutDetailedDao.entityInsertBatchV2(tocofsSaleoutDetailedEntities);
} else {
logger.info("tocofsSaleoutDetailedEntities没有对象被插入表头底表");
}
}
}
@ -398,8 +404,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
saleorderRequestChildrenDto.setNnumber(String.valueOf(sonDetailsDto.getGroupShipQty()));//数量
saleorderRequestChildrenDto.setNoriginalcurdiscountmny("0");//折扣额
saleorderRequestChildrenDto.setNoriginalcurmny(noriginalcurmny.stripTrailingZeros().toPlainString());//无税金额
saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价
saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价
// saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价
// saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价
saleorderRequestChildrenDto.setNoriginalcursummny(noriginalcursummny.stripTrailingZeros().toPlainString());//价税合计
saleorderRequestChildrenDto.setNoriginalcurtaxmny(noriginalcurtaxmny.stripTrailingZeros().toPlainString());//税额
saleorderRequestChildrenDto.setNoriginalcurtaxnetprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税净价
@ -480,11 +486,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//表头公司通过名称匹配U8C公司
String corpName = "上海丽知品牌管理有限公司";
BdCorpEntity bdCorpEntity = BasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName);
BdCorpEntity bdCorpEntity = TocOrderBasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName);
Assert.notNull(bdCorpEntity, "根据公司名称({})没有匹配到U8C公司档案", corpName);
//发货库存组织
BdCalbodyEntity bdCalbodyEntity = BasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp());
BdCalbodyEntity bdCalbodyEntity = TocOrderBasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp());
Assert.notNull(bdCalbodyEntity, "根据公司主键没有查询到发货库存组织 公司主键:{}", bdCorpEntity.getPkCorp());
//发货公司暂时把O表头公司作为发货公司正常情况下需要把O库存地点对于的公司作为发货公司
@ -493,7 +499,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//2024年8月5日 15:06:38 仓库O与U两边仓库编码是一致的和妮姐确认过了
String facilityCode = header.getFacilityCode();
Assert.notNull(facilityCode, "O仓库编码不能为空");
BdStordocEntity bdStordocEntity = BasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody());
BdStordocEntity bdStordocEntity = TocOrderBasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody());
Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码{}", facilityCode, bdCalbodyEntity.getPkCalbody());
//2024年8月5日 15:25:07 收货库存组织收货仓库默认和发货库存组织发货仓库一致已经和佳妮确认
@ -501,27 +507,27 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//收货仓库通过收货库存组织+仓库编码确定收货仓库
//销售组织2024年8月5日 15:33:40 和妮姐确认销售组织和表头公司作为一对一的关系
BdSalestruEntity bdSalestruEntity = BasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname());
BdSalestruEntity bdSalestruEntity = TocOrderBasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname());
Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
//业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认
BdDeptdocEntity bdDeptdocEntity = BasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp());
BdDeptdocEntity bdDeptdocEntity = TocOrderBasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp());
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp());
//客商基本档案
//TODO 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑
String custName = "天猫intoyou旗舰店-自营";
BdCubasdocEntity bdCubasdocEntity = BasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName);
BdCubasdocEntity bdCubasdocEntity = TocOrderBasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName);
Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", custName);
//客商管理档案2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案已经和妮姐确认
//2024年8月5日 15:49:49 先根据O店铺编码得到店铺档案信息取到名称通过U8C接口查询出来
//目前O店铺信息查询接口还没有等待开发所以我这里先写所一个名字
BdCumandocEntity bdCumandocEntity = BasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
BdCumandocEntity bdCumandocEntity = TocOrderBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营");
//查找平台
BdDefdocEntity bdDefdocEntity = BasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode());
BdDefdocEntity bdDefdocEntity = TocOrderBasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode());
Assert.notNull(bdDefdocEntity, "根据O平台编码({})无法匹配到平台", header.getSourcePlatformCode());
//字段拷贝
@ -707,7 +713,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
Assert.notNull(sonDetailsDto.getSkuCode(), "O存货商家编码不能为空");
Assert.notNull(pkCorp, "发货公司主键不能为空");
BdInvmandocEntity bdInvmandocEntity = BasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(sonDetailsDto.getSkuCode() + pkCorp);
BdInvmandocEntity bdInvmandocEntity = TocOrderBasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(sonDetailsDto.getSkuCode() + pkCorp);
Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 存货商家编码:{} 存货发货公司:{}", sonDetailsDto.getSkuCode(), pkCorp);
return bdInvmandocEntity;
}
@ -755,7 +761,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
private BdInvbasdocEntity queryStockBasicArchives(String pkInvmandoc, String pkCorp) {
Assert.notNull(pkInvmandoc, "存货管理档案不能为空");
Assert.notNull(pkCorp, "公司档案不能为空");
BdInvbasdocEntity bdInvbasdocEntity = BasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp);
BdInvbasdocEntity bdInvbasdocEntity = TocOrderBasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp);
Assert.notNull(bdInvbasdocEntity, "根据公司主键:{} 和存货管理档案主键:{} 没有查询到存货基本档案", pkCorp, pkInvmandoc);
return bdInvbasdocEntity;
}
@ -768,7 +774,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
*/
private BdTaxitemsEntity queryBdTaxitems(String invcode) {
Assert.notNull(invcode, "存货编码不能为空");
BdTaxitemsEntity bdTaxitemsEntity = BasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode);
BdTaxitemsEntity bdTaxitemsEntity = TocOrderBasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode);
Assert.notNull(bdTaxitemsEntity, "根据存货编码({}),无法匹配到税率!", invcode);
return bdTaxitemsEntity;
}

View File

@ -10,23 +10,22 @@ 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.entity.*;
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.ofs.dao.ITocofsReturngoodsDao;
import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
import com.hzya.frame.plugin.lets.u8cdto.*;
import com.hzya.frame.plugin.lets.util.BasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.TocReturnBasicArchivesCacheUtil;
import com.hzya.frame.plugin.lets.util.DateStrUtil;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
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.returngoodsearch.RertunGoodsRootBean;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodHeaderDetailsDataDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto;
import com.hzya.frame.ttxofs.service.OfsUnifiedService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
@ -88,18 +87,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
@Autowired
private OfsUnifiedService ofsUnifiedService;
@Autowired
private BasicArchivesCacheUtil basicArchivesCacheUtil;
@Autowired
private ITocofsSaleoutService iTocofsSaleoutService;
@Autowired
private ITocofsSaleoutDao iTocofsSaleoutDao;
@Autowired
private ITocofsSaleoutDetailedDao iTocofsSaleoutDetailedDao;
@Autowired
private QueryBdBusitypeUtil queryBdBusitypeUtil;
@ -107,6 +94,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
private static final String ADD = "+";
@Autowired
private ITocofsReturngoodsDao iTocofsReturngoodsDao;
@Autowired
private ITocofsReturngoodsDetailedDao iTocofsReturngoodsDetailedDao;
@Autowired
private TocReturnBasicArchivesCacheUtil tocReturnBasicArchivesCacheUtil;
/**
* 按指定时间拉取
*
@ -124,7 +120,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
// TODO 注意过滤TOC店铺
CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
List<HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setCreated_start("2024-07-16 15:35:35");
queryOfsSoSaleOutVo.setCreated_end("2024-07-16 15:35:37");
@ -135,15 +132,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001");
queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L);
logger.info("数据返回行数:{}", headerDetailsDtoList.size());
if (headerDetailsDtoList.size() > 0) {
queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L);
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size());
if (returnGoodHeaderDetailsDataDtoList.size() > 0) {
//保存到mysql
batchInsert(headerDetailsDtoList);
batchInsert(returnGoodHeaderDetailsDataDtoList);
//过滤成功的数据
List<HeaderDetailsDto> headerDetailsDtos = filterData(headerDetailsDtoList);
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList1 = filterData(returnGoodHeaderDetailsDataDtoList);
//执行推送主逻辑
implement(headerDetailsDtos);
implement(returnGoodHeaderDetailsDataDtoList1);
} else {
logger.info("没有查询到任何数据!不需要同步");
}
@ -151,7 +148,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
logger.error("startImplement方法抛出异常", e);
} finally {
try {
basicArchivesCacheUtil.clearCache();
tocReturnBasicArchivesCacheUtil.clearCache();
} catch (Exception e) {
logger.info("清理档案缓存失败", e);
}
@ -172,11 +169,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
*
* @author liuyang
*/
private List<HeaderDetailsDto> filterData(List<HeaderDetailsDto> headerDetailsDtoList) {
List<HeaderDetailsDto> headerDetailsDtoList1 = new ArrayList<>();
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
private List<ReturnGoodHeaderDetailsDataDto> filterData(List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList) {
List<ReturnGoodHeaderDetailsDataDto> headerDetailsDtoList1 = new ArrayList<>();
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
//TODO 出库单明细主键需要O返回目前没有已经提需求
headerDetailsDtoList1.addAll(headerDetailsDtoList);
headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoList);
}
return headerDetailsDtoList1;
}
@ -184,51 +181,56 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
/**
* 保存抓取到的数据到mysql底表如果底表里已经存在则会忽略
*
* @param headerDetailsDtoList 数据行
* @param returnGoodHeaderDetailsDataDtoList 数据行
*/
private void batchInsert(List<HeaderDetailsDto> headerDetailsDtoList) throws Exception {
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
List<HeaderDto> headerDetailsDtoList1 = new ArrayList<>();
List<DetailsDto> headerDetailsDtoList2 = new ArrayList<>();
for (HeaderDetailsDto index : headerDetailsDtoList) {
HeaderDto header = index.getHeader();// 主表
List<DetailsDto> details = index.getDetails();//明细表
private void batchInsert(List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList) throws Exception {
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
List<ReturnGoodSearchHeaderDto> headerDetailsDtoList1 = new ArrayList<>();
List<ReturnGoodSearchDetailsDto> headerDetailsDtoList2 = new ArrayList<>();
for (ReturnGoodHeaderDetailsDataDto index : returnGoodHeaderDetailsDataDtoList) {
ReturnGoodSearchHeaderDto header = index.getHeader();// 主表
List<ReturnGoodSearchDetailsDto> details = index.getDetails();//明细表
headerDetailsDtoList1.add(header);
headerDetailsDtoList2.addAll(details);
}
//每250作为一个批次插入主表根据主键id判断是否重复如果重复的则不进行插入
List<List<HeaderDto>> ofssaleorderoutsearchList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 250);
for (int i = 0; i < ofssaleorderoutsearchList.size(); i++) {
List<HeaderDto> headerDtoList = ofssaleorderoutsearchList.get(i);
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = copyHeaderDto(headerDtoList);
if (tocofsSaleoutEntityList.size() > 0) {
iTocofsSaleoutDao.entityInsertBatchV2(tocofsSaleoutEntityList);
List<List<ReturnGoodSearchHeaderDto>> lists = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 100);
for (int i = 0; i < lists.size(); i++) {
List<ReturnGoodSearchHeaderDto> returnGoodSearchHeaderDtos = lists.get(i);
List<TocofsReturngoodsEntity> tocofsReturngoodsEntities = copyHeaderDto(returnGoodSearchHeaderDtos);
if (tocofsReturngoodsEntities.size() > 0) {
logger.info("插入底表{}个对象(表头)", tocofsReturngoodsEntities.size());
iTocofsReturngoodsDao.entityInsertBatchV2(tocofsReturngoodsEntities);
} else {
logger.info("tocofsReturngoodsEntities没有对象被插入表头底表");
}
}
//插入明细表
List<List<DetailsDto>> detailsDtoList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 250);
for (int i = 0; i < detailsDtoList.size(); i++) {
List<DetailsDto> detailsDtos = detailsDtoList.get(i);
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos);
if (tocofsSaleoutDetailedEntities.size() > 0) {
iTocofsSaleoutDetailedDao.entityInsertBatchV2(tocofsSaleoutDetailedEntities);
List<List<ReturnGoodSearchDetailsDto>> lists1 = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 100);
for (int i = 0; i < lists1.size(); i++) {
List<ReturnGoodSearchDetailsDto> returnGoodSearchDetailsDtos = lists1.get(i);
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = copyDetailsDto(returnGoodSearchDetailsDtos);
if (tocofsReturngoodsDetailedEntities.size() > 0) {
logger.info("插入底表{}个对象(表体)", tocofsReturngoodsDetailedEntities.size());
iTocofsReturngoodsDetailedDao.entityInsertBatchV2(tocofsReturngoodsDetailedEntities);
} else {
logger.info("tocofsReturngoodsDetailedEntities没有对象被插入表头底表");
}
}
}
}
/**
* 查询OFS结果集
* 查询OFS售后退货入库单
*
* @param queryOfsSoSaleOutVo 查询参数
* @param headerDetailsDtoList 查询结果集
* @param pageNo 从第pageNo页开始查询
*/
private void queryOfsSaleOrder(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List<HeaderDetailsDto> headerDetailsDtoList, Long pageNo) throws Exception {
private void queryOfsReturnGoods(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List<ReturnGoodHeaderDetailsDataDto> headerDetailsDtoList, Long pageNo) throws Exception {
Long pageSize = 200L;
queryOfsSoSaleOutVo.setPageNo(pageNo);
@ -237,21 +239,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.receipt.search");
interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto);
if (saleOutReturnMessageDto != null) {
if ("false".equals(saleOutReturnMessageDto.getError()) && "0".equals(saleOutReturnMessageDto.getCode()) && "Success".equals(saleOutReturnMessageDto.getMsg())) {
List<HeaderDetailsDto> headerDetailsDtoList1 = saleOutReturnMessageDto.getData();
if (headerDetailsDtoList1 != null && headerDetailsDtoList1.size() > 0) {
headerDetailsDtoList.addAll(headerDetailsDtoList1);
RertunGoodsRootBean rertunGoodsRootBean = (RertunGoodsRootBean) ofsUnifiedService.unified(interfaceParamDto);
if (rertunGoodsRootBean != null) {
if ("false".equals(rertunGoodsRootBean.getError()) && "0".equals(rertunGoodsRootBean.getCode()) && "Success".equals(rertunGoodsRootBean.getMsg())) {
List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList = rertunGoodsRootBean.getData();
if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
headerDetailsDtoList.addAll(returnGoodHeaderDetailsDataDtoList);
//TODO OFS没有提供分页字段
//TODO OFS没有提供分页字段等待开发
}
} else {
//2024年7月30日 13:47:04 查询失败
logger.error("查询失败,失败原因:{}", JSON.toJSON(saleOutReturnMessageDto));
logger.error("查询失败,失败原因:{}", JSON.toJSON(interfaceParamDto));
}
} else {
logger.error("returnMessageBasics为空queryOfsSoSaleOutVo对象结果{}", JSON.toJSON(queryOfsSoSaleOutVo));
logger.error("rertunGoodsRootBean为空interfaceParamDto对象的结果集json{}", JSON.toJSON(interfaceParamDto));
}
}
@ -277,26 +278,27 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
/**
* 代码同步逻辑
*
* @param headerDetailsDtos 查询得到的O出库单对象
* @param returnGoodHeaderDetailsDataDtoList1 查询得到的O出库单对象
* @author liuyang
*/
private void implement(List<HeaderDetailsDto> headerDetailsDtos) throws Exception {
if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) {
private void implement(List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList1) throws Exception {
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
try {
// 查询基本档案
List<SonDetailsDto> sonDetailsDtoList = queryBasicArchives(headerDetailsDtos);
List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList1);
// 分组汇总
Map<String, List<SonDetailsDto>> summaryDimensionMap = groupSummary(sonDetailsDtoList);
Map<String, List<GoodsRertunSonDetailsDto>> summaryDimensionMap = groupSummary(goodsRertunSonDetailsDtos);
// 查询U8C业务流程
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow();
if (bdBusitypeEntity != null && summaryDimensionMap != null) {
Iterator<Map.Entry<String, List<SonDetailsDto>>> iterator = summaryDimensionMap.entrySet().iterator();
Iterator<Map.Entry<String, List<GoodsRertunSonDetailsDto>>> iterator = summaryDimensionMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, List<SonDetailsDto>> entry = iterator.next();
Map.Entry<String, List<GoodsRertunSonDetailsDto>> entry = iterator.next();
String keyGroup = entry.getKey();
List<SonDetailsDto> oldValue = entry.getValue();
HeaderDto header = oldValue.get(0).getHeader();
List<GoodsRertunSonDetailsDto> oldValue = entry.getValue();
ReturnGoodSearchHeaderDto header = oldValue.get(0).getHeader();
BdCorpEntity bdCorpEntity = oldValue.get(0).getBdCorpEntity();//表头销售公司
BdCorpEntity deliverGoodsCorp = oldValue.get(0).getDeliverGoodsCorp();//发货公司
BdCalbodyEntity bdCalbodyEntity = oldValue.get(0).getBdCalbodyEntity();//发货仓库组织
@ -317,7 +319,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
SaleorderRequestDto saleorderRequestDto = new SaleorderRequestDto();
SaleorderRequestParentDto saleorderRequestParentDto = new SaleorderRequestParentDto();
saleorderRequestParentDto.setDbilldate(generateBusinessDate);//单据日期
saleorderRequestParentDto.setBretinvflag("N");//退货标记
saleorderRequestParentDto.setBretinvflag("Y");//退货标记
saleorderRequestParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程
saleorderRequestParentDto.setCcalbodyid(bdCalbodyEntity.getPkCalbody());//库存组织
saleorderRequestParentDto.setCcustomerid(bdCumandocEntity.getPkCumandoc());//客户=开票单位=收货单位=表体收货单位=收货单位
@ -331,10 +333,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
saleorderRequestParentDto.setDapprovedate(generateBusinessDate);//审核日期
saleorderRequestParentDto.setNdiscountrate("100.000000");//整单折扣
saleorderRequestParentDto.setPk_corp(bdCorpEntity.getPkCorp());//公司id
//汇总单号=汇总维度
saleorderRequestParentDto.setVdef18(keyGroup);
//平台
saleorderRequestParentDto.setPk_defdoc2(platformArchives.getPkDefdoc());
saleorderRequestParentDto.setVdef2(platformArchives.getDocname());
@ -347,10 +347,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
saleorderRequestDto.setChildrenvo(saleorderRequestChildrenDtoList);
//把汇总好的出库单明细行合并成一行
SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue);
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue);
//存货管理档案取发货公司的存货管理档案
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(sonDetailsDto, bdCalbodyEntity.getPkCorp());
BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(goodsRertunSonDetailsDto, bdCalbodyEntity.getPkCorp());
//存货基础档案
BdInvbasdocEntity bdInvbasdocEntity = queryStockBasicArchives(bdInvmandocEntity.getPkInvmandoc(), deliverGoodsCorp.getPkCorp());
@ -363,16 +363,16 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
BigDecimal noriginalcurmny = null;//无税金额
BigDecimal noriginalcurtaxprice = null;//含税单价
BigDecimal noriginalcursummny = null;//价税合计
BigDecimal noriginalcurtaxmny = null;//税额
BigDecimal noriginalcurtaxmny = null;//税额=价税合计-无税金额
try {
noriginalcurtaxprice = sonDetailsDto.getGroupTotalPayAmount().divide(sonDetailsDto.getGroupShipQty(), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
noriginalcurtaxprice = goodsRertunSonDetailsDto.getGroupTotalPayAmount().divide(goodsRertunSonDetailsDto.getGroupShipQty(), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
noriginalcurprice = noriginalcurtaxprice.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
noriginalcurmny = noriginalcurprice.multiply(sonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP);
noriginalcursummny = noriginalcurtaxprice.multiply(sonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP);
noriginalcurmny = noriginalcurprice.multiply(goodsRertunSonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP);
noriginalcursummny = noriginalcurtaxprice.multiply(goodsRertunSonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP);
noriginalcurtaxmny = noriginalcursummny.subtract(noriginalcurmny).setScale(2, BigDecimal.ROUND_HALF_UP);
} catch (Exception e) {
logger.error("TOC金额计算错误", e);
Assert.state(false, "金额计算错误,原因:{}" + e.getMessage());
Assert.state(false, "U8C红字销售订单金额计算错误原因{}", e.getMessage());
}
//判断是否为赠品
@ -385,41 +385,36 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
saleorderRequestChildrenDto.setBlargessflag(isblargessflag);//是否赠品
saleorderRequestChildrenDto.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
saleorderRequestChildrenDto.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
saleorderRequestChildrenDto.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码这个字段不需要给openapi接口而是提供给下游方法使用
saleorderRequestChildrenDto.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
saleorderRequestChildrenDto.setCcurrencytypeid("00010000000000000001");//币种
saleorderRequestChildrenDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());//存货id
saleorderRequestChildrenDto.setCinventorycode(bdInvbasdocEntity.getInvcode());//存货编码
saleorderRequestChildrenDto.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
saleorderRequestChildrenDto.setDconsigndate(generateBusinessDate);//计划发货日期
saleorderRequestChildrenDto.setDdeliverdate(generateBusinessDate);//要求收货日期
saleorderRequestChildrenDto.setDdeliverdate(generateBusinessDate);// 要求收货日期
saleorderRequestChildrenDto.setNexchangeotobrate("1.00000000");//折本汇率
saleorderRequestChildrenDto.setNitemdiscountrate("100.000000");//单品折扣
saleorderRequestChildrenDto.setNnumber(String.valueOf(sonDetailsDto.getGroupShipQty()));//数量
saleorderRequestChildrenDto.setNnumber("-" + goodsRertunSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString());//数量
saleorderRequestChildrenDto.setNoriginalcurdiscountmny("0");//折扣额
saleorderRequestChildrenDto.setNoriginalcurmny(noriginalcurmny.stripTrailingZeros().toPlainString());//无税金额
saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价
saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价
saleorderRequestChildrenDto.setNoriginalcursummny(noriginalcursummny.stripTrailingZeros().toPlainString());//价税合计
saleorderRequestChildrenDto.setNoriginalcurtaxmny(noriginalcurtaxmny.stripTrailingZeros().toPlainString());//税额
saleorderRequestChildrenDto.setNoriginalcurmny("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//无税金额
// saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价
// saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价
saleorderRequestChildrenDto.setNoriginalcursummny("-" + noriginalcursummny.stripTrailingZeros().toPlainString());//价税合计
saleorderRequestChildrenDto.setNoriginalcurtaxmny("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//税额
saleorderRequestChildrenDto.setNoriginalcurtaxnetprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税净价
saleorderRequestChildrenDto.setNoriginalcurtaxprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税单价
saleorderRequestChildrenDto.setNtaxrate(new BigDecimal(bdTaxitemsEntity1.getTaxratio()).stripTrailingZeros().toPlainString());//税率
// saleorderRequestChildrenDto.setCreccalbodyid(bdCalbodyEntity1.getPkCalbody());//收货库存组织2024年8月7日 16:21:48 和佳妮道品一起测试收货库存组织收货仓库 是不需要传递的
// saleorderRequestChildrenDto.setCrecwareid(bdStordocEntity1.getPkStordoc());//收货仓库
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto);
//销售订单单据推送到u8c
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
saleorderRequestDtoList.add(saleorderRequestDto);
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
stringStringMap.put("saleorder", saleorderRequestDtoList);
SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
logger.info("销售订单编号:{} 销售公司:{}", soSaleResultRootDto.getParentvo().getVreceiptcode(), soSaleResultRootDto.getParentvo().getPk_corp());
//记录成功
} catch (Exception e) {
logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常", e);
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常", e);
//记录失败
}
}
@ -435,18 +430,18 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
}
/**
* 2024年7月31日 10:34:09
* 生成业务日期以发货时间作为业务日期
* 2024年8月9日 15:43:13
* 生成业务日期入库时间还是取结束收货时间
*
* @author liuyang
*/
private String createGenerateBusinessDate(HeaderDto header) {
if (header != null && header.getShipAt() != null) {
private String createGenerateBusinessDate(ReturnGoodSearchHeaderDto header) {
if (header != null && header.getCheckInTo() != null) {
//TOC以出库日期作为业务日期
String shipAt = header.getShipAt();
String checkInTo = header.getCheckInTo();
String businessFormat = null;
try {
Date dbill = DateUtil.parse(shipAt);
Date dbill = DateUtil.parse(checkInTo);
businessFormat = DateUtil.format(dbill, "yyyy-MM-dd");
} catch (Exception e) {
e.printStackTrace();
@ -454,8 +449,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
}
return businessFormat;
} else {
logger.error("生成出库日期失败或者shipAt为空! json{}", JSON.toJSON(header));
Assert.state(false, "生成出库日期失败或者shipAt为空! json{}", JSON.toJSON(header));
logger.error("生成入库日期失败或者checkInTo为空! json{}", JSON.toJSON(header));
Assert.state(false, "生成入库日期失败或者checkInTo为空! json{}", JSON.toJSON(header));
return null;
}
}
@ -465,26 +460,27 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
*
* @author liuyang
*/
private List<SonDetailsDto> queryBasicArchives(List<HeaderDetailsDto> headerDetailsDtoList) {
List<SonDetailsDto> sonDetailsDtoList = new ArrayList<>();
private List<GoodsRertunSonDetailsDto> queryBasicArchives(List<ReturnGoodHeaderDetailsDataDto> returnGoodHeaderDetailsDataDtoList1) {
List<GoodsRertunSonDetailsDto> sonDetailsDtoList = new ArrayList<>();
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
try {
//初始化档案缓存
basicArchivesCacheUtil.initCache();
tocReturnBasicArchivesCacheUtil.initCache();
for (int i = 0; i < headerDetailsDtoList.size(); i++) {
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
HeaderDto header = headerDetailsDto.getHeader();
List<DetailsDto> details = headerDetailsDto.getDetails();
for (int i = 0; i < returnGoodHeaderDetailsDataDtoList1.size(); i++) {
ReturnGoodHeaderDetailsDataDto returnGoodHeaderDetailsDataDto = returnGoodHeaderDetailsDataDtoList1.get(i);
ReturnGoodSearchHeaderDto header = returnGoodHeaderDetailsDataDto.getHeader();
List<ReturnGoodSearchDetailsDto> details = returnGoodHeaderDetailsDataDto.getDetails();
//表头公司通过名称匹配U8C公司
String corpName = "上海丽知品牌管理有限公司";
BdCorpEntity bdCorpEntity = BasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName);
Assert.notNull(bdCorpEntity, "根据公司名称({})没有匹配到U8C公司档案", corpName);
// String corpName = "上海丽知品牌管理有限公司";
Assert.notNull(header.getCompanyCode(), "O货主编码不能为空");
BdCorpEntity bdCorpEntity = TocReturnBasicArchivesCacheUtil.stringBdCorpEntityMap.get(header.getCompanyCode());
Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode());
//发货库存组织
BdCalbodyEntity bdCalbodyEntity = BasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp());
BdCalbodyEntity bdCalbodyEntity = TocReturnBasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp());
Assert.notNull(bdCalbodyEntity, "根据公司主键没有查询到发货库存组织 公司主键:{}", bdCorpEntity.getPkCorp());
//发货公司暂时把O表头公司作为发货公司正常情况下需要把O库存地点对于的公司作为发货公司
@ -493,7 +489,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
//2024年8月5日 15:06:38 仓库O与U两边仓库编码是一致的和妮姐确认过了
String facilityCode = header.getFacilityCode();
Assert.notNull(facilityCode, "O仓库编码不能为空");
BdStordocEntity bdStordocEntity = BasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody());
BdStordocEntity bdStordocEntity = TocReturnBasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody());
Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码{}", facilityCode, bdCalbodyEntity.getPkCalbody());
//2024年8月5日 15:25:07 收货库存组织收货仓库默认和发货库存组织发货仓库一致已经和佳妮确认
@ -501,51 +497,51 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
//收货仓库通过收货库存组织+仓库编码确定收货仓库
//销售组织2024年8月5日 15:33:40 和妮姐确认销售组织和表头公司作为一对一的关系
BdSalestruEntity bdSalestruEntity = BasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname());
BdSalestruEntity bdSalestruEntity = TocReturnBasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname());
Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
//业务部门暂定的部门名称其他2024年8月5日 15:39:42 已经和妮姐确认
BdDeptdocEntity bdDeptdocEntity = BasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp());
BdDeptdocEntity bdDeptdocEntity = TocReturnBasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp());
Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp());
//客商基本档案
//TODO 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1O没有店铺信息查询接口因此无法通过出库单的店铺编码查询到O店铺档案对应的业务编码接口上线之后需要补充这一部分逻辑
String custName = "天猫intoyou旗舰店-自营";
BdCubasdocEntity bdCubasdocEntity = BasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName);
BdCubasdocEntity bdCubasdocEntity = TocReturnBasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName);
Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", custName);
//客商管理档案2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案已经和妮姐确认
//2024年8月5日 15:49:49 先根据O店铺编码得到店铺档案信息取到名称通过U8C接口查询出来
//目前O店铺信息查询接口还没有等待开发所以我这里先写所一个名字
BdCumandocEntity bdCumandocEntity = BasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
BdCumandocEntity bdCumandocEntity = TocReturnBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营");
//查找平台
BdDefdocEntity bdDefdocEntity = BasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode());
BdDefdocEntity bdDefdocEntity = TocReturnBasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode());
Assert.notNull(bdDefdocEntity, "根据O平台编码({})无法匹配到平台", header.getSourcePlatformCode());
//字段拷贝
for (int j = 0; j < details.size(); j++) {
DetailsDto detailsDto = details.get(j);
ReturnGoodSearchDetailsDto returnGoodSearchDetailsDto = details.get(j);
//2024年8月6日 10:16:22 通过O出库单的表头查询得出U8C档案放在表体的原因是方便分组汇总
//下一个步骤的分组汇总是通过表体明细完成的
SonDetailsDto sonDetailsDto = new SonDetailsDto();
sonDetailsDto.setHeader(header);
sonDetailsDto.setBdCorpEntity(bdCorpEntity);
sonDetailsDto.setDeliverGoodsCorp(bdCorpEntity);
sonDetailsDto.setBdCalbodyEntity(bdCalbodyEntity);
sonDetailsDto.setBdStordocEntity(bdStordocEntity);
sonDetailsDto.setBdCalbodyEntity1(bdCalbodyEntity);
sonDetailsDto.setBdStordocEntity1(bdStordocEntity);
sonDetailsDto.setBdSalestruEntity(bdSalestruEntity);
sonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity);
sonDetailsDto.setBdCumandocEntity(bdCumandocEntity);
sonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity);
sonDetailsDto.setPlatformArchives(bdDefdocEntity);
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = new GoodsRertunSonDetailsDto();
goodsRertunSonDetailsDto.setHeader(header);
goodsRertunSonDetailsDto.setBdCorpEntity(bdCorpEntity);
goodsRertunSonDetailsDto.setDeliverGoodsCorp(bdCorpEntity);
goodsRertunSonDetailsDto.setBdCalbodyEntity(bdCalbodyEntity);
goodsRertunSonDetailsDto.setBdStordocEntity(bdStordocEntity);
goodsRertunSonDetailsDto.setBdCalbodyEntity1(bdCalbodyEntity);
goodsRertunSonDetailsDto.setBdStordocEntity1(bdStordocEntity);
goodsRertunSonDetailsDto.setBdSalestruEntity(bdSalestruEntity);
goodsRertunSonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity);
goodsRertunSonDetailsDto.setBdCumandocEntity(bdCumandocEntity);
goodsRertunSonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity);
goodsRertunSonDetailsDto.setPlatformArchives(bdDefdocEntity);
BeanUtil.copyPropertiesV2(detailsDto, sonDetailsDto);
sonDetailsDtoList.add(sonDetailsDto);
BeanUtil.copyPropertiesV2(returnGoodSearchDetailsDto, goodsRertunSonDetailsDto);
sonDetailsDtoList.add(goodsRertunSonDetailsDto);
}
}
//成功
@ -561,36 +557,40 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
/**
* bean copy
* 2024年7月31日 10:34:09
* 2024年8月9日 11:23:57
*/
private List<TocofsSaleoutEntity> copyHeaderDto(List<HeaderDto> headerDtoList) {
List<TocofsSaleoutEntity> tocofsSaleoutEntityList = new ArrayList<>();
if (headerDtoList != null && headerDtoList.size() > 0) {
for (int i = 0; i < headerDtoList.size(); i++) {
HeaderDto headerDto = headerDtoList.get(i);
TocofsSaleoutEntity tocofsSaleoutEntity = new TocofsSaleoutEntity();
// BeanUtils.copyProperties(headerDto, tocofsSaleoutEntity);
BeanUtil.copyPropertiesV2(headerDto, tocofsSaleoutEntity);
tocofsSaleoutEntityList.add(tocofsSaleoutEntity);
private List<TocofsReturngoodsEntity> copyHeaderDto(List<ReturnGoodSearchHeaderDto> returnGoodSearchHeaderDtos) {
List<TocofsReturngoodsEntity> tocofsReturngoodsEntityArrayList = new ArrayList<>();
if (returnGoodSearchHeaderDtos != null && returnGoodSearchHeaderDtos.size() > 0) {
for (int i = 0; i < returnGoodSearchHeaderDtos.size(); i++) {
ReturnGoodSearchHeaderDto headerDto = returnGoodSearchHeaderDtos.get(i);
TocofsReturngoodsEntity tocofsReturngoodsEntity = new TocofsReturngoodsEntity();
BeanUtil.copyPropertiesV2(headerDto, tocofsReturngoodsEntity);
tocofsReturngoodsEntityArrayList.add(tocofsReturngoodsEntity);
}
} else {
logger.info("需要复制{}个bean对象(O表头)", returnGoodSearchHeaderDtos.size());
}
return tocofsSaleoutEntityList;
return tocofsReturngoodsEntityArrayList;
}
/**
* bean copy
* 2024年8月2日 16:04:11
* 2024年8月9日 11:24:01
*/
private List<TocofsSaleoutDetailedEntity> copyDetailsDto(List<DetailsDto> detailsDtos) {
List<TocofsSaleoutDetailedEntity> tocofsSaleoutDetailedEntityArrayList = new ArrayList<>();
if (detailsDtos != null && detailsDtos.size() > 0) {
for (int i = 0; i < detailsDtos.size(); i++) {
DetailsDto detailsDto = detailsDtos.get(i);
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
// BeanUtils.copyProperties(detailsDto, tocofsSaleoutDetailedEntity);
BeanUtil.copyPropertiesV2(detailsDto, tocofsSaleoutDetailedEntity);
tocofsSaleoutDetailedEntityArrayList.add(tocofsSaleoutDetailedEntity);
private List<TocofsReturngoodsDetailedEntity> copyDetailsDto(List<ReturnGoodSearchDetailsDto> headerDetailsDtoList2) {
List<TocofsReturngoodsDetailedEntity> tocofsSaleoutDetailedEntityArrayList = new ArrayList<>();
if (headerDetailsDtoList2 != null && headerDetailsDtoList2.size() > 0) {
for (int i = 0; i < headerDetailsDtoList2.size(); i++) {
ReturnGoodSearchDetailsDto returnGoodSearchDetailsDto = headerDetailsDtoList2.get(i);
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
BeanUtil.copyPropertiesV2(returnGoodSearchDetailsDto, tocofsReturngoodsDetailedEntity);
tocofsSaleoutDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
}
} else {
logger.info("需要复制{}个bean对象(O表体)", tocofsSaleoutDetailedEntityArrayList.size());
}
return tocofsSaleoutDetailedEntityArrayList;
}
@ -600,21 +600,21 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
*
* @author liuyang
*/
private Map<String, List<SonDetailsDto>> groupSummary(List<SonDetailsDto> sonDetailsDtoList) {
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
private Map<String, List<GoodsRertunSonDetailsDto>> groupSummary(List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtos) {
if (goodsRertunSonDetailsDtos != null && goodsRertunSonDetailsDtos.size() > 0) {
for (int i = 0; i < goodsRertunSonDetailsDtos.size(); i++) {
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = goodsRertunSonDetailsDtos.get(i);
//2024年8月6日 10:35:25表头对象用于带出表头相关的分组汇总信息
HeaderDto header = sonDetailsDto.getHeader();
ReturnGoodSearchHeaderDto header = goodsRertunSonDetailsDto.getHeader();
//公司
BdCorpEntity bdCorpEntity = sonDetailsDto.getBdCorpEntity();
BdCorpEntity bdCorpEntity = goodsRertunSonDetailsDto.getBdCorpEntity();
//店铺主要是店铺编码
String storeCode = header.getStoreCode();
//仓库
String facilityCode = header.getFacilityCode();
//SKU
String skuCode = sonDetailsDto.getSkuCode();
String skuCode = goodsRertunSonDetailsDto.getSkuCode();
//出库类型
String refOrderType = header.getRefOrderType();
@ -653,10 +653,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
summaryDimensionStr.append(NOTHING);
}
sonDetailsDto.setSummaryDimensionStr(summaryDimensionStr.toString());
goodsRertunSonDetailsDto.setSummaryDimensionStr(summaryDimensionStr.toString());
}
logger.info("TOC{}个出库单对象需要汇总", sonDetailsDtoList.size());
return sonDetailsDtoList.stream().collect(Collectors.groupingBy(SonDetailsDto::getSummaryDimensionStr));
logger.info("TOC{} 个出库单对象需要汇总", goodsRertunSonDetailsDtos.size());
return goodsRertunSonDetailsDtos.stream().collect(Collectors.groupingBy(GoodsRertunSonDetailsDto::getSummaryDimensionStr));
}
logger.info("TOC0个对象需要汇总");
return null;
@ -682,7 +682,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
*
* @author liuyang
*/
private void checkArchives(SonDetailsDto sonDetailsDto) {
private void checkArchives(GoodsRertunSonDetailsDto sonDetailsDto) {
Assert.notNull(sonDetailsDto, "sonDetailsDto不能为空 对象json{}", JSON.toJSONString(sonDetailsDto));
Assert.notNull(sonDetailsDto.getHeader(), "header对象不能为空 对象json{}", JSON.toJSONString(sonDetailsDto));
Assert.notNull(sonDetailsDto.getBdCorpEntity(), "表头公司不能为空 对象json{}", JSON.toJSONString(sonDetailsDto));
@ -698,17 +698,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
/**
* 查询存货管理档案
*
* @param pkCorp 发货公司主键
* @param sonDetailsDto 出库单存货明细行
* @param pkCorp 发货公司主键
* @param goodsRertunSonDetailsDto 出库单存货明细行
* @author liuyang
*/
private BdInvmandocEntity queryInventoryMan(SonDetailsDto sonDetailsDto, String pkCorp) {
Assert.notNull(sonDetailsDto, "sonDetailsDto不能为空");
Assert.notNull(sonDetailsDto.getSkuCode(), "O存货商家编码不能为空");
private BdInvmandocEntity queryInventoryMan(GoodsRertunSonDetailsDto goodsRertunSonDetailsDto, String pkCorp) {
Assert.notNull(goodsRertunSonDetailsDto, "sonDetailsDto不能为空");
Assert.notNull(goodsRertunSonDetailsDto.getSkuCode(), "O存货商家编码不能为空");
Assert.notNull(pkCorp, "发货公司主键不能为空");
BdInvmandocEntity bdInvmandocEntity = BasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(sonDetailsDto.getSkuCode() + pkCorp);
Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 存货商家编码:{} 存货发货公司:{}", sonDetailsDto.getSkuCode(), pkCorp);
BdInvmandocEntity bdInvmandocEntity = TocReturnBasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(goodsRertunSonDetailsDto.getSkuCode() + pkCorp);
Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 存货商家编码:{} 存货发货公司:{}", goodsRertunSonDetailsDto.getSkuCode(), pkCorp);
return bdInvmandocEntity;
}
@ -716,30 +716,31 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
* 合并明细行
* 单价计算公式sum(实付金额/实发数量) 最后除以条数
*
* @param sonDetailsDtoList 汇总过后的售后入库单明细
* @author liuyang
*/
private SonDetailsDto groupMergeDetailedRows(List<SonDetailsDto> sonDetailsDtoList) throws Exception {
private GoodsRertunSonDetailsDto groupMergeDetailedRows(List<GoodsRertunSonDetailsDto> sonDetailsDtoList) throws Exception {
if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
BigDecimal groupTotalPayAmount = new BigDecimal("0");
BigDecimal groupShipQty = new BigDecimal("0");
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i);
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = sonDetailsDtoList.get(i);
//实付金额/实发数量
Assert.notNull(sonDetailsDto.getTotalPayAmount(), "实付金额不能为空 明细行对象:{}", JSON.toJSONString(sonDetailsDto));
Assert.notNull(sonDetailsDto.getShipQty(), "实发数量不能为空 明细行对象:{}", JSON.toJSONString(sonDetailsDto));
BigDecimal totalPayAmountBigDecimal = new BigDecimal(sonDetailsDto.getTotalPayAmount());
BigDecimal shipQtyBigDecimal = new BigDecimal(sonDetailsDto.getShipQty());
Assert.notNull(goodsRertunSonDetailsDto.getTotalAmount(), "退货入库单总金额不能为空 明细行对象:{}", JSON.toJSONString(goodsRertunSonDetailsDto));
Assert.notNull(goodsRertunSonDetailsDto.getReceivedQty(), "实收数量不能为空 明细行对象:{}", JSON.toJSONString(goodsRertunSonDetailsDto));
BigDecimal totalPayAmountBigDecimal = new BigDecimal(goodsRertunSonDetailsDto.getTotalAmount());
BigDecimal shipQtyBigDecimal = new BigDecimal(goodsRertunSonDetailsDto.getReceivedQty());
groupTotalPayAmount = groupTotalPayAmount.add(totalPayAmountBigDecimal);
groupShipQty = groupShipQty.add(shipQtyBigDecimal);
}
SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(0);
sonDetailsDto.setGroupShipQty(groupShipQty);
sonDetailsDto.setGroupTotalPayAmount(groupTotalPayAmount);
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = sonDetailsDtoList.get(0);
goodsRertunSonDetailsDto.setGroupShipQty(groupShipQty);
goodsRertunSonDetailsDto.setGroupTotalPayAmount(groupTotalPayAmount);
logger.info("{}个明细行发生了合并!", sonDetailsDtoList.size());
return sonDetailsDto;
return goodsRertunSonDetailsDto;
} else {
logger.info("sonDetailsDtoList集合是空的");
}
@ -755,7 +756,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
private BdInvbasdocEntity queryStockBasicArchives(String pkInvmandoc, String pkCorp) {
Assert.notNull(pkInvmandoc, "存货管理档案不能为空");
Assert.notNull(pkCorp, "公司档案不能为空");
BdInvbasdocEntity bdInvbasdocEntity = BasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp);
BdInvbasdocEntity bdInvbasdocEntity = TocReturnBasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp);
Assert.notNull(bdInvbasdocEntity, "根据公司主键:{} 和存货管理档案主键:{} 没有查询到存货基本档案", pkCorp, pkInvmandoc);
return bdInvbasdocEntity;
}
@ -768,7 +769,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
*/
private BdTaxitemsEntity queryBdTaxitems(String invcode) {
Assert.notNull(invcode, "存货编码不能为空");
BdTaxitemsEntity bdTaxitemsEntity = BasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode);
BdTaxitemsEntity bdTaxitemsEntity = TocReturnBasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode);
Assert.notNull(bdTaxitemsEntity, "根据存货编码({}),无法匹配到税率!", invcode);
return bdTaxitemsEntity;
}
@ -832,5 +833,4 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
return null;
}
}

View File

@ -0,0 +1,96 @@
package com.hzya.frame.plugin.lets.u8cdto;
import com.hzya.frame.plugin.lets.entity.*;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.ttxofs.dto.u8cson
* @ProjectkangarooDataCenterV3
* @nameSonDetailsDto
* @Date2024/8/5 16:07
* @FilenameSonDetailsDto
*/
@Data
public class GoodsRertunSonDetailsDto extends ReturnGoodSearchDetailsDto {
/**
* 表头对象
*/
private ReturnGoodSearchHeaderDto header;
/**
* 表头公司销售公司
*/
private BdCorpEntity bdCorpEntity;
/**
* 发货库存组织
*/
private BdCalbodyEntity bdCalbodyEntity;
/**
* 发货仓库
*/
private BdStordocEntity bdStordocEntity;
/**
* 收货库存组织
*/
private BdCalbodyEntity bdCalbodyEntity1;
/**
* 收货仓库
*/
private BdStordocEntity bdStordocEntity1;
/**
* 销售组织
*/
private BdSalestruEntity bdSalestruEntity;
/**
* 业务部门
*/
private BdDeptdocEntity bdDeptdocEntity;
/**
* 客商管理档案
*/
private BdCumandocEntity bdCumandocEntity;
/**
* 客商基本档案
*/
private BdCubasdocEntity bdCubasdocEntity;
/**
* 生成汇总维度字符串
*/
private String summaryDimensionStr;
/**
* 汇总总金额
*/
private BigDecimal groupTotalPayAmount;
/**
* 汇总实发数量
*/
private BigDecimal groupShipQty;
/**
* 发货公司
*/
private BdCorpEntity deliverGoodsCorp;
/**
* U8C平台档案
*/
private BdDefdocEntity platformArchives;
}

View File

@ -10,7 +10,7 @@ import java.util.List;
import java.util.Map;
/**
* 档案类缓存TOC转换
* 档案类缓存TOC销售订单转换
*
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
@ -20,7 +20,7 @@ import java.util.Map;
* @FilenameBasicArchivesCacheUtil
*/
@Component
public class BasicArchivesCacheUtil {
public class TocOrderBasicArchivesCacheUtil {
@Autowired
private IBdCorpDao iBdCorpDao;
@ -309,5 +309,4 @@ public class BasicArchivesCacheUtil {
initBdCubasdoc();
initSourcePlatform();
}
}

View File

@ -0,0 +1,312 @@
package com.hzya.frame.plugin.lets.util;
import com.hzya.frame.plugin.lets.dao.*;
import com.hzya.frame.plugin.lets.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 档案类缓存TOC销售订单转换
*
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
* @ProjectkangarooDataCenterV3
* @nameBasicArchivesCacheUtil
* @Date2024/7/31 11:27
* @FilenameBasicArchivesCacheUtil
*/
@Component
public class TocReturnBasicArchivesCacheUtil {
@Autowired
private IBdCorpDao iBdCorpDao;
@Autowired
private IBdStordocDao iBdStordocDao;
@Autowired
private IBdCalbodyDao iBdCalbodyDao;
@Autowired
private IBdSalestruDao iBdSalestruDao;
@Autowired
private IBdDeptdocDao iBdDeptdocDao;
@Autowired
private IBdCumandocDao iBdCumandocDao;
@Autowired
private IBdInvmandocDao iBdInvmandocDao;
@Autowired
private IBdInvbasdocDao iBdInvbasdocDao;
@Autowired
private IBdTaxitemsDao iBdTaxitemsDao;
@Autowired
private IBdCubasdocDao iBdCubasdocDao;
@Autowired
private IBdDefdocDao iBdDefdocDao;
/**
* 初始化公司档案-表头公司
* 2024年7月31日 11:16:23
*/
public static Map<String, BdCorpEntity> stringBdCorpEntityMap = new HashMap<>();
private void initShop() throws Exception {
BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c");
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList != null && bdCorpEntityList.size() > 0) {
for (int i = 0; i < bdCorpEntityList.size(); i++) {
BdCorpEntity bdCorpEntity1 = bdCorpEntityList.get(i);
stringBdCorpEntityMap.put(bdCorpEntity1.getUnitcode(), bdCorpEntity1);
}
}
}
/**
* 初始化发货仓库
* 2024年7月31日 11:16:27
* 202403011513仓库根据仓库编码+库存组织编码去查询之前是仓库编码+公司主键和李佳妮确认好了
*/
public static Map<String, BdStordocEntity> stringBdStordocEntityMap = new HashMap<>();
private void initBdStordoc() throws Exception {
BdStordocEntity bdStordocEntity = new BdStordocEntity();
bdStordocEntity.setDr(0L);
bdStordocEntity.setDataSourceCode("lets_u8c");
List<BdStordocEntity> bdStordocEntityList = iBdStordocDao.query(bdStordocEntity);
if (bdStordocEntityList != null && bdStordocEntityList.size() > 0) {
for (int i = 0; i < bdStordocEntityList.size(); i++) {
BdStordocEntity bdStordocEntity1 = bdStordocEntityList.get(i);
stringBdStordocEntityMap.put(bdStordocEntity1.getStorcode() + bdStordocEntity1.getPkCalbody(), bdStordocEntity1);
}
}
}
/**
* 2024年7月31日 11:09:12 查询发货库存组织
*/
public static Map<String, BdCalbodyEntity> stringBdCalbodyEntityMap = new HashMap<>();
private void initBdCalbody() throws Exception {
BdCalbodyEntity bdCalbodyEntity = new BdCalbodyEntity();
bdCalbodyEntity.setDr(0);
bdCalbodyEntity.setDataSourceCode("lets_u8c");
List<BdCalbodyEntity> bdCalbodyEntities = iBdCalbodyDao.query(bdCalbodyEntity);
if (bdCalbodyEntities != null && bdCalbodyEntities.size() > 0) {
for (int i = 0; i < bdCalbodyEntities.size(); i++) {
BdCalbodyEntity bdCalbodyEntity1 = bdCalbodyEntities.get(i);
stringBdCalbodyEntityMap.put(bdCalbodyEntity1.getPkCorp(), bdCalbodyEntity1);
}
}
}
/**
* 初始化销售组织
*/
public static Map<String, BdSalestruEntity> stringBdSalestruEntityMap = new HashMap<>();
private void initBdSalestru() throws Exception {
BdSalestruEntity bdSalestruEntity = new BdSalestruEntity();
bdSalestruEntity.setDr(0);
bdSalestruEntity.setDataSourceCode("lets_u8c");
List<BdSalestruEntity> bdSalestruEntityList = iBdSalestruDao.query(bdSalestruEntity);
if (bdSalestruEntityList != null && bdSalestruEntityList.size() > 0) {
for (int i = 0; i < bdSalestruEntityList.size(); i++) {
BdSalestruEntity bdSalestruEntity1 = bdSalestruEntityList.get(i);
stringBdSalestruEntityMap.put(bdSalestruEntity1.getVsalestruname(), bdSalestruEntity1);
}
}
}
/**
* 初始化业务部门
*
* @author liuyang
*/
public static Map<String, BdDeptdocEntity> stringBdDeptdocEntityMap = new HashMap<>();
private void initDept() {
BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity();
bdDeptdocEntity.setDataSourceCode("lets_u8c");
bdDeptdocEntity.setDr(0);
bdDeptdocEntity.setDeptname("其他部门");
List<BdDeptdocEntity> bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity);
if (bdDeptdocEntityList != null && bdDeptdocEntityList.size() > 0) {
for (int i = 0; i < bdDeptdocEntityList.size(); i++) {
BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList.get(i);
stringBdDeptdocEntityMap.put(bdDeptdocEntity1.getPkCorp(), bdDeptdocEntity1);
}
}
}
/**
* 初始化客商基本档案
*
* @author liuyang
*/
public static Map<String, BdCubasdocEntity> stringBdCubasdocEntityHashMap = new HashMap<>();
private void initBdCubasdoc() {
BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity();
bdCubasdocEntity.setDataSourceCode("lets_u8c");
bdCubasdocEntity.setDr(0L);
List<BdCubasdocEntity> bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity);
if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) {
for (int i = 0; i < bdCumandocEntityList.size(); i++) {
BdCubasdocEntity bdCubasdocEntity1 = bdCumandocEntityList.get(i);
stringBdCubasdocEntityHashMap.put(bdCubasdocEntity1.getCustname(), bdCubasdocEntity1);
}
}
}
/**
* 初始化客商管理档案
*
* @author liuyang
*/
public static Map<String, BdCumandocEntity> stringBdCumandocEntityMap = new HashMap<>();
private void initBdCumandoc() {
BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity();
bdCumandocEntity1.setDataSourceCode("lets_u8c");
bdCumandocEntity1.setDr(0L);
// bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);//客商:2客户
List<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1);
if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) {
for (int i = 0; i < bdCumandocEntityList.size(); i++) {
BdCumandocEntity bdCumandocEntity = bdCumandocEntityList.get(i);
stringBdCumandocEntityMap.put(bdCumandocEntity.getPkCubasdoc() + bdCumandocEntity.getPkCorp(), bdCumandocEntity);
}
}
}
/**
* 初始化存货管理档案
*/
public static Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = new HashMap<>();
private void initInventoryFile() throws Exception {
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
// bdInvmandocEntity.setInvcode(copyRowDetailsListVo.getSpec_no());
// bdInvmandocEntity.setPkCorp(shippingCompanyBdCorpEntity.getPkCorp());
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
if (bdInvmandocEntity2 != null && bdInvmandocEntity2.size() > 0) {
for (int i = 0; i < bdInvmandocEntity2.size(); i++) {
BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(i);
//2024年8月6日 14:27:45 通过存货编码+公司缓存
stringBdInvmandocEntityMap.put(bdInvmandocEntity1.getInvcode() + bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1);
}
}
}
/**
* 初始化存货基本档案
* 2024年8月7日 10:57:55
*/
public static Map<String, BdInvbasdocEntity> stringBdInvbasdocEntityHashMap = new HashMap<>();
private void initBasicInventoryFile() throws Exception {
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
// bdInvbasdocEntity.setPk_invmandoc(bdInvmandocEntity1.getPkInvmandoc());
// bdInvbasdocEntity.setPk_corp(shippingCompanyBdCorpEntity.getPkCorp());
List<BdInvbasdocEntity> bdInvbasdocEntity2 = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV2(bdInvbasdocEntity);
if (bdInvbasdocEntity2 != null && bdInvbasdocEntity2.size() > 0) {
for (int i = 0; i < bdInvbasdocEntity2.size(); i++) {
BdInvbasdocEntity bdInvbasdocEntity1 = bdInvbasdocEntity2.get(i);
stringBdInvbasdocEntityHashMap.put(bdInvbasdocEntity1.getPk_invmandoc() + bdInvbasdocEntity1.getPk_corp_man(), bdInvbasdocEntity1);
}
}
}
/**
* 2024年8月7日 10:59:30
* 初始化存货税率
*
* @author liuyang
*/
public static Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityHashMap = new HashMap<>();
private void initBdTaxitemsEntity() throws Exception {
BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity();
List<BdTaxitemsEntity> bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity);
if (bdTaxitemsEntityList != null && bdTaxitemsEntityList.size() > 0) {
for (int i = 0; i < bdTaxitemsEntityList.size(); i++) {
BdTaxitemsEntity bdTaxitemsEntity1 = bdTaxitemsEntityList.get(i);
stringBdTaxitemsEntityHashMap.put(bdTaxitemsEntity1.getInvcode(), bdTaxitemsEntity1);
}
}
}
/**
* 缓存来源平台逻辑
*
* @author liuyang
*/
public static Map<String, BdDefdocEntity> stringBdDefdocEntityHashMap = new HashMap<>();
private void initSourcePlatform() {
BdDefdocEntity bdDefdocEntity = new BdDefdocEntity();
bdDefdocEntity.setPkDefdoclist("0001A210000000000JUD");
bdDefdocEntity.setDr(0);
bdDefdocEntity.setDataSourceCode("lets_u8c");
List<BdDefdocEntity> bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity);
if (bdDefdocEntityList != null && bdDefdocEntityList.size() > 0) {
for (int i = 0; i < bdDefdocEntityList.size(); i++) {
BdDefdocEntity bdDefdocEntity1 = bdDefdocEntityList.get(i);
stringBdDefdocEntityHashMap.put(bdDefdocEntity1.getDoccode(), bdDefdocEntity1);
}
}
}
/**
* 清理缓存
*
* @author liuyang
*/
public void clearCache() throws Exception {
stringBdCorpEntityMap.clear();
stringBdStordocEntityMap.clear();
stringBdCalbodyEntityMap.clear();
stringBdSalestruEntityMap.clear();
stringBdDeptdocEntityMap.clear();
stringBdCumandocEntityMap.clear();
stringBdInvmandocEntityMap.clear();
stringBdInvbasdocEntityHashMap.clear();
stringBdTaxitemsEntityHashMap.clear();
stringBdCubasdocEntityHashMap.clear();
stringBdDefdocEntityHashMap.clear();
}
/**
* 初始化缓存
*
* @author liuyang
*/
public void initCache() throws Exception {
clearCache();
initShop();
initBdStordoc();
initBdCalbody();
initBdSalestru();
initDept();
initBdCumandoc();
initInventoryFile();
initBasicInventoryFile();
initBdTaxitemsEntity();
initBdCubasdoc();
initSourcePlatform();
}
}

View File

@ -43,6 +43,8 @@
<bean name="iBusidataTocreturnsDao" class="com.hzya.frame.plugin.lets.dao.impl.BusidataTocreturnsDaoImpl"/>
<bean name="iBusidataTocreturnsDetailDao" class="com.hzya.frame.plugin.lets.dao.impl.BusidataTocreturnsDetailDaoImpl"/>
<bean name="iTocofsSaleoutDao" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDaoImpl"/>
<bean name="iTocofsSaleoutDetailedDao" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl"/>
<bean name="iTocofsReturngoodsDao" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDaoImpl"/>
<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="tocofsSaleoutDetailedDaoImpl" class="com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsSaleoutDetailedDaoImpl"/>
</beans>

View File

@ -3,4 +3,7 @@
<beans default-autowire="byName">
<bean name="tocofsSaleoutDetailedService" class="com.hzya.frame.plugin.lets.ofs.service.impl.TocofsSaleoutDetailedServiceImpl"/>
<bean name="tocofsSaleoutService" class="com.hzya.frame.plugin.lets.ofs.service.impl.TocofsSaleoutServiceImpl"/>
<bean name="tocofsReturngoodsDetailedService" class="com.hzya.frame.plugin.lets.ofs.service.impl.TocofsReturngoodsDetailedServiceImpl"/>
<bean name="tocofsReturngoodsService" class="com.hzya.frame.plugin.lets.ofs.service.impl.TocofsReturngoodsServiceImpl"/>
</beans>

View File

@ -7,8 +7,6 @@ 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.jupiter.api.Assertions.*;
/**
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.plugin.sales

View File

@ -2,8 +2,10 @@ package com.hzya.frame.ttxofs.basics;
import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto;
import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleReturnMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodsearch.RertunGoodsRootBean;
import java.util.HashMap;
import java.util.Map;
/**
* api与dto的对应关系
@ -17,10 +19,11 @@ import java.util.HashMap;
*/
public class ApiDtoCacheMap {
public static final HashMap<String, ReturnMessageBasics> apiDtoCacheMap = new HashMap();
public static final Map<String, ReturnMessageBasics> apiDtoCacheMap = new HashMap();
static {
apiDtoCacheMap.put("ofs.salesOrder.search", new SaleReturnMessageDto());
apiDtoCacheMap.put("ofs.shipment.search", new SaleOutReturnMessageDto());
apiDtoCacheMap.put("ofs.receipt.search", new RertunGoodsRootBean());
}
}

View File

@ -0,0 +1,22 @@
/**
* Copyright 2024 bejson.com
*/
package com.hzya.frame.ttxofs.dto.returngoodsearch;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import lombok.Data;
import java.util.List;
/**
* Auto-generated: 2024-08-09 10:15:6
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class RertunGoodsRootBean extends ReturnMessageBasics {
private List<ReturnGoodHeaderDetailsDataDto> data;
}

View File

@ -0,0 +1,22 @@
/**
* Copyright 2024 bejson.com
*/
package com.hzya.frame.ttxofs.dto.returngoodsearch;
import lombok.Data;
import java.util.List;
/**
* Auto-generated: 2024-08-09 10:15:6
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class ReturnGoodHeaderDetailsDataDto {
private ReturnGoodSearchHeaderDto header;
private List<ReturnGoodSearchDetailsDto> details;
}

View File

@ -0,0 +1,46 @@
/**
* Copyright 2024 bejson.com
*/
package com.hzya.frame.ttxofs.dto.returngoodsearch;
import lombok.Data;
/**
* Auto-generated: 2024-08-09 10:15:6
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class ReturnGoodSearchDetailsDto {
private String id;
private String receiptId;
private String receiptCode;
private String refOrderId;
private String refOrderDetailId;
private String sourceOrderCode;
private String clientCode;
private String companyCode;
private String facilityCode;
private String skuCode;
private String skuName;
private String requestQty;
private String receivedQty;
private String openQty;
private String quantityUM;
private String totalWeight;
private String totalVolume;
private String totalVolumeWeight;
private String totalAmount;
private String weightUM;
private String volumeUM;
private String inventorySts;
private String inTransInvId;
private String closed;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
private String discountPrice;
}

View File

@ -0,0 +1,67 @@
/**
* Copyright 2024 bejson.com
*/
package com.hzya.frame.ttxofs.dto.returngoodsearch;
import lombok.Data;
/**
* Auto-generated: 2024-08-09 10:15:6
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class ReturnGoodSearchHeaderDto {
private String id;
private String clientCode;
private String companyCode;
private String storeCode;
private String facilityCode;
private String code;
private String internalInstructionType;
private String bizChannel;
private String refOrderId;
private String refOrderCode;
private String refOrderType;
private String closed;
private String closedBy;
private String status;
private String allowOverReceive;
private String shipFromAttentionTo;
private String shipFromAddress;
private String shipFromCountry;
private String shipFromState;
private String shipFromCity;
private String shipFromDistrict;
private String shipFromMobile;
private String totalLines;
private String totalQty;
private String totalAmount;
private String totalWeight;
private String totalVolume;
private String totalVolumeWeight;
private String totalFulfillAmount;
private String totalFulfillWeight;
private String totalFulfillVolume;
private String totalFulfillVolumeWeight;
private String totalFulfillQty;
private String totalCases;
private String totalContainers;
private String closeAtQty;
private String quantityUM;
private String weightUM;
private String volumeUM;
private String checkInFrom;
private String checkInTo;
private String closedAt;
private String sourcePlatformCode;
private String sourceOrderCode;
private String created;
private String createdBy;
private String lastUpdated;
private String lastUpdatedBy;
private String returnWaybillCode;
private String returnCarrier;
}