Commit 176a1e43 by huluobin

oms sku 同步

parent a7310fd2
......@@ -23,13 +23,13 @@ import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.SqlSession;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -50,11 +50,11 @@ public class OrderSyncJob extends PointJob {
/*map.put("TimeFrom", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(3)));
map.put("TimeTo", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
map.put("DateType", "purchaseTime");*/
map.put("BailunLastUpdateTimeFrom", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(3)));
map.put("BailunLastUpdateTimeTo", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
// map.put("BailunLastUpdateTimeFrom", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(3)));
// map.put("BailunLastUpdateTimeTo", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
// map.put("BailunLastUpdateTimeFrom", "2020-08-24 00:00:00");
// map.put("BailunLastUpdateTimeTo", "2020-08-26 11:00:00");
map.put("BailunLastUpdateTimeFrom", "2020-08-24 00:00:00");
map.put("BailunLastUpdateTimeTo", "2020-08-26 11:00:00");
do {
map.put("pageIndex", jobPointLog.getPageIndex().equals(0) ? "1" : jobPointLog.getPageIndex().toString());
Response response = null;
......@@ -566,6 +566,14 @@ public class OrderSyncJob extends PointJob {
}
log.info("解析订单,并且处理费信息完成 订单号:{}", omsResult.getOriginOrderId());
} catch (Exception e) {
SqlSession sqlSession = SessionUtil.getSession();
DcBaseOmsSkuExceptionMapper dcBaseOmsSkuExceptionMapper = sqlSession.getMapper(DcBaseOmsSkuExceptionMapper.class);
DcBaseOmsSkuException dcBaseOmsSkuException = new DcBaseOmsSkuException();
dcBaseOmsSkuException.setCreateTime(LocalDateTime.now());
dcBaseOmsSkuException.setOriginOrderId(omsResult.getOriginOrderId());
dcBaseOmsSkuException.setStatus(1);
dcBaseOmsSkuException.setLastUpdateTime(LocalDateTime.now());
dcBaseOmsSkuExceptionMapper.insert(dcBaseOmsSkuException);
log.error("解析订单异常 message:{}, 订单号:{}", e.getMessage(), omsResult.getOriginOrderId(), e);
}
});
......
......@@ -35,6 +35,15 @@ public class DcBaseOmsSkuException {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_sku_exception.last_update_time
*
* @mbg.generated
*/
private LocalDateTime lastUpdateTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_sku_exception.status
*
* @mbg.generated
......@@ -56,6 +65,7 @@ public class DcBaseOmsSkuException {
sb.append(", id=").append(id);
sb.append(", originOrderId=").append(originOrderId);
sb.append(", createTime=").append(createTime);
sb.append(", lastUpdateTime=").append(lastUpdateTime);
sb.append(", status=").append(status);
sb.append("]");
return sb.toString();
......@@ -82,6 +92,7 @@ public class DcBaseOmsSkuException {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOriginOrderId() == null ? other.getOriginOrderId() == null : this.getOriginOrderId().equals(other.getOriginOrderId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getLastUpdateTime() == null ? other.getLastUpdateTime() == null : this.getLastUpdateTime().equals(other.getLastUpdateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
}
......@@ -98,6 +109,7 @@ public class DcBaseOmsSkuException {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getOriginOrderId() == null) ? 0 : getOriginOrderId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getLastUpdateTime() == null) ? 0 : getLastUpdateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
return result;
}
......
......@@ -560,6 +560,66 @@ public class DcBaseOmsSkuExceptionExample {
return (Criteria) this;
}
public Criteria andLastUpdateTimeIsNull() {
addCriterion("last_update_time is null");
return (Criteria) this;
}
public Criteria andLastUpdateTimeIsNotNull() {
addCriterion("last_update_time is not null");
return (Criteria) this;
}
public Criteria andLastUpdateTimeEqualTo(LocalDateTime value) {
addCriterion("last_update_time =", value, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeNotEqualTo(LocalDateTime value) {
addCriterion("last_update_time <>", value, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeGreaterThan(LocalDateTime value) {
addCriterion("last_update_time >", value, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) {
addCriterion("last_update_time >=", value, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeLessThan(LocalDateTime value) {
addCriterion("last_update_time <", value, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeLessThanOrEqualTo(LocalDateTime value) {
addCriterion("last_update_time <=", value, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeIn(List<LocalDateTime> values) {
addCriterion("last_update_time in", values, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeNotIn(List<LocalDateTime> values) {
addCriterion("last_update_time not in", values, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("last_update_time between", value1, value2, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andLastUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
addCriterion("last_update_time not between", value1, value2, "lastUpdateTime");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
......
......@@ -9,6 +9,7 @@
<id column="id" jdbcType="INTEGER" property="id" />
<result column="origin_order_id" jdbcType="VARCHAR" property="originOrderId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="last_update_time" jdbcType="TIMESTAMP" property="lastUpdateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Example_Where_Clause">
......@@ -82,7 +83,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, origin_order_id, create_time, status
id, origin_order_id, create_time, last_update_time, status
</sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseOmsSkuExceptionExample" resultMap="BaseResultMap">
<!--
......@@ -144,9 +145,9 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into dc_base_oms_sku_exception (id, origin_order_id, create_time,
status)
last_update_time, status)
values (#{id,jdbcType=INTEGER}, #{originOrderId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER})
#{lastUpdateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseOmsSkuException">
<!--
......@@ -164,6 +165,9 @@
<if test="createTime != null">
create_time,
</if>
<if test="lastUpdateTime != null">
last_update_time,
</if>
<if test="status != null">
status,
</if>
......@@ -178,6 +182,9 @@
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdateTime != null">
#{lastUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
......@@ -209,6 +216,9 @@
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.lastUpdateTime != null">
last_update_time = #{record.lastUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
......@@ -226,6 +236,7 @@
set id = #{record.id,jdbcType=INTEGER},
origin_order_id = #{record.originOrderId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
last_update_time = #{record.lastUpdateTime,jdbcType=TIMESTAMP},
status = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -244,6 +255,9 @@
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdateTime != null">
last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
......@@ -258,6 +272,7 @@
update dc_base_oms_sku_exception
set origin_order_id = #{originOrderId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -278,6 +293,9 @@
<if test="createTime != null">
create_time,
</if>
<if test="lastUpdateTime != null">
last_update_time,
</if>
<if test="status != null">
status,
</if>
......@@ -293,6 +311,9 @@
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdateTime != null">
#{lastUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
......@@ -308,6 +329,9 @@
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdateTime != null">
last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
......@@ -320,14 +344,15 @@
@project https://github.com/itfsw/mybatis-generator-plugin
-->
insert into dc_base_oms_sku_exception
(id, origin_order_id, create_time, status)
(id, origin_order_id, create_time, last_update_time, status)
values
(#{id,jdbcType=INTEGER}, #{originOrderId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER})
#{lastUpdateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
on duplicate key update
id = #{id,jdbcType=INTEGER},
origin_order_id = #{originOrderId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
</insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseOmsSkuExceptionExample" resultMap="BaseResultMap">
......
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