Commit dfe6de12 by 徐康

麦咖啡数据迁移

parent 6d0ad710
......@@ -330,7 +330,7 @@
<dependency>
<groupId>com.freemud.sdk.api.assortment</groupId>
<artifactId>assortment-payment-sdk</artifactId>
<version>2.6.7.RELEASE</version>
<version>2.6.8.SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
......
......@@ -112,15 +112,30 @@ public class OrderApplication {
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
@Bean("mcCafePushOrderExecutor")
public Executor mcCafePushOrderExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(1);
executor.setMaxPoolSize(1);
executor.setKeepAliveSeconds(60);
executor.setQueueCapacity(100);
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setAwaitTerminationSeconds(60);
executor.setThreadNamePrefix("mcCafePushOrderExecutor-");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
@Bean("mcCafePushOrderSubExecutor")
public Executor mcCafePushOrderSubExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(8);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(20000);
executor.setMaxPoolSize(16);
executor.setKeepAliveSeconds(60);
executor.setThreadNamePrefix("McCafePushOrderExecutor-");
executor.setQueueCapacity(100);
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setAwaitTerminationSeconds(60);
executor.setThreadNamePrefix("mcCafePushOrderSubExecutor-");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
......
package cn.freemud.entities.dto;
import lombok.Data;
@Data
public class McCafePushOrderResponseDto {
private String code;
private String message;
private String data;
}
......@@ -19,6 +19,10 @@ public class PushMccafeOrderManager {
@Autowired
private PushMccafeOrderDao pushMccafeOrderDao;
public PushMccafeOrder selectOrder(String orderCode) {
return pushMccafeOrderDao.selectOrder(orderCode);
}
public Integer insertOrder(PushMccafeOrder pushMccafeOrder) {
return pushMccafeOrderDao.insertOrder(pushMccafeOrder);
}
......
......@@ -8,6 +8,8 @@ import org.springframework.stereotype.Repository;
@Repository
public interface PushMccafeOrderDao {
PushMccafeOrder selectOrder(@Param("orderCode") String orderCode);
Integer insertOrder(PushMccafeOrder pushMccafeOrder);
Integer updateOrder(PushMccafeOrder pushMccafeOrder);
......
package cn.freemud.service.thirdparty;
import cn.freemud.annotations.LogIgnoreFeign;
import cn.freemud.entities.dto.order.McCafePushOrderDto;
import cn.freemud.entities.dto.McCafePushOrderResponseDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@FeignClient(url = "http://")
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public interface McCafePushOrderClient {
@LogIgnoreFeign(logMessage="mcCafePushOrder")
@PostMapping("/mp/order")
McCafePushOrderResponseDto mcCafePushOrder(@RequestBody McCafePushOrderDto mcCafePushOrderDto);
}
<?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="cn.freemud.manager.dao.PushMccafeOrderDao">
<sql id="all_column">
id,
order_code as orderCode
partner_id as partnerId,
store_id as storeId,
status as status,
fail_reason as failReason,
create_time as createTime,
update_time as updateTime
</sql>
<select id="selectOrder" resultType="cn.freemud.entities.db.PushMccafeOrder">
SELECT
<include refid="all_column"/>
FROM push_mccafe_order WHERE order_code=#{orderCode}
</select>
<insert id="insertOrder" parameterType="cn.freemud.entities.db.PushMccafeOrder">
INSERT INTO push_mccafe_order ( order_code, partner_id,store_id,status,fail_reason)
VALUES
( #{orderCode},#{partnerId},#{storeId},#{status},#{failReason} );
</insert>
<update id="updateOrder" parameterType="cn.freemud.entities.db.PushMccafeOrder">
updatee push_mccafe_order
set
status = #{status}
where order_code = #{orderCode}
</update>
</mapper>
\ No newline at end of file
......@@ -65,7 +65,7 @@
<dependency>
<groupId>com.freemud.sdk.api.assortment</groupId>
<artifactId>assortment-payment-sdk</artifactId>
<version>2.6.8.RELEASE</version>
<version>2.6.8.SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
......
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