Kaynağa Gözat

添加同步订单类

wangxiaoming 5 yıl önce
ebeveyn
işleme
29a001a455

+ 92 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/OrderSyncLog.java

@@ -0,0 +1,92 @@
+package com.iamberry.rst.core.order;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  同步记录
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+public class OrderSyncLog implements  Serializable{
+    private static final long serialVersionUID = 1819602099624248902L;
+    //同步时间id
+    private Integer syncLogId;
+    //
+    private Integer syncPlatId;
+    //类型:1;拉取订单
+    private Integer syncLogType;
+    //更新模式 1:定时任务 2:手动同步
+    private Integer syncLogMode;
+    //同步总数量
+    private Integer syncLogRecentNum;
+    //同步失败数量
+    private Integer syncLogErrorNum;
+    //错误信息
+    private String syncLogErrorMsg;
+    //创建时间-同步时间'
+    private Date syncLogCreateDate;
+
+    public Integer getSyncLogId(){
+        return syncLogId;
+    }
+
+    public void setSyncLogId(Integer  syncLogId){
+        this.syncLogId=syncLogId;
+    }
+
+    public Integer getSyncPlatId(){
+        return syncPlatId;
+    }
+
+    public void setSyncPlatId(Integer  syncPlatId){
+        this.syncPlatId=syncPlatId;
+    }
+
+    public Integer getSyncLogType(){
+        return syncLogType;
+    }
+
+    public void setSyncLogType(Integer  syncLogType){
+        this.syncLogType=syncLogType;
+    }
+
+    public Integer getSyncLogMode(){
+        return syncLogMode;
+    }
+
+    public void setSyncLogMode(Integer  syncLogMode){
+        this.syncLogMode=syncLogMode;
+    }
+
+    public Integer getSyncLogRecentNum(){
+        return syncLogRecentNum;
+    }
+
+    public void setSyncLogRecentNum(Integer  syncLogRecentNum){
+        this.syncLogRecentNum=syncLogRecentNum;
+    }
+
+    public Integer getSyncLogErrorNum(){
+        return syncLogErrorNum;
+    }
+
+    public void setSyncLogErrorNum(Integer  syncLogErrorNum){
+        this.syncLogErrorNum=syncLogErrorNum;
+    }
+
+    public String getSyncLogErrorMsg(){
+        return syncLogErrorMsg;
+    }
+
+    public void setSyncLogErrorMsg(String  syncLogErrorMsg){
+        this.syncLogErrorMsg=syncLogErrorMsg;
+    }
+
+    public Date getSyncLogCreateDate(){
+        return syncLogCreateDate;
+    }
+
+    public void setSyncLogCreateDate(Date  syncLogCreateDate){
+        this.syncLogCreateDate=syncLogCreateDate;
+    }
+}

+ 102 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/OrderSyncPlatform.java

@@ -0,0 +1,102 @@
+package com.iamberry.rst.core.order;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  订单同步表类
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+public class OrderSyncPlatform implements  Serializable{
+    private static final long serialVersionUID = 301138434190468157L;
+    //平台id
+    private Integer syncPlatId;
+    //平台名称
+    private String syncPlatName;
+    //类型 1.自营其他平台商城 2.天猫
+    private Integer syncPlatType;
+    //AppKey
+    private String syncPlatAppKey;
+    //App Secret
+    private String syncPlatAppSecret;
+    //access_token
+    private String syncPlatAccessToken;
+    //token_date
+    private Date syncPlatTokenDate;
+    //状态 1:使用中 2:未使用
+    private Integer syncPlatStatus;
+    //创建时间'
+    private Date syncPlatCreateDate;
+
+    public Integer getSyncPlatId(){
+        return syncPlatId;
+    }
+
+    public void setSyncPlatId(Integer  syncPlatId){
+        this.syncPlatId=syncPlatId;
+    }
+
+    public String getSyncPlatName(){
+        return syncPlatName;
+    }
+
+    public void setSyncPlatName(String  syncPlatName){
+        this.syncPlatName=syncPlatName;
+    }
+
+    public Integer getSyncPlatType(){
+        return syncPlatType;
+    }
+
+    public void setSyncPlatType(Integer  syncPlatType){
+        this.syncPlatType=syncPlatType;
+    }
+
+    public String getSyncPlatAppKey(){
+        return syncPlatAppKey;
+    }
+
+    public void setSyncPlatAppKey(String  syncPlatAppKey){
+        this.syncPlatAppKey=syncPlatAppKey;
+    }
+
+    public String getSyncPlatAppSecret(){
+        return syncPlatAppSecret;
+    }
+
+    public void setSyncPlatAppSecret(String  syncPlatAppSecret){
+        this.syncPlatAppSecret=syncPlatAppSecret;
+    }
+
+    public String getSyncPlatAccessToken(){
+        return syncPlatAccessToken;
+    }
+
+    public void setSyncPlatAccessToken(String  syncPlatAccessToken){
+        this.syncPlatAccessToken=syncPlatAccessToken;
+    }
+
+    public Date getSyncPlatTokenDate(){
+        return syncPlatTokenDate;
+    }
+
+    public void setSyncPlatTokenDate(Date  syncPlatTokenDate){
+        this.syncPlatTokenDate=syncPlatTokenDate;
+    }
+
+    public Integer getSyncPlatStatus(){
+        return syncPlatStatus;
+    }
+
+    public void setSyncPlatStatus(Integer  syncPlatStatus){
+        this.syncPlatStatus=syncPlatStatus;
+    }
+
+    public Date getSyncPlatCreateDate(){
+        return syncPlatCreateDate;
+    }
+
+    public void setSyncPlatCreateDate(Date  syncPlatCreateDate){
+        this.syncPlatCreateDate=syncPlatCreateDate;
+    }
+}

+ 31 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/OrderSyncLogService.java

@@ -0,0 +1,31 @@
+package com.iamberry.rst.faces.order;
+
+import com.iamberry.rst.core.order.OrderSyncLog;
+
+import java.util.List;
+
+/**
+ *  同步记录
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+public interface OrderSyncLogService {
+    /**
+     * 获取集合
+     * @param  orderSyncLog
+     * @return List
+     */
+    List<OrderSyncLog> getSyncLogList(OrderSyncLog orderSyncLog);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  syncLog
+     */
+    OrderSyncLog getSyncLogById(Integer  id);
+    /**
+     * 增加数据
+     * @param  orderSyncLog
+     * @return Integer
+     */
+    Integer  save(OrderSyncLog orderSyncLog);
+}

+ 38 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/OrderSyncPlatformService.java

@@ -0,0 +1,38 @@
+package com.iamberry.rst.faces.order;
+
+import com.iamberry.rst.core.order.OrderSyncPlatform;
+
+import java.util.List;
+
+/**
+ *  订单同步表接口
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+public interface OrderSyncPlatformService {
+    /**
+     * 获取集合
+     * @param  orderSyncPlatform
+     * @return List
+     */
+    List<OrderSyncPlatform> getSyncPlatformList(OrderSyncPlatform orderSyncPlatform);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  syncPlatform
+     */
+    OrderSyncPlatform getSyncPlatformById(Integer  id);
+    /**
+     * 增加数据
+     * @param  orderSyncPlatform
+     * @return Integer
+     */
+    Integer  save(OrderSyncPlatform orderSyncPlatform);
+    /**
+     * 修改数据
+     * @param  orderSyncPlatform
+     * @return Integer
+     */
+    Integer  update(OrderSyncPlatform orderSyncPlatform);
+
+}

+ 47 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/OrderSyncLogServiceImpl.java

