Commit ff312084 by wutong

修改同步产品库SKU

parent 75c9e1b8
......@@ -2,15 +2,15 @@ package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bailuntec.domain.entity.DcBaseSkuTemp;
import com.bailuntec.domain.entity.DcBaseSku;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcBaseSkuTempExample;
import com.bailuntec.domain.example.DcBaseSkuExample;
import com.bailuntec.domain.pojo.SkuInfo;
import com.bailuntec.domain.pojo.SkuMsResponse;
import com.bailuntec.domain.pojo.SkuMsResult;
import com.bailuntec.domain.request.SkuCondition;
import com.bailuntec.domain.request.SkumsRequest;
import com.bailuntec.mapper.DcBaseSkuTempMapper;
import com.bailuntec.mapper.DcBaseSkuMapper;
import com.bailuntec.mapper.JobPointLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.OkHttpUtil;
......@@ -85,9 +85,9 @@ public class SkuMSSyncJob extends PointJob {
}
private void handleSkuMsJson(List<SkuInfo> data,JobPointLog jobPointLog) {
DcBaseSkuTemp dcBaseSku = new DcBaseSkuTemp();
DcBaseSku dcBaseSku = new DcBaseSku();
try {
DcBaseSkuTempMapper mapper = SessionUtil.getSession().getMapper(DcBaseSkuTempMapper.class);
DcBaseSkuMapper mapper = SessionUtil.getSession().getMapper(DcBaseSkuMapper.class);
for (SkuInfo skuInfo : data) {
try {
BeanUtils.copyProperties(dcBaseSku,skuInfo);
......@@ -95,7 +95,7 @@ public class SkuMSSyncJob extends PointJob {
throw new RuntimeException("BeanUtils.copyProperties失败");
}
dcBaseSku.setGmtModified(LocalDateTime.now());
int v = mapper.updateByExampleSelective(dcBaseSku, DcBaseSkuTempExample.newAndCreateCriteria().andBailunSkuEqualTo(skuInfo.getBailunSku()).example());
int v = mapper.updateByExampleSelective(dcBaseSku, DcBaseSkuExample.newAndCreateCriteria().andBailunSkuEqualTo(skuInfo.getBailunSku()).example());
if (v == 0) {
mapper.insertSelective(dcBaseSku);
}
......
......@@ -71,6 +71,8 @@
<result column="push_status" jdbcType="TINYINT" property="pushStatus" />
<result column="transfer_delivery" jdbcType="INTEGER" property="transferDelivery" />
<result column="source" jdbcType="TINYINT" property="source" />
<result column="push_time" jdbcType="TIMESTAMP" property="pushTime" />
<result column="has_delete" jdbcType="BIT" property="hasDelete" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -152,7 +154,7 @@
virtual_price, size_image, sales_price, enable, inspection_hours, bargainer, customs_code,
declare_title_en, declare_title_cn, pick_title_cn, pick_title_en, product_nature,
charger_specifications, packing_price, packing_name, packing_size, product_size,
packing_weight, unit, push_status, transfer_delivery, source
packing_weight, unit, push_status, transfer_delivery, source, push_time, has_delete
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuExample" resultMap="BaseResultMap">
<!--
......@@ -234,7 +236,8 @@
product_nature, charger_specifications, packing_price,
packing_name, packing_size, product_size,
packing_weight, unit, push_status,
transfer_delivery, source)
transfer_delivery, source, push_time,
has_delete)
values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{skuImage,jdbcType=VARCHAR},
#{categoryId,jdbcType=INTEGER}, #{categoryName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR},
#{warehouseName,jdbcType=VARCHAR}, #{unitPrice,jdbcType=DECIMAL}, #{sellerId,jdbcType=INTEGER},
......@@ -256,7 +259,8 @@
#{productNature,jdbcType=VARCHAR}, #{chargerSpecifications,jdbcType=VARCHAR}, #{packingPrice,jdbcType=DECIMAL},
#{packingName,jdbcType=VARCHAR}, #{packingSize,jdbcType=VARCHAR}, #{productSize,jdbcType=VARCHAR},
#{packingWeight,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR}, #{pushStatus,jdbcType=TINYINT},
#{transferDelivery,jdbcType=INTEGER}, #{source,jdbcType=TINYINT})
#{transferDelivery,jdbcType=INTEGER}, #{source,jdbcType=TINYINT}, #{pushTime,jdbcType=TIMESTAMP},
#{hasDelete,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseSku">
<!--
......@@ -460,6 +464,12 @@
<if test="source != null">
source,
</if>
<if test="pushTime != null">
push_time,
</if>
<if test="hasDelete != null">
has_delete,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -657,6 +667,12 @@
<if test="source != null">
#{source,jdbcType=TINYINT},
</if>
<if test="pushTime != null">
#{pushTime,jdbcType=TIMESTAMP},
</if>
<if test="hasDelete != null">
#{hasDelete,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuExample" resultType="java.lang.Long">
......@@ -871,6 +887,12 @@
<if test="record.source != null">
source = #{record.source,jdbcType=TINYINT},
</if>
<if test="record.pushTime != null">
push_time = #{record.pushTime,jdbcType=TIMESTAMP},
</if>
<if test="record.hasDelete != null">
has_delete = #{record.hasDelete,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -946,7 +968,9 @@
unit = #{record.unit,jdbcType=VARCHAR},
push_status = #{record.pushStatus,jdbcType=TINYINT},
transfer_delivery = #{record.transferDelivery,jdbcType=INTEGER},
source = #{record.source,jdbcType=TINYINT}
source = #{record.source,jdbcType=TINYINT},
push_time = #{record.pushTime,jdbcType=TIMESTAMP},
has_delete = #{record.hasDelete,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -1150,6 +1174,12 @@
<if test="source != null">
source = #{source,jdbcType=TINYINT},
</if>
<if test="pushTime != null">
push_time = #{pushTime,jdbcType=TIMESTAMP},
</if>
<if test="hasDelete != null">
has_delete = #{hasDelete,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -1222,7 +1252,9 @@
unit = #{unit,jdbcType=VARCHAR},
push_status = #{pushStatus,jdbcType=TINYINT},
transfer_delivery = #{transferDelivery,jdbcType=INTEGER},
source = #{source,jdbcType=TINYINT}
source = #{source,jdbcType=TINYINT},
push_time = #{pushTime,jdbcType=TIMESTAMP},
has_delete = #{hasDelete,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseSku">
......@@ -1428,6 +1460,12 @@
<if test="source != null">
source,
</if>
<if test="pushTime != null">
push_time,
</if>
<if test="hasDelete != null">
has_delete,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -1626,6 +1664,12 @@
<if test="source != null">
#{source,jdbcType=TINYINT},
</if>
<if test="pushTime != null">
#{pushTime,jdbcType=TIMESTAMP},
</if>
<if test="hasDelete != null">
#{hasDelete,jdbcType=BIT},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
......@@ -1824,6 +1868,12 @@
<if test="source != null">
source = #{source,jdbcType=TINYINT},
</if>
<if test="pushTime != null">
push_time = #{pushTime,jdbcType=TIMESTAMP},
</if>
<if test="hasDelete != null">
has_delete = #{hasDelete,jdbcType=BIT},
</if>
</trim>
</insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseSku">
......@@ -1842,7 +1892,8 @@
create_name, update_name, virtual_price, size_image, sales_price, enable, inspection_hours,
bargainer, customs_code, declare_title_en, declare_title_cn, pick_title_cn, pick_title_en,
product_nature, charger_specifications, packing_price, packing_name, packing_size,
product_size, packing_weight, unit, push_status, transfer_delivery, source)
product_size, packing_weight, unit, push_status, transfer_delivery, source, push_time,
has_delete)
values
(#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{skuImage,jdbcType=VARCHAR},
#{categoryId,jdbcType=INTEGER}, #{categoryName,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR},
......@@ -1865,7 +1916,8 @@
#{productNature,jdbcType=VARCHAR}, #{chargerSpecifications,jdbcType=VARCHAR}, #{packingPrice,jdbcType=DECIMAL},
#{packingName,jdbcType=VARCHAR}, #{packingSize,jdbcType=VARCHAR}, #{productSize,jdbcType=VARCHAR},
#{packingWeight,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR}, #{pushStatus,jdbcType=TINYINT},
#{transferDelivery,jdbcType=INTEGER}, #{source,jdbcType=TINYINT})
#{transferDelivery,jdbcType=INTEGER}, #{source,jdbcType=TINYINT}, #{pushTime,jdbcType=TIMESTAMP},
#{hasDelete,jdbcType=BIT})
on duplicate key update
id = #{id,jdbcType=INTEGER},
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
......@@ -1931,7 +1983,9 @@
unit = #{unit,jdbcType=VARCHAR},
push_status = #{pushStatus,jdbcType=TINYINT},
transfer_delivery = #{transferDelivery,jdbcType=INTEGER},
source = #{source,jdbcType=TINYINT}
source = #{source,jdbcType=TINYINT},
push_time = #{pushTime,jdbcType=TIMESTAMP},
has_delete = #{hasDelete,jdbcType=BIT}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuExample" resultMap="BaseResultMap">
<!--
......
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcBaseSkuTemp;
import com.bailuntec.domain.example.DcBaseSkuTempExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DcBaseSkuTempMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
long countByExample(DcBaseSkuTempExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int deleteByExample(DcBaseSkuTempExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int insert(DcBaseSkuTemp record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int insertSelective(DcBaseSkuTemp record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcBaseSkuTemp selectOneByExample(DcBaseSkuTempExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
List<DcBaseSkuTemp> selectByExample(DcBaseSkuTempExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
DcBaseSkuTemp selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcBaseSkuTemp record, @Param("example") DcBaseSkuTempExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcBaseSkuTemp record, @Param("example") DcBaseSkuTempExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcBaseSkuTemp record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
*/
int updateByPrimaryKey(DcBaseSkuTemp record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcBaseSkuTemp record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku_temp
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcBaseSkuTemp record);
}
\ No newline at end of file
......@@ -593,6 +593,24 @@ public class DcBaseSku {
private Integer source;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_sku.push_time
*
* @mbg.generated
*/
private LocalDateTime pushTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_sku.has_delete
*
* @mbg.generated
*/
private Boolean hasDelete;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_sku
*
......@@ -669,6 +687,8 @@ public class DcBaseSku {
sb.append(", pushStatus=").append(pushStatus);
sb.append(", transferDelivery=").append(transferDelivery);
sb.append(", source=").append(source);
sb.append(", pushTime=").append(pushTime);
sb.append(", hasDelete=").append(hasDelete);
sb.append("]");
return sb.toString();
}
......@@ -755,7 +775,9 @@ public class DcBaseSku {
&& (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
&& (this.getPushStatus() == null ? other.getPushStatus() == null : this.getPushStatus().equals(other.getPushStatus()))
&& (this.getTransferDelivery() == null ? other.getTransferDelivery() == null : this.getTransferDelivery().equals(other.getTransferDelivery()))
&& (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()));
&& (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
&& (this.getPushTime() == null ? other.getPushTime() == null : this.getPushTime().equals(other.getPushTime()))
&& (this.getHasDelete() == null ? other.getHasDelete() == null : this.getHasDelete().equals(other.getHasDelete()));
}
/**
......@@ -833,6 +855,8 @@ public class DcBaseSku {
result = prime * result + ((getPushStatus() == null) ? 0 : getPushStatus().hashCode());
result = prime * result + ((getTransferDelivery() == null) ? 0 : getTransferDelivery().hashCode());
result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
result = prime * result + ((getPushTime() == null) ? 0 : getPushTime().hashCode());
result = prime * result + ((getHasDelete() == null) ? 0 : getHasDelete().hashCode());
return result;
}
}
\ No newline at end of file
......@@ -4610,6 +4610,126 @@ public class DcBaseSkuExample {
addCriterion("source not between", value1, value2, "source");
return (Criteria) this;
}
public Criteria andPushTimeIsNull() {
addCriterion("push_time is null");
return (Criteria) this;
}
public Criteria andPushTimeIsNotNull() {
addCriterion("push_time is not null");
return (Criteria) this;
}
public Criteria andPushTimeEqualTo(LocalDateTime value) {
addCriterion("push_time =", value, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeNotEqualTo(LocalDateTime value) {
addCriterion("push_time <>", value, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeGreaterThan(LocalDateTime value) {
addCriterion("push_time >", value, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("push_time >=", value, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeLessThan(LocalDateTime value) {
addCriterion("push_time <", value, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("push_time <=", value, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeIn(List<LocalDateTime> values) {
addCriterion("push_time in", values, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeNotIn(List<LocalDateTime> values) {
addCriterion("push_time not in", values, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("push_time between", value1, value2, "pushTime");
return (Criteria) this;
}
public Criteria andPushTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("push_time not between", value1, value2, "pushTime");
return (Criteria) this;
}
public Criteria andHasDeleteIsNull() {
addCriterion("has_delete is null");
return (Criteria) this;
}
public Criteria andHasDeleteIsNotNull() {
addCriterion("has_delete is not null");
return (Criteria) this;
}
public Criteria andHasDeleteEqualTo(Boolean value) {
addCriterion("has_delete =", value, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteNotEqualTo(Boolean value) {
addCriterion("has_delete <>", value, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteGreaterThan(Boolean value) {
addCriterion("has_delete >", value, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteGreaterThanOrEqualTo(Boolean value) {
addCriterion("has_delete >=", value, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteLessThan(Boolean value) {
addCriterion("has_delete <", value, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteLessThanOrEqualTo(Boolean value) {
addCriterion("has_delete <=", value, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteIn(List<Boolean> values) {
addCriterion("has_delete in", values, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteNotIn(List<Boolean> values) {
addCriterion("has_delete not in", values, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteBetween(Boolean value1, Boolean value2) {
addCriterion("has_delete between", value1, value2, "hasDelete");
return (Criteria) this;
}
public Criteria andHasDeleteNotBetween(Boolean value1, Boolean value2) {
addCriterion("has_delete not between", value1, value2, "hasDelete");
return (Criteria) this;
}
}
/**
......
table-name=dc_auto_daily_redundance
table-name=dc_base_sku
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment