2f9b7006 wangzhiliang

菠萝派接口分库分表

1 个父辈 a4fca648
正在显示 22 个修改的文件 包含 446 行增加107 行删除
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
3 xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:mvc="http://www.springframework.org/schema/mvc"
5 xmlns:context="http://www.springframework.org/schema/context"
6 xsi:schemaLocation="http://www.springframework.org/schema/beans
7 http://www.springframework.org/schema/beans/spring-beans.xsd
8 http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
9 http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
10
11 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
12 <property name="locations">
13 <list>
14 <value>classpath:META-INF/conf/dubbo.properties</value>
15 </list>
16 </property>
17 </bean>
18
19 <!-- zookeeper注册中心 -->
20 <dubbo:registry protocol="zookeeper" address="${dubbo.registryAddress}" />
21
22 <!-- 远程服务代理接口 -->
23 <dubbo:annotation package="com.sibu.mall.order" />
24
25 <!-- 关闭提供者的检索 -->
26 <dubbo:consumer check="false" group="${dubbo.consumer.group}" version="${dubbo.consumerVersion}"/>
27
28 <!-- 服务调用超时,超时重试-->
29 <dubbo:provider delay="-1" timeout="${dubbo.connectTimeOut}" retries="${dubbo.connectRetries}"/>
30
31 <!-- 消费者名称 -->
32 <dubbo:application name="${dubbo.applicationName}" />
33
34 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 ##################### dubbo begin #############################
2 dubbo.registryAddress = zookeeper://111.230.133.155:2181?backup=111.231.243.221:2181,118.89.51.164:2181
3 dubbo.applicationName = mall-third-consumer
4 dubbo.connectTimeOut = 20000
5 dubbo.connectRetries= 0
6 dubbo.consumer.group= dev.sso.qiujw
7 dubbo.consumerVersion= 1.0
8 ##################### dubbo end #############################
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
3 xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:mvc="http://www.springframework.org/schema/mvc"
5 xmlns:context="http://www.springframework.org/schema/context"
6 xsi:schemaLocation="http://www.springframework.org/schema/beans
7 http://www.springframework.org/schema/beans/spring-beans.xsd
8 http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
9 http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
10
11 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
12 <property name="locations">
13 <list>
14 <value>classpath:META-INF/conf/dubbo.properties</value>
15 </list>
16 </property>
17 </bean>
18
19 <!-- zookeeper注册中心 -->
20 <dubbo:registry protocol="zookeeper" address="${dubbo.registryAddress}" />
21
22 <!-- 远程服务代理接口 -->
23 <dubbo:annotation package="com.sibu.mall.order" />
24
25 <!-- 关闭提供者的检索 -->
26 <dubbo:consumer check="false" group="${dubbo.consumer.group}" version="${dubbo.consumerVersion}"/>
27
28 <!-- 服务调用超时,超时重试-->
29 <dubbo:provider delay="-1" timeout="${dubbo.connectTimeOut}" retries="${dubbo.connectRetries}"/>
30
31 <!-- 消费者名称 -->
32 <dubbo:application name="${dubbo.applicationName}" />
33
34 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 ##################### dubbo begin #############################
2 dubbo.registryAddress = zookeeper://111.230.133.155:2181?backup=111.231.243.221:2181,118.89.51.164:2181
3 dubbo.applicationName = mall-third-consumer
4 dubbo.connectTimeOut = 20000
5 dubbo.connectRetries= 0
6 dubbo.consumer.group= dev.sso.qiujw
7 dubbo.consumerVersion= 1.0
8 ##################### dubbo end #############################
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
3 xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:mvc="http://www.springframework.org/schema/mvc"
5 xmlns:context="http://www.springframework.org/schema/context"
6 xsi:schemaLocation="http://www.springframework.org/schema/beans
7 http://www.springframework.org/schema/beans/spring-beans.xsd
8 http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
9 http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
10
11 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
12 <property name="locations">
13 <list>
14 <value>classpath:META-INF/conf/dubbo.properties</value>
15 </list>
16 </property>
17 </bean>
18
19 <!-- zookeeper注册中心 -->
20 <dubbo:registry protocol="zookeeper" address="${dubbo.registryAddress}" />
21
22 <!-- 远程服务代理接口 -->
23 <dubbo:annotation package="com.sibu.mall.order" />
24
25 <!-- 关闭提供者的检索 -->
26 <dubbo:consumer check="false" group="${dubbo.consumer.group}" version="${dubbo.consumerVersion}"/>
27
28 <!-- 服务调用超时,超时重试-->
29 <dubbo:provider delay="-1" timeout="${dubbo.connectTimeOut}" retries="${dubbo.connectRetries}"/>
30
31 <!-- 消费者名称 -->
32 <dubbo:application name="${dubbo.applicationName}" />
33
34 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 ##################### dubbo begin #############################
2 dubbo.registryAddress = zookeeper://111.230.133.155:2181?backup=111.231.243.221:2181,118.89.51.164:2181
3 dubbo.applicationName = mall-third-consumer
4 dubbo.connectTimeOut = 20000
5 dubbo.connectRetries= 0
6 dubbo.consumer.group= dev.sso.qiujw
7 dubbo.consumerVersion= wangzhiliang2
8 ##################### dubbo end #############################
...@@ -7,18 +7,18 @@ jdbc.url=jdbc:mysql://120.76.137.184/sibu_wesale_base?useUnicode=true&characterE ...@@ -7,18 +7,18 @@ jdbc.url=jdbc:mysql://120.76.137.184/sibu_wesale_base?useUnicode=true&characterE
7 jdbc.imtegralurl=jdbc:mysql://120.76.137.184/sibu_integralmall_base?useUnicode=true&characterEncoding=utf8 7 jdbc.imtegralurl=jdbc:mysql://120.76.137.184/sibu_integralmall_base?useUnicode=true&characterEncoding=utf8
8 sqlserverjdbc.url=jdbc\:jtds\:sqlserver\://120.25.75.53\:1433;databaseName\=sibu_wesale_base_read_03 8 sqlserverjdbc.url=jdbc\:jtds\:sqlserver\://120.25.75.53\:1433;databaseName\=sibu_wesale_base_read_03
9 9
10 mall.write.url=jdbc:mysql://39.108.19.165:3306/ejavashop 10 mall.write.url=jdbc:mysql://118.89.51.164:3306/ejavashop
11 mall.write.username=sibu_wesale 11 mall.write.username=sibu_wesale
12 mall.write.password=sibu123.. 12 mall.write.password=6SvbL5+JhXQSpf+ASsQ0Rg==
13 mall.read.url=jdbc:mysql://120.77.6.187:3306/ejavashop 13 mall.read.url=jdbc:mysql://111.231.243.221:3306/ejavashop
14 mall.read.username=sibu_wesale 14 mall.read.username=sibu_wesale
15 mall.read.password=sibu123.. 15 mall.read.password=6SvbL5+JhXQSpf+ASsQ0Rg==
16 mall.analysis.write.url=jdbc:mysql://39.108.19.165:3306/ejavashop 16 mall.analysis.write.url=jdbc:mysql://118.89.51.164:3306/analysis
17 mall.analysis.write.username=sibu_wesale 17 mall.analysis.write.username=sibu_wesale
18 mall.analysis.write.password=sibu123.. 18 mall.analysis.write.password=6SvbL5+JhXQSpf+ASsQ0Rg==
19 mall.analysis.read.url=jdbc:mysql://120.77.6.187:3306/ejavashop 19 mall.analysis.read.url=jdbc:mysql://111.231.243.221:3306/analysis
20 mall.analysis.read.username=sibu_wesale 20 mall.analysis.read.username=sibu_wesale
21 mall.analysis.read.password=sibu123.. 21 mall.analysis.read.password=6SvbL5+JhXQSpf+ASsQ0Rg==
22 22
23 #数据库用户名 23 #数据库用户名
24 jdbc.username=root 24 jdbc.username=root
......
...@@ -84,8 +84,8 @@ public class UTF8StringHttpMessageConverter extends AbstractHttpMessageConverter ...@@ -84,8 +84,8 @@ public class UTF8StringHttpMessageConverter extends AbstractHttpMessageConverter
84 } 84 }
85 85
86 private Charset getContentTypeCharset(MediaType contentType) { 86 private Charset getContentTypeCharset(MediaType contentType) {
87 if (contentType != null && contentType.getCharSet() != null) { 87 if (contentType != null && contentType.getCharset() != null) {
88 return contentType.getCharSet(); 88 return contentType.getCharset();
89 } 89 }
90 else { 90 else {
91 return DEFAULT_CHARSET; 91 return DEFAULT_CHARSET;
......
...@@ -84,8 +84,8 @@ public class UTF8StringHttpMessageConverter extends AbstractHttpMessageConverter ...@@ -84,8 +84,8 @@ public class UTF8StringHttpMessageConverter extends AbstractHttpMessageConverter
84 } 84 }
85 85
86 private Charset getContentTypeCharset(MediaType contentType) { 86 private Charset getContentTypeCharset(MediaType contentType) {
87 if (contentType != null && contentType.getCharSet() != null) { 87 if (contentType != null && contentType.getCharset() != null) {
88 return contentType.getCharSet(); 88 return contentType.getCharset();
89 } 89 }
90 else { 90 else {
91 return DEFAULT_CHARSET; 91 return DEFAULT_CHARSET;
......
...@@ -99,6 +99,13 @@ public interface MemberReadDao { ...@@ -99,6 +99,13 @@ public interface MemberReadDao {
99 */ 99 */
100 Regions getRegionsById(@Param("id") Integer id); 100 Regions getRegionsById(@Param("id") Integer id);
101 101
102 /**
103 * 根据id查询省市级信息
104 * @param regionIdList
105 * @return
106 */
107 List<Regions> getRegionsByIds(@Param("list") List regionIdList);
108
102 109
103 /** 110 /**
104 * 根据条件查询物流公司 111 * 根据条件查询物流公司
...@@ -148,4 +155,11 @@ public interface MemberReadDao { ...@@ -148,4 +155,11 @@ public interface MemberReadDao {
148 * @return 155 * @return
149 */ 156 */
150 int countOrderProductNum(@Param("id") String orderProductId); 157 int countOrderProductNum(@Param("id") String orderProductId);
158
159 /**
160 * 根据旧订单号获取新订单号
161 * @param orderSn
162 * @return
163 */
164 String getNewOrderSnByOldOrderSn(@Param("orderSn") String orderSn);
151 } 165 }
......
...@@ -18,6 +18,20 @@ ...@@ -18,6 +18,20 @@
18 <groupId>com.sibu.orderHelper.service</groupId> 18 <groupId>com.sibu.orderHelper.service</groupId>
19 <artifactId>com.sibu.orderHelper.service</artifactId> 19 <artifactId>com.sibu.orderHelper.service</artifactId>
20 <version>0.0.1-SNAPSHOT</version> 20 <version>0.0.1-SNAPSHOT</version>
21 <exclusions>
22 <exclusion>
23 <artifactId>slf4j-api</artifactId>
24 <groupId>org.slf4j</groupId>
25 </exclusion>
26 <exclusion>
27 <artifactId>spring-context</artifactId>
28 <groupId>org.springframework</groupId>
29 </exclusion>
30 <exclusion>
31 <artifactId>commons-logging</artifactId>
32 <groupId>commons-logging</groupId>
33 </exclusion>
34 </exclusions>
21 </dependency> 35 </dependency>
22 <dependency> 36 <dependency>
23 <groupId>net.sourceforge.jtds</groupId> 37 <groupId>net.sourceforge.jtds</groupId>
...@@ -30,6 +44,7 @@ ...@@ -30,6 +44,7 @@
30 <version>4.10</version> 44 <version>4.10</version>
31 <scope>test</scope> 45 <scope>test</scope>
32 </dependency> 46 </dependency>
47
33 </dependencies> 48 </dependencies>
34 <build> 49 <build>
35 <finalName>com.sibu.orderHelper.integralMall</finalName> 50 <finalName>com.sibu.orderHelper.integralMall</finalName>
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
28 28
29 <!--加载mq配置--> 29 <!--加载mq配置-->
30 <import resource="classpath:META-INF/conf/service-spring-mq.xml"></import> 30 <import resource="classpath:META-INF/conf/service-spring-mq.xml"></import>
31
32 <!--dubbo配置-->
33 <import resource="classpath:META-INF/conf/dubbo-consumer-config.xml"></import>
31 34
32 <!-- 开启注解配置 35 <!-- 开启注解配置
33 <context:annotation-config />--> 36 <context:annotation-config />-->
......
...@@ -281,6 +281,17 @@ ...@@ -281,6 +281,17 @@
281 where `id` = #{id} 281 where `id` = #{id}
282 </select> 282 </select>
283 283
284 <!-- 根据id查询省市级信息-->
285 <select id="getRegionsByIds" resultMap="regionsResult">
286 select
287 *
288 from `regions`
289 where `id` in
290 <foreach collection="list" item="regionId" open="(" close=")" separator=",">
291 #{regionId}
292 </foreach>
293 </select>
294
284 <!-- 物流公司实体--> 295 <!-- 物流公司实体-->
285 <resultMap id="courierCompanyResult" type="com.sibu.orderHelper.integral.pineapple.model.CourierCompany"> 296 <resultMap id="courierCompanyResult" type="com.sibu.orderHelper.integral.pineapple.model.CourierCompany">
286 <result property="id" column="id" /> 297 <result property="id" column="id" />
...@@ -467,6 +478,7 @@ ...@@ -467,6 +478,7 @@
467 <result column="member_back_code" property="refundno"/> 478 <result column="member_back_code" property="refundno"/>
468 <result column="order_sn" property="platorderno"/> 479 <result column="order_sn" property="platorderno"/>
469 <result column="order_product_id" property="subplatorderno"/> 480 <result column="order_product_id" property="subplatorderno"/>
481 <result column="orders_product_uid" property="ordersproductuid"/>
470 <result column="back_money" property="refundamount"/> 482 <result column="back_money" property="refundamount"/>
471 <result column="create_time" property="createtime"/> 483 <result column="create_time" property="createtime"/>
472 <result column="member_name" property="buyernick"/> 484 <result column="member_name" property="buyernick"/>
...@@ -485,9 +497,8 @@ ...@@ -485,9 +497,8 @@
485 497
486 <select id="getGetRefundBean" parameterType="java.util.Map" resultMap="GetRefundBeanMap"> 498 <select id="getGetRefundBean" parameterType="java.util.Map" resultMap="GetRefundBeanMap">
487 SELECT b.member_back_code,b.order_sn,b.order_product_id,b.back_money,b.create_time,b.member_name, 499 SELECT b.member_back_code,b.order_sn,b.order_product_id,b.back_money,b.create_time,b.member_name,
488 b.state_return,b.state_money,b.question,b.product_name,b.logistics_name,b.logistics_number ,b.seller_name, 500 b.state_return,b.state_money,b.question,b.product_name,b.logistics_name,b.logistics_number ,b.seller_name,b.orders_product_uid
489 o.money_order,o.order_state,o.remark 501 FROM member_product_back b
490 FROM member_product_back b LEFT JOIN orders o ON b.order_id = o.id
491 WHERE b.seller_id = #{supplierId} 502 WHERE b.seller_id = #{supplierId}
492 <if test="beginTime!=null"> 503 <if test="beginTime!=null">
493 AND b.create_time >= #{beginTime} 504 AND b.create_time >= #{beginTime}
...@@ -520,4 +531,8 @@ ...@@ -520,4 +531,8 @@
520 SELECT number FROM orders_product where id = #{id} 531 SELECT number FROM orders_product where id = #{id}
521 </select> 532 </select>
522 533
534 <select id="getNewOrderSnByOldOrderSn" parameterType="java.lang.String" resultType="java.lang.String">
535 SELECT order_sn FROM orders WHERE order_sn_back= #{orderSn}
536 </select>
537
523 </mapper> 538 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -20,6 +20,8 @@ public class GetRefundBean implements Serializable{ ...@@ -20,6 +20,8 @@ public class GetRefundBean implements Serializable{
20 //平台子订单号 20 //平台子订单号
21 private String subplatorderno; 21 private String subplatorderno;
22 22
23 private String ordersproductuid;
24
23 //订单总金额 25 //订单总金额
24 private BigDecimal totalamount; 26 private BigDecimal totalamount;
25 27
...@@ -296,4 +298,12 @@ public class GetRefundBean implements Serializable{ ...@@ -296,4 +298,12 @@ public class GetRefundBean implements Serializable{
296 public void setStateMoney(Integer stateMoney) { 298 public void setStateMoney(Integer stateMoney) {
297 this.stateMoney = stateMoney; 299 this.stateMoney = stateMoney;
298 } 300 }
301
302 public String getOrdersproductuid() {
303 return ordersproductuid;
304 }
305
306 public void setOrdersproductuid(String ordersproductuid) {
307 this.ordersproductuid = ordersproductuid;
308 }
299 } 309 }
......
...@@ -42,5 +42,12 @@ ...@@ -42,5 +42,12 @@
42 <artifactId>fastdfs-client-java</artifactId> 42 <artifactId>fastdfs-client-java</artifactId>
43 <version>5.0.4</version> 43 <version>5.0.4</version>
44 </dependency> 44 </dependency>
45
46 <dependency>
47 <groupId>com.sibu.sibu-mall-order</groupId>
48 <artifactId>sibu-mall-order-service-api</artifactId>
49 <version>1.0.0</version>
50 </dependency>
51
45 </dependencies> 52 </dependencies>
46 </project> 53 </project>
......
1 package com.sibu.orderHelper.integral.service.pineapple.impl; 1 package com.sibu.orderHelper.integral.service.pineapple.impl;
2 2
3 import com.sibu.orderHelper.common.constants.AppConstants; 3 import com.alibaba.dubbo.config.annotation.Reference;
4 import com.sibu.orderHelper.common.database.DBContextHolder; 4 import com.doubo.common.model.response.CommonResponse;
5 import com.sibu.orderHelper.common.strategy.DbUtil; 5 import com.sibu.mall.order.request.third.ThirdQueryOrderRequest;
6 import com.sibu.mall.order.response.api.ApiOrdersResponse;
7 import com.sibu.mall.order.service.ThirdApiOrderService;
8 import com.sibu.orderHelper.common.util.BeanCopyUtils;
6 import com.sibu.orderHelper.common.util.StringUtil; 9 import com.sibu.orderHelper.common.util.StringUtil;
7 import com.sibu.orderHelper.enums.*; 10 import com.sibu.orderHelper.enums.*;
8 import com.sibu.orderHelper.integral.dao.PineappleDao;
9 import com.sibu.orderHelper.integral.model.CheckRefundStatusBean;
10 import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
11 import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum; 11 import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum;
12 import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum;
13 import com.sibu.orderHelper.integral.pineapple.enums.PineappleExchangeEnum; 12 import com.sibu.orderHelper.integral.pineapple.enums.PineappleExchangeEnum;
14 import com.sibu.orderHelper.integral.pineapple.exception.BizException; 13 import com.sibu.orderHelper.integral.pineapple.exception.BizException;
15 import com.sibu.orderHelper.integral.pineapple.model.MemberProductBack; 14 import com.sibu.orderHelper.integral.pineapple.model.MemberProductBack;
...@@ -22,7 +21,6 @@ import com.sibu.orderHelper.integral.request.CheckRefundStatusRequest; ...@@ -22,7 +21,6 @@ import com.sibu.orderHelper.integral.request.CheckRefundStatusRequest;
22 import com.sibu.orderHelper.mall.member.read.MemberReadDao; 21 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
23 import org.apache.log4j.Logger; 22 import org.apache.log4j.Logger;
24 import org.springframework.stereotype.Service; 23 import org.springframework.stereotype.Service;
25
26 import javax.annotation.Resource; 24 import javax.annotation.Resource;
27 import java.util.*; 25 import java.util.*;
28 26
...@@ -33,13 +31,28 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef ...@@ -33,13 +31,28 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
33 @Resource 31 @Resource
34 private MemberReadDao memberReadDao; 32 private MemberReadDao memberReadDao;
35 33
34 @Reference
35 private ThirdApiOrderService thirdApiOrderService;
36
36 @Override 37 @Override
37 public CheckRefundStatusResponse call(CallRequest<CheckRefundStatusRequest> callRequest) throws Exception { 38 public CheckRefundStatusResponse call(CallRequest<CheckRefundStatusRequest> callRequest) throws Exception {
38 CheckRefundStatusResponse checkRefundStatusResponse = new CheckRefundStatusResponse(); 39 CheckRefundStatusResponse checkRefundStatusResponse = new CheckRefundStatusResponse();
39 Map<String,Object> params = new HashMap<>(); 40
40 params.put("orderSn",callRequest.getBizModel().getOrderID()); 41 //旧订单号处理
41 params.put("sellerId",callRequest.getSupplier().getId()); 42 if(!callRequest.getBizModel().getOrderID().startsWith("B")){
42 Orders orders = memberReadDao.getOrdersByMap(params); 43 callRequest.getBizModel().setOrderID(memberReadDao.getNewOrderSnByOldOrderSn(callRequest.getBizModel().getOrderID()));
44 }
45
46 ThirdQueryOrderRequest thirdQueryOrderRequest = new ThirdQueryOrderRequest();
47 thirdQueryOrderRequest.setOrderSn(callRequest.getBizModel().getOrderID());
48 thirdQueryOrderRequest.setSellerId(callRequest.getSupplier().getId());
49 Orders orders = null;
50 CommonResponse<ApiOrdersResponse> commonResponse = thirdApiOrderService.getOrdersByMap(thirdQueryOrderRequest);
51 if(commonResponse.isSuccess()){
52 orders = BeanCopyUtils.copyProperties(Orders.class, commonResponse.getResult());
53 }else {
54 throw new BizException(commonResponse.getErrorMsg());
55 }
43 if(StringUtil.isNull(orders)){ 56 if(StringUtil.isNull(orders)){
44 log.error(String.format("检测订单退款,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID())); 57 log.error(String.format("检测订单退款,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID()));
45 throw new BizException(String.format("检测订单退款,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID())); 58 throw new BizException(String.format("检测订单退款,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID()));
......
1 package com.sibu.orderHelper.integral.service.pineapple.impl; 1 package com.sibu.orderHelper.integral.service.pineapple.impl;
2 2
3 import com.sibu.orderHelper.common.constants.AppConstants; 3 import com.alibaba.dubbo.config.annotation.Reference;
4 import com.sibu.orderHelper.common.database.DBContextHolder; 4 import com.doubo.common.model.response.CommonResponse;
5 import com.sibu.orderHelper.common.strategy.DbUtil; 5 import com.sibu.mall.common.response.PageResult;
6 import com.sibu.mall.order.request.api.ApiOrdersSnRequest;
7 import com.sibu.mall.order.request.third.ThirdPageQueryOrderListRequest;
8 import com.sibu.mall.order.response.api.ApiOrdersProductResponse;
9 import com.sibu.mall.order.response.api.ApiOrdersResponse;
10 import com.sibu.mall.order.service.ApiOrdersProductService;
11 import com.sibu.mall.order.service.ThirdApiOrderService;
12 import com.sibu.orderHelper.common.util.BeanCopyUtils;
6 import com.sibu.orderHelper.common.util.StringUtil; 13 import com.sibu.orderHelper.common.util.StringUtil;
7 import com.sibu.orderHelper.integral.dao.IMDoingOrderDao;
8 import com.sibu.orderHelper.integral.dao.PineappleDao;
9 import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
10 import com.sibu.orderHelper.integral.model.IMProductBean;
11 import com.sibu.orderHelper.integral.model.IMSupplier;
12 import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst; 14 import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst;
13 import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum;
14 import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum; 15 import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum;
15 import com.sibu.orderHelper.integral.pineapple.exception.BizException; 16 import com.sibu.orderHelper.integral.pineapple.exception.BizException;
16 import com.sibu.orderHelper.integral.pineapple.model.Orders; 17 import com.sibu.orderHelper.integral.pineapple.model.Orders;
17 import com.sibu.orderHelper.integral.pineapple.model.OrdersProduct; 18 import com.sibu.orderHelper.integral.pineapple.model.OrdersProduct;
19 import com.sibu.orderHelper.integral.pineapple.model.Regions;
18 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 20 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
19
20 import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest; 21 import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest;
21 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; 22 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
22 import com.sibu.orderHelper.integral.pineapple.response.GetOrderResponse; 23 import com.sibu.orderHelper.integral.pineapple.response.GetOrderResponse;
23 import com.sibu.orderHelper.integral.pineapple.response.OrderGoodResponse; 24 import com.sibu.orderHelper.integral.pineapple.response.OrderGoodResponse;
24 import com.sibu.orderHelper.integral.pineapple.response.OrderResponse; 25 import com.sibu.orderHelper.integral.pineapple.response.OrderResponse;
25 import com.sibu.orderHelper.integral.reponse.DoingOrder1DetailResponse;
26 import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse;
27 import com.sibu.orderHelper.integral.service.IIMDoingOrderService;
28 import com.sibu.orderHelper.integral.service.impl.IMDoingOrderService;
29 import com.sibu.orderHelper.integral.service.pineapple.converter.PlatformOrderToPineAppleOrderConverter; 26 import com.sibu.orderHelper.integral.service.pineapple.converter.PlatformOrderToPineAppleOrderConverter;
30 import com.sibu.orderHelper.mall.member.read.MemberReadDao; 27 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
31 import com.sibu.orderHelper.service.redis.RedisProductSkuService;
32 import org.apache.commons.lang3.StringUtils;
33 import org.apache.log4j.Logger; 28 import org.apache.log4j.Logger;
34 import org.springframework.beans.factory.annotation.Autowired; 29 import org.springframework.beans.factory.annotation.Autowired;
35 import org.springframework.stereotype.Service; 30 import org.springframework.stereotype.Service;
36
37 import javax.annotation.Resource; 31 import javax.annotation.Resource;
38 import javax.xml.bind.ValidationException;
39 import java.math.BigDecimal; 32 import java.math.BigDecimal;
40 import java.text.MessageFormat; 33 import java.text.MessageFormat;
41 import java.text.SimpleDateFormat; 34 import java.text.SimpleDateFormat;
42 import java.util.ArrayList; 35 import java.util.ArrayList;
43 import java.util.HashMap;
44 import java.util.List; 36 import java.util.List;
45 import java.util.Map; 37 import java.util.Optional;
46 import java.util.stream.Collectors; 38 import java.util.stream.Collectors;
47 39
48 /** 40 /**
...@@ -61,30 +53,78 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> ...@@ -61,30 +53,78 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
61 @Resource 53 @Resource
62 private MemberReadDao memberReadDao; 54 private MemberReadDao memberReadDao;
63 55
56 @Reference
57 private ApiOrdersProductService apiOrdersProductService;
58
59 @Reference
60 private ThirdApiOrderService thirdApiOrderService;
61
64 @Override 62 @Override
65 public BaseResponse call(CallRequest<GetOrderRequest> callRequest) { 63 public BaseResponse call(CallRequest<GetOrderRequest> callRequest) {
66 Map<String,Object> params = new HashMap<>(); 64 ThirdPageQueryOrderListRequest thirdPageQueryOrderListRequest = new ThirdPageQueryOrderListRequest();
67 if(!StringUtil.isNull(callRequest.getBizModel().getPlatOrderNo())){ 65 if(!StringUtil.isNull(callRequest.getBizModel().getPlatOrderNo())){
68 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); 66 //旧订单号处理
67 if(!callRequest.getBizModel().getPlatOrderNo().startsWith("B")){
68 callRequest.getBizModel().setPlatOrderNo(memberReadDao.getNewOrderSnByOldOrderSn(callRequest.getBizModel().getPlatOrderNo()));
69 }
70 thirdPageQueryOrderListRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
69 } 71 }
70 if(!StringUtil.isNull(callRequest.getBizModel().getOrderStatus())){ 72 if(!StringUtil.isNull(callRequest.getBizModel().getOrderStatus())){
71 OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolve(callRequest.getBizModel().getOrderStatus()); 73 OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolve(callRequest.getBizModel().getOrderStatus());
72 params.put("orderState",orderStatusEnum.getMallOrderStatus()); 74 thirdPageQueryOrderListRequest.setOrderState(orderStatusEnum.getMallOrderStatus());
73 } 75 }
74 params.put("sellerId",callRequest.getSupplier().getId()); 76
77 thirdPageQueryOrderListRequest.setSellerId(callRequest.getSupplier().getId());
75 if(!StringUtil.isNull(callRequest.getBizModel().getStartTime())){ 78 if(!StringUtil.isNull(callRequest.getBizModel().getStartTime())){
76 params.put("startTime",callRequest.getBizModel().getStartTime()); 79 thirdPageQueryOrderListRequest.setStartTime(callRequest.getBizModel().getStartTime());
77 } 80 }
78 if(!StringUtil.isNull(callRequest.getBizModel().getEndTime())){ 81 if(!StringUtil.isNull(callRequest.getBizModel().getEndTime())){
79 params.put("endTime",callRequest.getBizModel().getEndTime()); 82 thirdPageQueryOrderListRequest.setEndTime(callRequest.getBizModel().getEndTime());
80 } 83 }
81 params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize()); 84 thirdPageQueryOrderListRequest.setPageNow(callRequest.getBizModel().getPageIndex());
82 params.put("PageSize",callRequest.getBizModel().getPageSize()); 85 thirdPageQueryOrderListRequest.setPageSize(callRequest.getBizModel().getPageSize());
83 List<Orders> ordersList = memberReadDao.getOrdersList(params); 86
87 CommonResponse<PageResult<ApiOrdersResponse>> thirdResponse = thirdApiOrderService.pageOrder(thirdPageQueryOrderListRequest);
88
84 GetOrderResponse response = new GetOrderResponse(); 89 GetOrderResponse response = new GetOrderResponse();
85 response.setNumTotalOrder(memberReadDao.countgetOrdersList(params)); 90 response.setNumTotalOrder(0);
86 response.setOrders(findOrders(ordersList)); 91 response.setOrders(new ArrayList<>());
87 response.setCode(PineAppleConst.SUCCESS_CODE); 92 response.setCode(PineAppleConst.SUCCESS_CODE);
93 if(thirdResponse.isSuccess()){
94
95 List<Orders> ordersList = BeanCopyUtils.copyList(Orders.class,thirdResponse.getResult().getDatas());
96
97 List<Integer> provinceIdList = ordersList.stream().map(o->o.getProvinceId()).collect(Collectors.toList());
98 List<Regions> provinceList = memberReadDao.getRegionsByIds(provinceIdList);
99
100 List<Integer> cityIdList = ordersList.stream().map(o->o.getCityId()).collect(Collectors.toList());
101 List<Regions> cityList = memberReadDao.getRegionsByIds(cityIdList);
102
103 List<Integer> areaIdList = ordersList.stream().map(o->o.getAreaId()).collect(Collectors.toList());
104 List<Regions> areaList = memberReadDao.getRegionsByIds(areaIdList);
105
106 ordersList.stream().forEach(i->{
107 Optional<Regions> province = provinceList.stream().filter(p->p.getId().intValue() == i.getProvinceId()).findFirst();
108 province.ifPresent(e->{
109 i.setRegionName1(e.getRegionName());
110 });
111
112 Optional<Regions> city = cityList.stream().filter(p->p.getId().intValue() == i.getCityId()).findFirst();
113 city.ifPresent(e->{
114 i.setRegionName2(e.getRegionName());
115 });
116
117 Optional<Regions> area = areaList.stream().filter(p->p.getId().intValue() == i.getAreaId()).findFirst();
118 area.ifPresent(e->{
119 i.setRegionName3(e.getRegionName());
120 });
121 });
122
123 response.setNumTotalOrder(thirdResponse.getResult().getTotalRecord());
124 response.setOrders(findOrders(ordersList));
125 }else {
126 throw new BizException(thirdResponse.getErrorMsg());
127 }
88 return response; 128 return response;
89 } 129 }
90 130
...@@ -94,7 +134,12 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> ...@@ -94,7 +134,12 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
94 ordersList.stream().forEach(o ->{ 134 ordersList.stream().forEach(o ->{
95 OrderResponse orderResponse = this.getOrderResponse(o); 135 OrderResponse orderResponse = this.getOrderResponse(o);
96 try { 136 try {
97 List<OrdersProduct> ordersProductList = memberReadDao.getOrdersProductList(o.getOrderSn()); 137 List<OrdersProduct> ordersProductList = null;
138 CommonResponse<List<ApiOrdersProductResponse>> commonResponse = apiOrdersProductService.getOrdersProductByOrderSn(new ApiOrdersSnRequest(o.getOrderSn()));
139 if(commonResponse.isSuccess()){
140 ordersProductList = BeanCopyUtils.copyList(OrdersProduct.class, commonResponse.getResult());
141 }
142
98 if(StringUtil.isNull(ordersProductList)){ 143 if(StringUtil.isNull(ordersProductList)){
99 throw new BizException(String.format("获取子订单数据业务异常[%s]",(o.getOrderSn()))); 144 throw new BizException(String.format("获取子订单数据业务异常[%s]",(o.getOrderSn())));
100 } 145 }
......
1 package com.sibu.orderHelper.integral.service.pineapple.impl; 1 package com.sibu.orderHelper.integral.service.pineapple.impl;
2 2
3 import com.alibaba.dubbo.config.annotation.Reference;
4 import com.doubo.common.model.response.CommonResponse;
5 import com.sibu.mall.order.request.api.ApiOrdersSnRequest;
6 import com.sibu.mall.order.request.third.ThirdOrdersProductIdRequest;
7 import com.sibu.mall.order.response.api.ApiOrdersResponse;
8 import com.sibu.mall.order.service.ApiOrdersService;
9 import com.sibu.mall.order.service.ThirdApiOrderService;
3 import com.sibu.orderHelper.common.constants.AppConstants; 10 import com.sibu.orderHelper.common.constants.AppConstants;
4 import com.sibu.orderHelper.common.database.DBContextHolder; 11 import com.sibu.orderHelper.common.database.DBContextHolder;
5 import com.sibu.orderHelper.common.strategy.DbUtil; 12 import com.sibu.orderHelper.common.strategy.DbUtil;
...@@ -36,6 +43,12 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques ...@@ -36,6 +43,12 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
36 @Resource 43 @Resource
37 private MemberReadDao memberReadDao; 44 private MemberReadDao memberReadDao;
38 45
46 @Reference
47 private ThirdApiOrderService thirdApiOrderService;
48
49 @Reference
50 private ApiOrdersService apiOrdersService;
51
39 @Override 52 @Override
40 public GetRefundResponse call(CallRequest<GetRefundRequest> callRequest) throws Exception { 53 public GetRefundResponse call(CallRequest<GetRefundRequest> callRequest) throws Exception {
41 GetRefundResponse getRefundResponse =new GetRefundResponse(); 54 GetRefundResponse getRefundResponse =new GetRefundResponse();
...@@ -49,8 +62,23 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques ...@@ -49,8 +62,23 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
49 List<GetRefundBean> refundBeanList = memberReadDao.getGetRefundBean(params); 62 List<GetRefundBean> refundBeanList = memberReadDao.getGetRefundBean(params);
50 if(!StringUtil.isNull(refundBeanList) && !refundBeanList.isEmpty()){ 63 if(!StringUtil.isNull(refundBeanList) && !refundBeanList.isEmpty()){
51 for(GetRefundBean getRefundBean:refundBeanList){ 64 for(GetRefundBean getRefundBean:refundBeanList){
52 int productNum = memberReadDao.countOrderProductNum(getRefundBean.getSubplatorderno()); 65
53 getRefundBean.setProductnum(productNum); 66 String orderSn = getRefundBean.getPlatorderno();
67 //旧订单号处理
68 if(!orderSn.startsWith("B")){
69 orderSn = memberReadDao.getNewOrderSnByOldOrderSn(orderSn);
70 }
71
72 CommonResponse<ApiOrdersResponse> orderResponse = apiOrdersService.getOrdersByOrderSn(new ApiOrdersSnRequest(orderSn));
73 if(orderResponse.isSuccess()){
74 getRefundBean.setTotalamount(orderResponse.getResult().getMoneyOrder());
75 getRefundBean.setPayamount(orderResponse.getResult().getMoneyOrder());
76 getRefundBean.setOrderstatus(String.valueOf(orderResponse.getResult().getOrderState()));
77 }else {
78 throw new BizException(orderResponse.getErrorMsg());
79 }
80 CommonResponse<Integer> response = thirdApiOrderService.countOrderProductNum(new ThirdOrdersProductIdRequest(getRefundBean.getOrdersproductuid(),orderSn));
81 getRefundBean.setProductnum(response.getResult());
54 OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolveByPlatformOrderStatus(Integer.valueOf(getRefundBean.getOrderstatus())); 82 OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolveByPlatformOrderStatus(Integer.valueOf(getRefundBean.getOrderstatus()));
55 if(orderStatusEnum.getCode().equals(OrderStatusEnum.UNKNOWN.getCode())){ 83 if(orderStatusEnum.getCode().equals(OrderStatusEnum.UNKNOWN.getCode())){
56 throw new BizException(String.format("菠萝派退款单下载,枚举查询订单状态报错,订单状态【{0}】转换失败",getRefundBean.getOrderstatus())); 84 throw new BizException(String.format("菠萝派退款单下载,枚举查询订单状态报错,订单状态【{0}】转换失败",getRefundBean.getOrderstatus()));
......
1 package com.sibu.orderHelper.integral.service.pineapple.impl; 1 package com.sibu.orderHelper.integral.service.pineapple.impl;
2 2
3 import com.sibu.orderHelper.common.constants.AppConstants; 3 import com.alibaba.dubbo.config.annotation.Reference;
4 import com.sibu.orderHelper.common.database.DBContextHolder; 4 import com.doubo.common.model.response.CommonResponse;
5 import com.sibu.orderHelper.common.strategy.DbUtil; 5 import com.sibu.mall.order.request.third.ThirdQueryOrderRequest;
6 import com.sibu.mall.order.request.third.ThirdUpdateOrderRequest;
7 import com.sibu.mall.order.response.api.ApiOrdersResponse;
8 import com.sibu.mall.order.service.ThirdApiOrderService;
9 import com.sibu.orderHelper.common.util.BeanCopyUtils;
6 import com.sibu.orderHelper.common.util.StringUtil; 10 import com.sibu.orderHelper.common.util.StringUtil;
7 import com.sibu.orderHelper.enums.PayOrderStatus;
8 import com.sibu.orderHelper.enums.PineappleEnum; 11 import com.sibu.orderHelper.enums.PineappleEnum;
9 import com.sibu.orderHelper.enums.PineappleMethodsEnum; 12 import com.sibu.orderHelper.enums.PineappleMethodsEnum;
10 import com.sibu.orderHelper.integral.dao.PineappleDao;
11 import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
12 import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum; 13 import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum;
13 import com.sibu.orderHelper.integral.pineapple.exception.BizException; 14 import com.sibu.orderHelper.integral.pineapple.exception.BizException;
14 import com.sibu.orderHelper.integral.pineapple.model.CourierCompany; 15 import com.sibu.orderHelper.integral.pineapple.model.CourierCompany;
...@@ -21,7 +22,6 @@ import com.sibu.orderHelper.mall.member.read.MemberReadDao; ...@@ -21,7 +22,6 @@ import com.sibu.orderHelper.mall.member.read.MemberReadDao;
21 import com.sibu.orderHelper.mall.member.write.MemberWriteDao; 22 import com.sibu.orderHelper.mall.member.write.MemberWriteDao;
22 import org.apache.log4j.Logger; 23 import org.apache.log4j.Logger;
23 import org.springframework.stereotype.Service; 24 import org.springframework.stereotype.Service;
24
25 import javax.annotation.Resource; 25 import javax.annotation.Resource;
26 import java.util.*; 26 import java.util.*;
27 27
...@@ -34,14 +34,32 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -34,14 +34,32 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
34 @Resource 34 @Resource
35 private MemberWriteDao memberWriteDao; 35 private MemberWriteDao memberWriteDao;
36 36
37 @Reference
38 private ThirdApiOrderService thirdApiOrderService;
39
37 @Override 40 @Override
38 public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception { 41 public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception {
39 BaseResponse baseResponse =new BaseResponse(); 42 BaseResponse baseResponse =new BaseResponse();
40 Map<String,Object> params = new HashMap<>(); 43 ThirdUpdateOrderRequest thirdUpdateOrderRequest = new ThirdUpdateOrderRequest();
41 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); 44
42 params.put("sellerId",callRequest.getSupplier().getId()); 45 //旧订单号处理
46 if(!callRequest.getBizModel().getPlatOrderNo().startsWith("B")){
47 callRequest.getBizModel().setPlatOrderNo(memberReadDao.getNewOrderSnByOldOrderSn(callRequest.getBizModel().getPlatOrderNo()));
48 }
49
50 thirdUpdateOrderRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
51 thirdUpdateOrderRequest.setSellerId(callRequest.getSupplier().getId());
43 52
44 Orders orders = memberWriteDao.getOrdersByMap(params); 53 ThirdQueryOrderRequest thirdQueryOrderRequest = new ThirdQueryOrderRequest();
54 thirdQueryOrderRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
55 thirdQueryOrderRequest.setSellerId(callRequest.getSupplier().getId());
56 Orders orders = null;
57 CommonResponse<ApiOrdersResponse> commonResponse = thirdApiOrderService.getOrdersByMap(thirdQueryOrderRequest);
58 if(commonResponse.isSuccess()){
59 orders = BeanCopyUtils.copyProperties(Orders.class, commonResponse.getResult());
60 }else {
61 throw new BizException(commonResponse.getErrorMsg());
62 }
45 if(StringUtil.isNull(orders)){ 63 if(StringUtil.isNull(orders)){
46 log.error(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo())); 64 log.error(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo()));
47 throw new BizException(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo())); 65 throw new BizException(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo()));
...@@ -52,14 +70,14 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -52,14 +70,14 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
52 70
53 if( orders.getOrderState().intValue() == EJavaShopOrderStateEnum.WaitShip.getCode()){ 71 if( orders.getOrderState().intValue() == EJavaShopOrderStateEnum.WaitShip.getCode()){
54 //订单状态 72 //订单状态
55 params.put("orderState",EJavaShopOrderStateEnum.HasReceived.getCode()); 73 thirdUpdateOrderRequest.setOrderState(EJavaShopOrderStateEnum.HasReceived.getCode());
56 //收货人名字 74 //收货人名字
57 if(!StringUtil.isNull(callRequest.getBizModel().getSenderName())){ 75 if(!StringUtil.isNull(callRequest.getBizModel().getSenderName())){
58 params.put("name",callRequest.getBizModel().getSenderName()); 76 thirdUpdateOrderRequest.setName(callRequest.getBizModel().getSenderName());
59 } 77 }
60 //电话 78 //电话
61 if(!StringUtil.isNull(callRequest.getBizModel().getSenderTel())){ 79 if(!StringUtil.isNull(callRequest.getBizModel().getSenderTel())){
62 params.put("mobile",callRequest.getBizModel().getSenderTel()); 80 thirdUpdateOrderRequest.setMobile(callRequest.getBizModel().getSenderTel());
63 } 81 }
64 //地址、快递信息 建议去除 82 //地址、快递信息 建议去除
65 //this.gainInfo(params,callRequest,orders); 83 //this.gainInfo(params,callRequest,orders);
...@@ -68,16 +86,18 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -68,16 +86,18 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
68 86
69 if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){ 87 if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){
70 //判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去 88 //判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去
71 Map<String,Object> checkMap = new HashMap<>(); 89 /* Map<String,Object> checkMap = new HashMap<>();
72 checkMap.put("logisticsNumber",callRequest.getBizModel().getLogisticNo()); 90 checkMap.put("logisticsNumber",callRequest.getBizModel().getLogisticNo());
73 checkMap.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); 91 checkMap.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
74 checkMap.put("sellerId",callRequest.getSupplier().getId()); 92 checkMap.put("sellerId",callRequest.getSupplier().getId());
75 int num = memberWriteDao.checkLogisticsNumber(checkMap); 93 int num = memberWriteDao.checkLogisticsNumber(checkMap);*/
76 if(num == 0){ 94 thirdQueryOrderRequest.setLogisticsNumber(callRequest.getBizModel().getLogisticNo());
95 CommonResponse<Boolean> response = thirdApiOrderService.checkLogisticsNumber(thirdQueryOrderRequest);
96 if(response.isSuccess() && !response.getResult()){
77 if(StringUtil.isNull(orders.getLogisticsNumber())){ 97 if(StringUtil.isNull(orders.getLogisticsNumber())){
78 params.put("logisticsNumber",callRequest.getBizModel().getLogisticNo()); 98 thirdUpdateOrderRequest.setLogisticsNumber(callRequest.getBizModel().getLogisticNo());
79 }else{ 99 }else{
80 params.put("logisticsNumber",orders.getLogisticsNumber()+";"+callRequest.getBizModel().getLogisticNo()); 100 thirdUpdateOrderRequest.setLogisticsNumber(orders.getLogisticsNumber()+";"+callRequest.getBizModel().getLogisticNo());
81 } 101 }
82 } 102 }
83 } 103 }
...@@ -87,7 +107,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -87,7 +107,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
87 throw new BizException(String.format("订单发货接口,该订单状态不允许进行发货操作,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 107 throw new BizException(String.format("订单发货接口,该订单状态不允许进行发货操作,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
88 } 108 }
89 //修改订单信息 109 //修改订单信息
90 memberWriteDao.updateOrdersState(params); 110 thirdApiOrderService.updateOrders(thirdUpdateOrderRequest);
91 baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); 111 baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
92 baseResponse.setCode(PineappleEnum.SUCCESS.getCode()); 112 baseResponse.setCode(PineappleEnum.SUCCESS.getCode());
93 return baseResponse; 113 return baseResponse;
......
1 package com.sibu.orderHelper.integral.service.pineapple.impl; 1 package com.sibu.orderHelper.integral.service.pineapple.impl;
2 2
3 import com.sibu.orderHelper.common.constants.AppConstants; 3 import com.alibaba.dubbo.config.annotation.Reference;
4 import com.sibu.orderHelper.common.database.DBContextHolder; 4 import com.doubo.common.model.response.CommonResponse;
5 import com.sibu.orderHelper.common.strategy.DbUtil; 5 import com.sibu.mall.order.request.third.ThirdQueryOrderRequest;
6 import com.sibu.mall.order.request.third.ThirdUpdateOrderRequest;
7 import com.sibu.mall.order.response.api.ApiOrdersResponse;
8 import com.sibu.mall.order.service.ThirdApiOrderService;
9 import com.sibu.orderHelper.common.util.BeanCopyUtils;
6 import com.sibu.orderHelper.common.util.StringUtil; 10 import com.sibu.orderHelper.common.util.StringUtil;
7 import com.sibu.orderHelper.enums.PineappleEnum; 11 import com.sibu.orderHelper.enums.PineappleEnum;
8 import com.sibu.orderHelper.enums.PineappleMethodsEnum; 12 import com.sibu.orderHelper.enums.PineappleMethodsEnum;
9 import com.sibu.orderHelper.integral.dao.PineappleDao;
10 import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
11 import com.sibu.orderHelper.integral.pineapple.exception.BizException; 13 import com.sibu.orderHelper.integral.pineapple.exception.BizException;
12 import com.sibu.orderHelper.integral.pineapple.model.Orders; 14 import com.sibu.orderHelper.integral.pineapple.model.Orders;
13 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 15 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
14 import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse; 16 import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse;
15 import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest; 17 import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest;
16 import com.sibu.orderHelper.mall.member.read.MemberReadDao; 18 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
17 import com.sibu.orderHelper.mall.member.write.MemberWriteDao;
18 import org.apache.log4j.Logger; 19 import org.apache.log4j.Logger;
19 import org.springframework.stereotype.Service; 20 import org.springframework.stereotype.Service;
20 import org.springframework.transaction.annotation.Transactional;
21
22 import javax.annotation.Resource; 21 import javax.annotation.Resource;
23 import java.util.HashMap; 22
24 import java.util.Map;
25 @Service 23 @Service
26 public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateSellerMemoRequest> { 24 public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateSellerMemoRequest> {
27 25
28 private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class); 26 private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class);
29 27
30 @Resource 28 @Resource
31 private MemberWriteDao memberWriteDao; 29 private MemberReadDao memberReadDao;
30
31 @Reference
32 private ThirdApiOrderService thirdApiOrderService;
32 33
33 @Override 34 @Override
34 public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception { 35 public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception {
35 UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse(); 36 UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
36 Map<String,Object> params = new HashMap<>(); 37
37 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); 38 ThirdQueryOrderRequest thirdQueryOrderRequest = new ThirdQueryOrderRequest();
38 params.put("remark",callRequest.getBizModel().getSellerMemo()); 39 //旧订单号处理
39 params.put("sellerId",callRequest.getSupplier().getId()); 40 if(!callRequest.getBizModel().getPlatOrderNo().startsWith("B")){
40 Orders orders = memberWriteDao.getOrdersByMap(params); 41 callRequest.getBizModel().setPlatOrderNo(memberReadDao.getNewOrderSnByOldOrderSn(callRequest.getBizModel().getPlatOrderNo()));
42 }
43
44 thirdQueryOrderRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
45 thirdQueryOrderRequest.setSellerId(callRequest.getSupplier().getId());
46
47 ThirdUpdateOrderRequest thirdUpdateOrderRequest = new ThirdUpdateOrderRequest();
48 thirdUpdateOrderRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
49 thirdUpdateOrderRequest.setSellerId(callRequest.getSupplier().getId());
50 thirdUpdateOrderRequest.setRemark(callRequest.getBizModel().getSellerMemo());
51
52 Orders orders = null;
53 CommonResponse<ApiOrdersResponse> response = thirdApiOrderService.getOrdersByMap(thirdQueryOrderRequest);
54 if(response.isSuccess()){
55 orders = BeanCopyUtils.copyProperties(Orders.class,response.getResult());
56 }else {
57 throw new BizException(response.getErrorMsg());
58 }
41 if(StringUtil.isNull(orders)){ 59 if(StringUtil.isNull(orders)){
42 log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 60 log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
43 throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 61 throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
44 } 62 }
45 if(memberWriteDao.updateOdersRemark(params) != 1){ 63 CommonResponse<Boolean> updateResponse = thirdApiOrderService.updateOrders(thirdUpdateOrderRequest);
64 if(!updateResponse.isSuccess()){
46 log.error(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 65 log.error(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
47 throw new BizException(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 66 throw new BizException(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
48 } 67 }
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
25 </modules> 25 </modules>
26 <properties> 26 <properties>
27 <!-- spring版本 --> 27 <!-- spring版本 -->
28 <spring.version>4.0.0.RELEASE</spring.version> 28 <spring.version>4.3.16.RELEASE</spring.version>
29 <!-- mybatis版本 --> 29 <!-- mybatis版本 -->
30 <mybatis.version>3.2.4</mybatis.version> 30 <mybatis.version>3.2.4</mybatis.version>
31 <!-- log4j日志文件管理包版 --> 31 <!-- log4j日志文件管理包版 -->
32 <slf4j.version>1.6.6</slf4j.version> 32 <slf4j.version>1.7.25</slf4j.version>
33 <log4j.version>1.2.13</log4j.version> 33 <log4j.version>1.2.17</log4j.version>
34 <!-- mysql驱动的版 --> 34 <!-- mysql驱动的版 -->
35 <mysql.version>5.1.35</mysql.version> 35 <mysql.version>5.1.35</mysql.version>
36 <!-- <mysql.version>3.1.14</mysql.version> --> 36 <!-- <mysql.version>3.1.14</mysql.version> -->
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
47 47
48 <doubo-parent.version>2.0.0</doubo-parent.version> 48 <doubo-parent.version>2.0.0</doubo-parent.version>
49 49
50 <dubbo.version>2.6.3</dubbo.version>
51
52 <curator.version>2.12.0</curator.version>
53
50 </properties> 54 </properties>
51 <dependencies> 55 <dependencies>
52 <dependency> 56 <dependency>
...@@ -406,6 +410,32 @@ ...@@ -406,6 +410,32 @@
406 <artifactId>protobuf-java</artifactId> 410 <artifactId>protobuf-java</artifactId>
407 <version>2.6.1</version> 411 <version>2.6.1</version>
408 </dependency> 412 </dependency>
413
414 <!-- dubbo begin -->
415 <!-- https://mvnrepository.com/artifact/com.alibaba/dubbo -->
416 <dependency>
417 <groupId>com.alibaba</groupId>
418 <artifactId>dubbo</artifactId>
419 <version>${dubbo.version}</version>
420 <exclusions>
421 <exclusion>
422 <artifactId>slf4j-log4j12</artifactId>
423 <groupId>org.slf4j</groupId>
424 </exclusion>
425 </exclusions>
426 </dependency>
427 <dependency>
428 <groupId>org.apache.curator</groupId>
429 <artifactId>curator-framework</artifactId>
430 <version>${curator.version}</version>
431 </dependency>
432 <dependency>
433 <groupId>org.apache.curator</groupId>
434 <artifactId>curator-recipes</artifactId>
435 <version>${curator.version}</version>
436 </dependency>
437 <!-- dubbo begin -->
438
409 <!-- taobao sms start --> 439 <!-- taobao sms start -->
410 <dependency> 440 <dependency>
411 <groupId>com.taobao</groupId> 441 <groupId>com.taobao</groupId>
...@@ -426,12 +456,6 @@ ...@@ -426,12 +456,6 @@
426 <version>${doubo-parent.version}</version> 456 <version>${doubo-parent.version}</version>
427 </dependency> 457 </dependency>
428 <!--阿里mq--> 458 <!--阿里mq-->
429
430 <dependency>
431 <groupId>cglib</groupId>
432 <artifactId>cglib</artifactId>
433 <version>3.1</version>
434 </dependency>
435 </dependencies> 459 </dependencies>
436 <dependencyManagement> 460 <dependencyManagement>
437 <dependencies> 461 <dependencies>
......