@@ -0,0 +1,47 @@
+package com.iamberry.rst.service.order;
+
+import com.alibaba.dubbo.config.annotation.Service;
+import com.iamberry.rst.core.order.OrderSyncLog;
+import com.iamberry.rst.faces.order.OrderSyncLogService;
+import com.iamberry.rst.service.order.mapper.OrderSyncLogMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ *  同步记录
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+@Service
+public class OrderSyncLogServiceImpl implements OrderSyncLogService {
+    @Autowired
+    private OrderSyncLogMapper orderSyncLogMapper;
+    /**
+     * 获取集合
+     * @param  orderSyncLog
+     * @return List
+     */
+    @Override
+    public List<OrderSyncLog> getSyncLogList(OrderSyncLog orderSyncLog){
+        return  orderSyncLogMapper.getSyncLogList(orderSyncLog);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  syncLog
+     */
+    @Override
+    public OrderSyncLog getSyncLogById(Integer  id){
+        return  orderSyncLogMapper.getSyncLogById(id);
+    }
+    /**
+     * 增加数据
+     * @param  orderSyncLog
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(OrderSyncLog orderSyncLog){
+        return  orderSyncLogMapper.save(orderSyncLog);
+    }
+}

+ 56 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/OrderSyncPlatformServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.rst.service.order;
+
+import com.iamberry.rst.core.order.OrderSyncPlatform;
+import com.iamberry.rst.faces.order.OrderSyncPlatformService;
+import com.iamberry.rst.service.order.mapper.OrderSyncPlatformMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  订单同步表接口
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+@Service
+public class OrderSyncPlatformServiceImpl implements OrderSyncPlatformService {
+    @Autowired
+    private OrderSyncPlatformMapper orderSyncPlatformMapper;
+    /**
+     * 获取集合
+     * @param  orderSyncPlatform
+     * @return List
+     */
+    @Override
+    public List<OrderSyncPlatform> getSyncPlatformList(OrderSyncPlatform orderSyncPlatform){
+        return  orderSyncPlatformMapper.getSyncPlatformList(orderSyncPlatform);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  syncPlatform
+     */
+    @Override
+    public OrderSyncPlatform getSyncPlatformById(Integer  id){
+        return  orderSyncPlatformMapper.getSyncPlatformById(id);
+    }
+    /**
+     * 增加数据
+     * @param  orderSyncPlatform
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(OrderSyncPlatform orderSyncPlatform){
+        return  orderSyncPlatformMapper.save(orderSyncPlatform);
+    }
+    /**
+     * 修改数据
+     * @param  orderSyncPlatform
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(OrderSyncPlatform orderSyncPlatform){
+        return  orderSyncPlatformMapper.update(orderSyncPlatform);
+    }
+}

+ 31 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/OrderSyncLogMapper.java

@@ -0,0 +1,31 @@
+package com.iamberry.rst.service.order.mapper;
+
+import com.iamberry.rst.core.order.OrderSyncLog;
+
+import java.util.List;
+
+/**
+ *  同步记录
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+public interface OrderSyncLogMapper {
+    /**
+     * 获取集合
+     * @param  orderSyncLog
+     * @return List
+     */
+    List<OrderSyncLog> getSyncLogList(OrderSyncLog orderSyncLog);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  syncLog
+     */
+    OrderSyncLog getSyncLogById(Integer  id);
+    /**
+     * 增加数据
+     * @param  orderSyncLog
+     * @return Integer
+     */
+    Integer  save(OrderSyncLog orderSyncLog);
+}

+ 37 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/OrderSyncPlatformMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.rst.service.order.mapper;
+
+import com.iamberry.rst.core.order.OrderSyncPlatform;
+
+import java.util.List;
+
+/**
+ *  订单同步表接口
+ * @author Administrator
+ * @Date 2019-12-17
+ */
+public interface OrderSyncPlatformMapper {
+    /**
+     * 获取集合
+     * @param  orderSyncPlatform
+     * @return List
+     */
+    List<OrderSyncPlatform> getSyncPlatformList(OrderSyncPlatform orderSyncPlatform);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  syncPlatform
+     */
+    OrderSyncPlatform getSyncPlatformById(Integer  id);
+    /**
+     * 增加数据
+     * @param  orderSyncPlatform
+     * @return Integer
+     */
+    Integer  save(OrderSyncPlatform orderSyncPlatform);
+    /**
+     * 修改数据
+     * @param  orderSyncPlatform
+     * @return Integer
+     */
+    Integer  update(OrderSyncPlatform orderSyncPlatform);
+}

+ 70 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/orderSyncLogMapper.xml

@@ -0,0 +1,70 @@
+<?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.iamberry.rst.service.order.mapper.OrderSyncLogMapper">
+    <resultMap  id="BaseResultMap" type="OrderSyncLog" >
+        <result    column="sync_log_id"    property="syncLogId" />
+        <result    column="sync_plat_id"    property="syncPlatId" />
+        <result    column="sync_log_type"    property="syncLogType" />
+        <result    column="sync_log_mode"    property="syncLogMode" />
+        <result    column="sync_log_recent_num"    property="syncLogRecentNum" />
+        <result    column="sync_log_error_num"    property="syncLogErrorNum" />
+        <result    column="sync_log_error_msg"    property="syncLogErrorMsg" />
+        <result    column="sync_log_create_date"    property="syncLogCreateDate" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.sync_log_id,
+        t.sync_plat_id,
+        t.sync_log_type,
+        t.sync_log_mode,
+        t.sync_log_recent_num,
+        t.sync_log_error_num,
+        t.sync_log_error_msg,
+        t.sync_log_create_date
+    </sql>
+    <select id="getOrderSyncLogList" resultMap="BaseResultMap" parameterType="OrderSyncLog" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_order_sync_log t
+        <where>
+            <if test="syncLogId != null ">
+                AND t.sync_log_id = #{syncLogId}
+            </if >
+            <if test="syncPlatId != null ">
+                AND t.sync_plat_id = #{syncPlatId}
+            </if >
+            <if test="syncLogType != null ">
+                AND t.sync_log_type = #{syncLogType}
+            </if >
+            <if test="syncLogMode != null ">
+                AND t.sync_log_mode = #{syncLogMode}
+            </if >
+        </where>
+    </select>
+    <select id="getOrderSyncLogById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_order_sync_log t
+        where t.sync_log_id= #{syncLogId}
+    </select>
+    <insert id="save" parameterType="OrderSyncLog" >
+        insert into
+        tb_rst_order_sync_log
+        (
+        sync_plat_id,
+        sync_log_type,
+        sync_log_mode,
+        sync_log_recent_num,
+        sync_log_error_num,
+        sync_log_error_msg
+        )
+        values
+        (
+        #{syncPlatId},
+        #{syncLogType},
+        #{syncLogMode},
+        #{syncLogRecentNum},
+        #{syncLogErrorNum},
+        #{syncLogErrorMsg}
+        )
+    </insert>
+</mapper>

+ 111 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/orderSyncPlatformMapper.xml

@@ -0,0 +1,111 @@
+<?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.iamberry.rst.service.order.mapper.OrderSyncPlatformMapper">
+    <resultMap  id="BaseResultMap" type="OrderSyncPlatform" >
+        <result    column="sync_plat_id"    property="syncPlatId" />
+        <result    column="sync_plat_name"    property="syncPlatName" />
+        <result    column="sync_plat_type"    property="syncPlatType" />
+        <result    column="sync_plat_app_key"    property="syncPlatAppKey" />
+        <result    column="sync_plat_app_secret"    property="syncPlatAppSecret" />
+        <result    column="sync_plat_access_token"    property="syncPlatAccessToken" />
+        <result    column="sync_plat_token_date"    property="syncPlatTokenDate" />
+        <result    column="sync_plat_status"    property="syncPlatStatus" />
+        <result    column="sync_plat_create_date"    property="syncPlatCreateDate" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.sync_plat_id,
+        t.sync_plat_name,
+        t.sync_plat_type,
+        t.sync_plat_app_key,
+        t.sync_plat_app_secret,
+        t.sync_plat_access_token,
+        t.sync_plat_token_date,
+        t.sync_plat_status,
+        t.sync_plat_create_date
+    </sql>
+    <select id="getOrderSyncPlatformList" resultMap="BaseResultMap" parameterType="OrderSyncPlatform" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_order_sync_platform t
+        <where>
+            <if test="syncPlatId != null ">
+                AND t.sync_plat_id = #{syncPlatId}
+            </if >
+            <if test="syncPlatName != null and syncPlatName != ''">
+                AND t.sync_plat_name  like  CONCAT ('%',#{syncPlatName},'%')
+            </if >
+            <if test="syncPlatType != null ">
+                AND t.sync_plat_type = #{syncPlatType}
+            </if >
+            <if test="syncPlatAppKey != null and syncPlatAppKey != ''">
+                AND t.sync_plat_app_key = #{syncPlatAppKey}
+            </if >
+            <if test="syncPlatAppSecret != null and syncPlatAppSecret != ''">
+                AND t.sync_plat_app_secret = #{syncPlatAppSecret}
+            </if >
+            <if test="syncPlatAccessToken != null and syncPlatAccessToken != ''">
+                AND t.sync_plat_access_token = #{syncPlatAccessToken}
+            </if >
+            <if test="syncPlatStatus != null ">
+                AND t.sync_plat_status = #{syncPlatStatus}
+            </if >
+        </where>
+    </select>
+    <select id="getOrderSyncPlatformById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_order_sync_platform t
+        where t.sync_plat_id= #{syncPlatId}
+    </select>
+    <insert id="save" parameterType="OrderSyncPlatform" >
+        insert into
+        tb_rst_order_sync_platform
+        (
+        sync_plat_name,
+        sync_plat_type,
+        sync_plat_app_key,
+        sync_plat_app_secret,
+        sync_plat_access_token,
+        sync_plat_token_date,
+        sync_plat_status
+        )
+        values
+        (
+        #{syncPlatName},
+        #{syncPlatType},
+        #{syncPlatAppKey},
+        #{syncPlatAppSecret},
+        #{syncPlatAccessToken},
+        #{syncPlatTokenDate},
+        #{syncPlatStatus}
+        )
+    </insert>
+    <update id="update" parameterType="OrderSyncPlatform" >
+        update
+        tb_rst_order_sync_platform
+        <set >
+            <if test="syncPlatName != null and syncPlatName != ''">
+                sync_plat_name = #{syncPlatName},
+            </if >
+            <if test="syncPlatType != null ">
+                sync_plat_type = #{syncPlatType},
+            </if >
+            <if test="syncPlatAppKey != null and syncPlatAppKey != ''">
+                sync_plat_app_key = #{syncPlatAppKey},
+            </if >
+            <if test="syncPlatAppSecret != null and syncPlatAppSecret != ''">
+                sync_plat_app_secret = #{syncPlatAppSecret},
+            </if >
+            <if test="syncPlatAccessToken != null and syncPlatAccessToken != ''">
+                sync_plat_access_token = #{syncPlatAccessToken},
+            </if >
+            <if test="syncPlatTokenDate != null and syncPlatTokenDate != ''">
+                sync_plat_token_date = #{syncPlatTokenDate},
+            </if >
+            <if test="syncPlatStatus != null ">
+                sync_plat_status = #{syncPlatStatus},
+            </if >
+        </set >
+        where sync_plat_id= #{syncPlatId}
+    </update>
+</mapper>