Commit 176a1e43 by huluobin

oms sku 同步

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