dd28baea lauka

Merge branch 'dev-feature_分库分表v1.0'

Conflicts:
	com.sibu.orderHelper.service/pom.xml
2 个父辈 d97d4f2a 35215635
正在显示 57 个修改的文件 包含 1697 行增加201 行删除
......@@ -13,7 +13,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources/META-INF/conf" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
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">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:META-INF/conf/dubbo.properties</value>
</list>
</property>
</bean>
<!-- zookeeper注册中心 -->
<dubbo:registry protocol="zookeeper" address="${dubbo.registryAddress}" />
<!-- 远程服务代理接口 -->
<dubbo:annotation package="com.sibu.mall.order" />
<!-- 关闭提供者的检索 -->
<dubbo:consumer check="false" group="${dubbo.consumer.group}" version="${dubbo.consumerVersion}"/>
<!-- 服务调用超时,超时重试-->
<dubbo:provider delay="-1" timeout="${dubbo.connectTimeOut}" retries="${dubbo.connectRetries}"/>
<!-- 消费者名称 -->
<dubbo:application name="${dubbo.applicationName}" />
</beans>
\ No newline at end of file
##################### dubbo begin #############################
dubbo.registryAddress = zookeeper://111.230.133.155:2181?backup=111.231.243.221:2181,118.89.51.164:2181
dubbo.applicationName = mall-third-consumer
dubbo.connectTimeOut = 20000
dubbo.connectRetries= 0
dubbo.consumer.group= dev.sso.qiujw
dubbo.consumerVersion= 1.0
##################### dubbo end #############################
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
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">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:META-INF/conf/dubbo.properties</value>
</list>
</property>
</bean>
<!-- zookeeper注册中心 -->
<dubbo:registry protocol="zookeeper" address="${dubbo.registryAddress}" />
<!-- 远程服务代理接口 -->
<dubbo:annotation package="com.sibu.mall.order" />
<!-- 关闭提供者的检索 -->
<dubbo:consumer check="false" group="${dubbo.consumer.group}" version="${dubbo.consumerVersion}"/>
<!-- 服务调用超时,超时重试-->
<dubbo:provider delay="-1" timeout="${dubbo.connectTimeOut}" retries="${dubbo.connectRetries}"/>
<!-- 消费者名称 -->
<dubbo:application name="${dubbo.applicationName}" />
</beans>
\ No newline at end of file
##################### dubbo begin #############################
dubbo.registryAddress = zookeeper://172.16.2.29:2181?backup=172.16.2.48:2181,172.16.2.31:2181
dubbo.applicationName = mall-third-api-consumer
dubbo.connectTimeOut = 20000
dubbo.connectRetries= 0
dubbo.consumer.group= sibu.mall.pro
dubbo.consumerVersion= pro-1.0.1
##################### dubbo end #############################
......@@ -4,6 +4,19 @@ jdbc.driverClassName=com.mysql.jdbc.Driver
#数据库url
jdbc.imtegralurl=jdbc:mysql://10.170.4.106/sibu_integralmall_base?useUnicode=true&characterEncoding=utf8
mall.write.url=jdbc:mysql://172.16.0.79:3306/ejavashop?characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;failOverReadOnly=false
mall.write.username=sibu_integralmall
mall.write.password=09NWaUZUNjjr0IRCYzm3
mall.read.url=jdbc:mysql://172.16.0.136:3306/ejavashop?characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;failOverReadOnly=false
mall.read.username=sibu_read
mall.read.password=vOrTcmMxqNdqkD0c5a7wlQ==
mall.analysis.write.url=jdbc:mysql://172.16.0.17:3306/ejavashop_analysis
mall.analysis.write.username=sibu_integralmall
mall.analysis.write.password=09NWaUZUNjjr0IRCYzm3
mall.analysis.read.url=jdbc:mysql://172.16.0.4:3306/ejavashop_analysis
mall.analysis.read.username=sibu_read
mall.analysis.read.password=vOrTcmMxqNdqkD0c5a7wlQ==
#数据库用户名
jdbc.imtegralusername=sibu_integralmall
......
......@@ -7,9 +7,9 @@
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${jdbc.imtegralurl}"/>
<property name="username" value="${jdbc.imtegralusername}"/>
<property name="password" value="${jdbc.imtegralpassword}"/>
<property name="url" value="${mall.read.url}?characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true" />
<property name="username" value="${mall.read.username}" />
<property name="password" value="${mall.read.password}" />
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<!-- 配置初始化大小、最小、最大 -->
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
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">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:META-INF/conf/dubbo.properties</value>
</list>
</property>
</bean>
<!-- zookeeper注册中心 -->
<dubbo:registry protocol="zookeeper" address="${dubbo.registryAddress}" />
<!-- 远程服务代理接口 -->
<dubbo:annotation package="com.sibu.mall.order" />
<!-- 关闭提供者的检索 -->
<dubbo:consumer check="false" group="${dubbo.consumer.group}" version="${dubbo.consumerVersion}"/>
<!-- 服务调用超时,超时重试-->
<dubbo:provider delay="-1" timeout="${dubbo.connectTimeOut}" retries="${dubbo.connectRetries}"/>
<!-- 消费者名称 -->
<dubbo:application name="${dubbo.applicationName}" />
</beans>
\ No newline at end of file
##################### dubbo begin #############################
dubbo.registryAddress = zookeeper://111.230.133.155:2181?backup=111.231.243.221:2181,118.89.51.164:2181
dubbo.applicationName = mall-third-consumer
dubbo.connectTimeOut = 20000
dubbo.connectRetries= 0
dubbo.consumer.group= dev.sso.qiujw
dubbo.consumerVersion= wangzhiliang2
##################### dubbo end #############################
......@@ -7,6 +7,19 @@ jdbc.url=jdbc:mysql://120.76.137.184/sibu_wesale_base?useUnicode=true&characterE
jdbc.imtegralurl=jdbc:mysql://120.76.137.184/sibu_integralmall_base?useUnicode=true&characterEncoding=utf8
sqlserverjdbc.url=jdbc\:jtds\:sqlserver\://120.25.75.53\:1433;databaseName\=sibu_wesale_base_read_03
mall.write.url=jdbc:mysql://118.89.51.164:3306/ejavashop
mall.write.username=sibu_wesale
mall.write.password=6SvbL5+JhXQSpf+ASsQ0Rg==
mall.read.url=jdbc:mysql://111.231.243.221:3306/ejavashop
mall.read.username=sibu_wesale
mall.read.password=6SvbL5+JhXQSpf+ASsQ0Rg==
mall.analysis.write.url=jdbc:mysql://118.89.51.164:3306/analysis
mall.analysis.write.username=sibu_wesale
mall.analysis.write.password=6SvbL5+JhXQSpf+ASsQ0Rg==
mall.analysis.read.url=jdbc:mysql://111.231.243.221:3306/analysis
mall.analysis.read.username=sibu_wesale
mall.analysis.read.password=6SvbL5+JhXQSpf+ASsQ0Rg==
#数据库用户名
jdbc.username=root
sqlserverjdbc.username=sa
......
......@@ -84,8 +84,8 @@ public class UTF8StringHttpMessageConverter extends AbstractHttpMessageConverter
}
private Charset getContentTypeCharset(MediaType contentType) {
if (contentType != null && contentType.getCharSet() != null) {
return contentType.getCharSet();
if (contentType != null && contentType.getCharset() != null) {
return contentType.getCharset();
}
else {
return DEFAULT_CHARSET;
......
......@@ -84,8 +84,8 @@ public class UTF8StringHttpMessageConverter extends AbstractHttpMessageConverter
}
private Charset getContentTypeCharset(MediaType contentType) {
if (contentType != null && contentType.getCharSet() != null) {
return contentType.getCharSet();
if (contentType != null && contentType.getCharset() != null) {
return contentType.getCharset();
}
else {
return DEFAULT_CHARSET;
......
#redis连接
address1=120.76.137.184:6379
address2=120.76.137.184:6380
address3=120.24.234.38:6379
address4=120.24.234.38:6380
address5=120.24.65.223:6379
address6=120.24.65.223:6380
address1=10.116.35.133:6379
address2=10.116.35.133:6380
address3=10.170.13.1:6379
address4=10.170.13.1:6380
address5=10.44.79.57:6379
address6=10.44.79.57:6380
maxRedirections=6
\ No newline at end of file
......
package com.sibu.orderHelper.integral.dao;
import com.sibu.orderHelper.integral.model.*;
import com.sibu.orderHelper.integral.pineapple.model.*;
import com.sibu.orderHelper.integral.pineapple.response.OrderResponse;
import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse;
import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse;
import com.sibu.orderHelper.integral.reponse.SkuApiResponse;
......@@ -11,147 +13,127 @@ import java.util.Map;
public interface PineappleDao {
/**
* 退货退款单下载
* 根据订单号查询订单信息 只查询不是主订单的订单
* @param params
* @return
*/
List<GetRefundBean> pageGetRefundBean(Map<String,Object> params)throws Exception;
PineappleOderDetailBean getOneIMOrderById(Map<String,Object> map)throws Exception;
//获取api中的商品详情
IMAPIProductBean getApiProductDetailById(@Param("productId") String productId) throws Exception;
//根据条件查询退款订单
int countCheckRefundStatusResponse(Map<String,Object> params)throws Exception;
Orders getOrdersByMap(Map<String,Object> params);
/**
* 根据条件判断该订单是否有成功过的退款记录
* 修改订单备注
* @param params
* @return
* @throws Exception
*/
IMDoingOrderBean getIMDoingOrderBean(Map<String,Object> params)throws Exception;
int updateOdersRemark(Map<String,Object> params);
/**
* 根据orderCode查询成功退款明细记录
* @param orderCode
* 查询该订单是否有该快递单号
* @param params
* @return
* @throws Exception
*/
List<CheckRefundStatusBean> childrenrefundStatusBySuccess(@Param("orderCode")String orderCode)throws Exception;
int checkLogisticsNumber(Map<String,Object> params);
/**
* 根据条件判断该订单是否有退款中的退款记录
* @param orderCode
* 订单发货更新订单状态与信息
* @param params
* @return
* @throws Exception
*/
List<CheckRefundStatusBean> childrenrefundStatusByCourse(@Param("orderCode")String orderCode)throws Exception;
int updateOrdersState(Map<String,Object> params);
/**
* 根据条件查询产品
* 商品下载
* @param params
* @return
* @throws Exception
*/
IMProductBean getIMProductBeanByMap(Map<String,Object> params)throws Exception;
List<DownloadProductBean> downloadProductListByMap(Map<String,Object> params);
/**
* 修改订单备注
* 根据条件查询商品
* @param params
* @return
*/
int updateSelle(Map<String,Object> params)throws Exception;
DownloadProductBean getDownloadProductBeanByMap(Map<String,Object> params);
/**
* 订单发货
* @param params
* 根据商品ID获取该商品的所有SKU
* @param productId
* @return
* @throws Exception
*/
int updateBusinessSend(Map<String,Object> params)throws Exception;
List<DownloadProductSkuBean> downloadSkuByProductId(@Param("productId") String productId);
/**
* 订单发货时判断订单号是否存在,已存在就不添加该订单号
* 根据条件更新sku库存
* @param params
* @return
* @throws Exception
*/
int getOrderByMap(Map<String,Object> params)throws Exception;
int updateSkuStock(Map<String,Object> params);
/**
* 根据条件查SKU
* 根据商品ID更新商品库存
* @param params
* @return
* @throws Exception
*/
SkuBean getSkuBeanByMap(Map<String,Object> params)throws Exception;
int updateProductStock(Map<String,Object> params);
/**
* 根据产品ID查询所有SKU
* @param productId
* 订单下载
* @param params
* @return
* @throws Exception
*/
List<SkuApiResponse> getSkuBeanListByMap(String productId)throws Exception;
List<Orders> getOrdersList(Map<String,Object> params);
/**
* 更新SKU库存
* @param skuBean
* 子订单查询
* @param orderSn
* @return
* @throws Exception
*/
int updateSku(SkuBean skuBean)throws Exception;
List<OrdersProduct> getOrdersProductList(@Param("orderSn")String orderSn);
//更新产品库存
int updateProductInventory(IMProductInventory productInventory) throws Exception;
/**
* 更新产品库存
* 根据条件查询省市级信息
* @param params
* @return
* @throws Exception
*/
int updateProduct(Map<String,Object> params)throws Exception;
Regions getRegionsByMap(Map<String,Object> params);
/**
* 根据id查询省市级信息
* @param id
* @return
*/
Regions getRegionsById(@Param("id") Integer id);
/**
* 商品下载 查询产品
* @param params
* 根据条件查询物流公司
* @return
* @throws Exception
*/
List<DownloadProductBean> getProductListByMap(Map<String,Object> params)throws Exception;
List<CourierCompany> getCourierCompanyByName(Map<String,Object> params);
/**
* 根据产品ID查询SKU
* @param productid
* 根据订单号查询退货信息
* @param orderSn
* @return
* @throws Exception
*/
List<DownloadProductSkuBean> getDownloadProductSkuBeanList(String productid)throws Exception;
List<MemberProductBack> getMemberProductBackByOrderSn(@Param("orderSn") String orderSn);
/**
* 根据产品ID查询SKU属性
* @param skuId
* 根据订单号查询换货信息
* @param orderSn
* @return
* @throws Exception
*/
List<DownloadProductSkuBean> getDownloadSkuBean(@Param("skuId") String skuId)throws Exception;
List<MemberProductExchange> getMemberProductExchangeByOrderSn(@Param("orderSn") String orderSn);
/**
* 根据订单ID查询投诉表
* @param id
* @return
*/
List<SellerComplaint> getSellerComplaintByOrderId(@Param("orderId") Integer id);
IMDoingOrderBean getOrderListByMap(Map<String,Object> params)throws Exception;
IMProductBean getIMProductBeanById(@Param("productId") String productId)throws Exception;
}
......
package com.sibu.orderHelper.mall.member.read;
import com.sibu.orderHelper.integral.model.DownloadProductBean;
import com.sibu.orderHelper.integral.model.DownloadProductSkuBean;
import com.sibu.orderHelper.integral.model.GetRefundBean;
import com.sibu.orderHelper.integral.model.IMSupplierApp;
import com.sibu.orderHelper.integral.pineapple.model.*;
import com.sibu.orderHelper.integral.reponse.MemberAddressResponse;
import com.sibu.orderHelper.integral.request.GetRefundRequest;
import com.sibu.orderHelper.integral.request.MemberAddressAddRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface MemberReadDao {
Integer count();
IMSupplierApp findByAppIdAndAppType(Map<String, String> params);
/**
* 根据订单号查询订单信息 只查询不是主订单的订单
* @param params
* @return
*/
Orders getOrdersByMap(Map<String,Object> params);
/**
* 查询该订单是否有该快递单号
* @param params
* @return
*/
int checkLogisticsNumber(Map<String,Object> params);
/**
* 商品下载
* @param params
* @return
*/
List<DownloadProductBean> downloadProductListByMap(Map<String,Object> params);
/**
* 商品下载总数量
* @param params
* @return
*/
int countDownloadProductListByMap(Map<String,Object> params);
/**
* 根据条件查询商品
* @param params
* @return
*/
DownloadProductBean getDownloadProductBeanByMap(Map<String,Object> params);
/**
* 根据商品ID获取该商品的所有SKU
* @param productId
* @return
*/
List<DownloadProductSkuBean> downloadSkuByProductId(@Param("productId") String productId);
/**
* 订单下载
* @param params
* @return
*/
List<Orders> getOrdersList(Map<String,Object> params);
/**
* 订单下载总数
* @param params
* @return
*/
int countgetOrdersList(Map<String,Object> params);
/**
* 子订单查询
* @param orderSn
* @return
*/
List<OrdersProduct> getOrdersProductList(@Param("orderSn")String orderSn);
/**
* 根据条件查询省市级信息
* @param params
* @return
*/
List<Regions> getRegionsByMap(Map<String,Object> params);
/**
* 根据id查询省市级信息
* @param id
* @return
*/
Regions getRegionsById(@Param("id") Integer id);
/**
* 根据id查询省市级信息
* @param regionIdList
* @return
*/
List<Regions> getRegionsByIds(@Param("list") List regionIdList);
/**
* 根据条件查询物流公司
* @return
*/
List<CourierCompany> getCourierCompanyByName(Map<String,Object> params);
/**
* 根据订单号查询退货信息
* @param orderSn
* @return
*/
List<MemberProductBack> getMemberProductBackByOrderSn(@Param("orderSn") String orderSn);
/**
* 根据订单号查询换货信息
* @param orderSn
* @return
*/
List<MemberProductExchange> getMemberProductExchangeByOrderSn(@Param("orderSn") String orderSn);
/**
* 根据订单ID查询投诉表
* @param id
* @return
*/
List<SellerComplaint> getSellerComplaintById(@Param("orderId") Integer id);
List<Seller> getSeller(@Param("id") String id);
/**
* 退款单下载
* @param params
* @return
*/
List<GetRefundBean> getGetRefundBean(Map<String,Object> params);
int countGetGetRefundBean(Map<String,Object> params);
/**
* 查询退款单的订单购买数量
* @param orderProductId
* @return
*/
int countOrderProductNum(@Param("id") String orderProductId);
/**
* 根据旧订单号获取新订单号
* @param orderSn
* @return
*/
String getNewOrderSnByOldOrderSn(@Param("orderSn") String orderSn);
}
package com.sibu.orderHelper.mall.member.write;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import java.util.Map;
public interface MemberWriteDao {
Integer count();
/**
* 根据订单号查询订单信息 只查询不是主订单的订单
* @param params
* @return
*/
Orders getOrdersByMap(Map<String,Object> params);
/**
* 修改订单备注
* @param params
* @return
*/
int updateOdersRemark(Map<String,Object> params);
/**
* 订单发货更新订单状态与信息
* @param params
* @return
*/
int updateOrdersState(Map<String,Object> params);
/**
* 根据条件更新sku库存
* @param params
* @return
*/
int updateSkuStock(Map<String,Object> params);
/**
* 根据商品ID更新商品库存
* @param params
* @return
*/
int updateProductStock(Map<String,Object> params);
/**
* 查询该订单是否有该快递单号
* @param params
* @return
*/
int checkLogisticsNumber(Map<String,Object> params);
}
......@@ -18,6 +18,20 @@
<groupId>com.sibu.orderHelper.service</groupId>
<artifactId>com.sibu.orderHelper.service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>spring-context</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
......@@ -30,6 +44,7 @@
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>com.sibu.orderHelper.integralMall</finalName>
......
......@@ -10,6 +10,8 @@ import com.sibu.orderHelper.common.util.SpringValuesUtil;
import com.sibu.orderHelper.integral.service.IIMDoingOrderService;
import com.sibu.orderHelper.integral.vo.PayType;
import com.sibu.orderHelper.integralMall.controller.BaseController;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import com.sibu.orderHelper.mall.member.write.MemberWriteDao;
import org.apache.commons.lang3.time.DateUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
......@@ -18,11 +20,9 @@ import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.ValidationException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
......@@ -47,6 +47,21 @@ import java.util.Map;
public class IMOrderTestController extends BaseController {
@Autowired
private IIMDoingOrderService iimDoingOrderService;
@Resource
private MemberReadDao memberReadDao;
@Resource
private MemberWriteDao memberWriteDao;
/**
*
*
* @return
*/
@RequestMapping(value = "/test/mall/read-write/datasource", method = RequestMethod.GET)
public BaseResponse testReadAndWriteDb() {
String r = String.format("%s-%s", memberReadDao.count(), memberWriteDao.count());
return ResponseRender.renderData(r);
}
/**
* 验证测试环境
......
......@@ -14,6 +14,7 @@ import com.sibu.orderHelper.integral.model.IMSupplier;
import com.sibu.orderHelper.integral.model.IMSupplierApp;
import com.sibu.orderHelper.integral.pineapple.enums.SubErrorEnum;
import com.sibu.orderHelper.integral.pineapple.exception.BizException;
import com.sibu.orderHelper.integral.pineapple.model.Seller;
import com.sibu.orderHelper.integral.pineapple.request.BaseRequest;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
......@@ -27,6 +28,7 @@ import com.sibu.orderHelper.integral.service.pineapple.BizService;
import com.sibu.orderHelper.integral.service.pineapple.util.JsonUtils;
import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst;
import com.sibu.orderHelper.integral.service.pineapple.util.XmlUtils;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import net.sf.json.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -67,6 +69,8 @@ public class PineappleController {
private IMSupplierAppService imSupplierAppService;
@Autowired
private IMSupplierDao imSupplierDao;
@Resource
private MemberReadDao memberReadDao;
@RequestMapping(
value = "/pineapple/call",
......@@ -169,14 +173,19 @@ public class PineappleController {
}
private IMSupplier findAndCheckIMSupplier(BaseRequest request, IMSupplierApp imSupplierApp) {
List<IMSupplier> imSuppliers = imSupplierDao.findByIdIn(Arrays.asList(imSupplierApp.getSupplierId()));
if (CollectionUtils.isEmpty(imSuppliers)) {
//List<IMSupplier> imSuppliers = imSupplierDao.findByIdIn(Arrays.asList(imSupplierApp.getSupplierId()));
List<Seller> seller = memberReadDao.getSeller(imSupplierApp.getSupplierId());
if (CollectionUtils.isEmpty(seller)) {
throw new BizException(MessageFormat.format("appKey【{0}】的店铺数据为空,请联系客服", request.getAppkey()));
}
if (imSuppliers.size() > 1) {
if (seller.size() > 1) {
throw new BizException(MessageFormat.format("appKey【{0}】的店铺数据有重复,请联系客服", request.getAppkey()));
}
return imSuppliers.get(0);
Seller entity = seller.get(0);
IMSupplier iMSupplier = new IMSupplier();
iMSupplier.setId(String.valueOf(entity.getId()));
iMSupplier.setName(entity.getName());
return iMSupplier;
}
private IMSupplierApp findAndCheckSupplierApp(BaseRequest request) {
......
......@@ -29,6 +29,9 @@
<!--加载mq配置-->
<import resource="classpath:META-INF/conf/service-spring-mq.xml"></import>
<!--dubbo配置-->
<import resource="classpath:META-INF/conf/dubbo-consumer-config.xml"></import>
<!-- 开启注解配置
<context:annotation-config />-->
<!-- 开启AOP监听 只对当前配置文件有效 -->
......
......@@ -35,7 +35,7 @@
<!--DEBUG信息输出-->
<appender name="LOG.DEBUG" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/var/tomcat_8081/pineapple/integral_logs/debug_" />
<param name="File" value="/var/tomcat/mall/third-api/debug_" />
<param name="DatePattern" value="yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p] [%C-%M] %m%n" />
......@@ -48,7 +48,7 @@
<!--INFO信息输出-->
<appender name="LOG.INFO" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/var/tomcat_8081/pineapple/integral_logs/info_" />
<param name="File" value="/var/tomcat/mall/third-api/info_" />
<param name="DatePattern" value="yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p] [%C-%M] %m%n" />
......@@ -61,7 +61,7 @@
<!--WARN信息输出-->
<appender name="LOG.WARN" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/var/tomcat_8081/pineapple/integral_logs/warn_" />
<param name="File" value="/var/tomcat/mall/third-api/warn_" />
<param name="DatePattern" value="yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p] [%C-%M] %m%n" />
......@@ -74,7 +74,7 @@
<!--ERROR信息输出-->
<appender name="LOG.ERROR" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/var/tomcat_8081/pineapple/integral_logs/error_" />
<param name="File" value="/var/tomcat/mall/third-api/error_" />
<param name="DatePattern" value="yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p] [%C-%M] %m%n" />
......@@ -87,7 +87,7 @@
<!--FATAL信息-->
<appender name="LOG.FATAL" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/var/tomcat_8081/pineapple/integral_logs/fatal_" />
<param name="File" value="/var/tomcat/mall/third-api/fatal_" />
<param name="DatePattern" value="yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%p] [%C-%M] %m%n" />
......
<?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.sibu.orderHelper.mall.member.write.MemberWriteDao">
<!-- 订单实体 -->
<resultMap id="orders" type="com.sibu.orderHelper.integral.pineapple.model.Orders">
<result property="id" column="id" />
<result property="sellerId" column="seller_id" />
<result property="sellerName" column="seller_name" />
<result property="orderId" column="order_id" />
<result property="orderSn" column="order_sn" />
<result property="orderProductId" column="order_product_id" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="memberId" column="member_id" />
<result property="memberName" column="member_name" />
<result property="provinceId" column="province_id" />
<result property="cityId" column="city_id" />
<result property="areaId" column="area_id" />
<result property="addressAll" column="address_all" />
<result property="addressInfo" column="address_info" />
<result property="zipCode" column="zip_code" />
<result property="changeName" column="change_name" />
<result property="phone" column="phone" />
<result property="logisticsId" column="logistics_id" />
<result property="logisticsName" column="logistics_name" />
<result property="logisticsMark" column="logistics_mark" />
<result property="logisticsNumber" column="logistics_number" />
<result property="number" column="number" />
<result property="question" column="question" />
<result property="image" column="image" />
<result property="name" column="name" />
<result property="state" column="state" />
<result property="optId" column="opt_id" />
<result property="optName" column="opt_name" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="regionName1" column="regionName1" />
<result property="regionName2" column="regionName2" />
<result property="regionName3" column="regionName3" />
<result property="orderState" column="order_state" />
<result property="moneyOrder" column="money_order" />
<result property="moneyPaidBalance" column="money_paid_balance" />
<result property="moneyCoupon" column="money_coupon" />
<result property="moneyLogistics" column="money_logistics" />
<result property="moneyProduct" column="money_product" />
<result property="moneyActFull" column="money_act_full" />
<result property="moneyDiscount" column="money_discount" />
<result property="moneyBack" column="money_back" />
<result property="moneyIntegral" column="money_integral" />
<result property="payTime" column="pay_time" />
</resultMap>
<select id="count" resultType="java.lang.Integer">
select count(*) from member
</select>
<!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
<select id="getOrdersByMap" parameterType="java.util.Map" resultMap="orders">
select * from orders where order_sn=#{orderSn,jdbcType=VARCHAR} AND seller_id=#{sellerId,jdbcType=INTEGER} AND is_parent = 0
</select>
<!-- 修改订单备注 -->
<update id="updateOdersRemark" parameterType="java.util.Map">
UPDATE orders SET remark = #{remark},update_time = now() WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
</update>
<!-- 订单发货-->
<!-- 验证订单号是否已存在-->
<select id="checkLogisticsNumber" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(*) from orders where order_sn = #{orderSn} AND seller_id = #{sellerId} and logistics_number like concat(concat('%',#{logisticsNumber},'%'))
</select>
<!--更改订单状态、电话、地址、发货时间、收货人姓名,快递单号 -->
<update id="updateOrdersState">
UPDATE orders
<set>
<if test="name !=null and name !=''">
name = #{name},
</if>
<if test="addressInfo !=null and addressInfo !=''">
address_info = #{addressInfo},
</if>
<if test="logisticsNumber !=null and logisticsNumber !=''">
logistics_number = #{logisticsNumber},
</if>
<if test="mobile !=null and mobile !=''">
mobile = #{mobile},
</if>
<if test="addressAll !=null and addressAll !=''">
address_all = #{addressAll},
</if>
<if test="orderState !=null and orderState !=''">
order_state = #{orderState},
</if>
<if test="provinceId !=null and provinceId !=''">
province_id = #{provinceId},
</if>
<if test="areaId !=null and areaId !=''">
area_id = #{areaId},
</if>
<if test="cityId !=null and cityId !=''">
city_id = #{cityId},
</if>
<if test="deliverTime !=null and deliverTime !=''">
deliver_time = now(),
</if>
<if test="logisticsName !=null and logisticsName !=''">
logistics_name = #{logisticsName},
</if>
<if test="logisticsId !=null and logisticsId !=''">
logistics_id = #{logisticsId},
</if>
update_time = now()
</set>
WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
</update>
<!-- 更新SKU库存-->
<update id="updateSkuStock" parameterType="java.util.Map">
UPDATE product_goods SET product_stock = #{stock} WHERE sku = #{skuId} and product_id = #{productId}
</update>
<!-- 更新产品库存-->
<update id="updateProductStock" parameterType="java.util.Map">
UPDATE product SET product_stock = #{productStock} WHERE id = #{productId}
</update>
</mapper>
\ No newline at end of file
......@@ -37,6 +37,110 @@
<!-- 事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" mode="proxy"/>
<!-- begin 新系统mall -->
<bean id="mallReadDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${mall.read.url}?characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true" />
<property name="username" value="${mall.read.username}" />
<property name="password" value="${mall.read.password}" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1"/>
<property name="minIdle" value="1"/>
<property name="maxActive" value="200"/>
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000"/>
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000"/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000"/>
<property name="validationQuery" value="SELECT 'x'"/>
<property name="testWhileIdle" value="true"/>
<property name="testOnBorrow" value="false"/>
<property name="testOnReturn" value="false"/>
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true"/>
<property name="maxPoolPreparedStatementPerConnectionSize" value="20"/>
<!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat"/>
</bean>
<bean id="mallReadSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="mapperLocations" value="classpath:mall-mapper/**/read/**/*.xml" />
<!--<property name="typeAliasesPackage" value="com.ejavashop.entity" />-->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<property name="dataSource" ref="mallReadDataSource"/>
</bean>
<bean name="mallReadMapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.sibu.orderHelper.mall.*.read" />
<property name="sqlSessionFactoryBeanName" value="mallReadSqlSessionFactory" />
</bean>
<bean id="mallWriteDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${mall.write.url}?characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true" />
<property name="username" value="${mall.write.username}" />
<property name="password" value="${mall.write.password}" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1"/>
<property name="minIdle" value="1"/>
<property name="maxActive" value="200"/>
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000"/>
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000"/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000"/>
<property name="validationQuery" value="SELECT 'x'"/>
<property name="testWhileIdle" value="true"/>
<property name="testOnBorrow" value="false"/>
<property name="testOnReturn" value="false"/>
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true"/>
<property name="maxPoolPreparedStatementPerConnectionSize" value="20"/>
<!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat"/>
</bean>
<bean id="mallWriteSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="mapperLocations" value="classpath:mall-mapper/**/write/**/*.xml" />
<!--<property name="typeAliasesPackage" value="com.ejavashop.entity" />-->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<property name="dataSource" ref="mallWriteDataSource" />
</bean>
<bean name="shopMapperScannerWrite" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.sibu.orderHelper.mall.*.write" />
<property name="sqlSessionFactoryBeanName" value="mallWriteSqlSessionFactory" />
</bean>
<bean id="transactionManagerForMall" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="mallWriteDataSource"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManagerForMall"/>
<!-- end 新系统mall -->
<!-- 配置事务的传播特性 -->
<!--<tx:advice id="txAdvice" transaction-manager="transactionManager">-->
<!--<tx:attributes>-->
......
......@@ -16,12 +16,12 @@ public enum PineappleEnum {
/**
* 菠萝派对应商城【产品已上架】状态
*/
public static final Integer MALL_PRODUCT_PUTAWAY__STATUS = 1;
public static final Integer MALL_PRODUCT_PUTAWAY__STATUS = 6;
/**
* 菠萝派对应商城【产品已下架】状态
*/
public static final Integer MALL_PRODUCT_SOLDIOUT__STATUS = 0;
public static final Integer MALL_PRODUCT_SOLDIOUT__STATUS = 7;
......
......@@ -2,7 +2,9 @@ package com.sibu.orderHelper.enums;
import com.alibaba.druid.util.StringUtils;
import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum;
import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum;
import com.sibu.orderHelper.integral.pineapple.model.MemberProductBack;
import org.apache.commons.lang3.EnumUtils;
import java.util.ArrayList;
......@@ -15,14 +17,16 @@ import java.util.List;
* @description 菠萝派商城退款验证退款状态举类
*/
public enum PineappleRefundEnum {
JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_AUDIT.getCode())),
JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_REFUND_GOODS.getCode(),OrderRefundStatusEnum.AGREE_CHANGE_GOODS.getCode())),
JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_RECEIVE_GOODS.getCode(),OrderRefundStatusEnum.WAIT_SELLER_AUDIT_RECEIVE_GOODS.getCode())),
JH_04("JH_04", "卖家拒绝退款",Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_AUDIT.getCode(),OrderRefundStatusEnum.DISAGREE_REFUNDING_MONEY.getCode(),OrderRefundStatusEnum.DISAGREE_CHANGE_GOODS.getCode(),OrderRefundStatusEnum.DENY_CHANGE_GOODS.getCode())),
JH_05("JH_05", "退款关闭",new ArrayList<>()),
JH_06("JH_06", "退款成功",Arrays.asList(OrderRefundStatusEnum.SELLER_REFUNDING_MONEY_SUCCESS.getCode())),
JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(MemberProductBackEnum.Pending.getCode())),
JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(MemberProductBackEnum.AuditSucceess.getCode())),
JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(MemberProductBackEnum.MemberDeliver.getCode())),
JH_04("JH_04", "卖家拒绝退款",Arrays.asList()),
JH_05("JH_05", "退款关闭",new ArrayList<>(MemberProductBackEnum.Inattentive.getCode())),
JH_06("JH_06", "退款成功",new ArrayList<>(MemberProductBackEnum.ShopDelivery.getCode())),
JH_07("JH_07", "没有退款",new ArrayList<>()),
JH_99("JH_99", "其他",new ArrayList<>());
JH_99("JH_99", "其他",Arrays.asList());
private String code; // 错误代码
private String msg; // 错误消息
......
package com.sibu.orderHelper.enums;
import com.alibaba.druid.util.StringUtils;
import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum;
import org.apache.commons.lang3.EnumUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author lauka
* @date 2018/03/30
* @description 菠萝派商城退款验证退款状态举类
*/
public enum PineappleRefundMoneyStateEnum {
NOT_REFUND("1", "未退款",PineappleRefundEnum.JH_99),
REFUND_ACCOUNT("2", "退款到账户", PineappleRefundEnum.JH_06),
REFUND_BANK("3", "退款到银行",PineappleRefundEnum.JH_06),
REFUND_ING("4", "退款中",PineappleRefundEnum.JH_99),
REFUND_ERROR ("5", "退款失败",PineappleRefundEnum.JH_99),
REFUND_UNKNOWN("-1", "未知",PineappleRefundEnum.JH_99),;
private String code; // 错误代码
private String msg; // 错误消息
private PineappleRefundEnum pineappleRefundEnum;
PineappleRefundMoneyStateEnum(String code, String msg, PineappleRefundEnum pineappleRefundEnum) {
this.code = code;
this.msg = msg;
this.pineappleRefundEnum = pineappleRefundEnum;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public PineappleRefundEnum getPineappleRefundEnum() {
return pineappleRefundEnum;
}
public void setPineappleRefundEnum(PineappleRefundEnum pineappleRefundEnum) {
this.pineappleRefundEnum = pineappleRefundEnum;
}
public static PineappleRefundMoneyStateEnum resolveByPlatformRefundStatus(Integer platformOrderStatus) {
List<PineappleRefundMoneyStateEnum> enums = EnumUtils.getEnumList(PineappleRefundMoneyStateEnum.class);
PineappleRefundMoneyStateEnum result = enums.stream()
.filter(p -> p.code.equals(platformOrderStatus))
.findFirst()
.orElse(PineappleRefundMoneyStateEnum.REFUND_UNKNOWN);
return result;
}
}
......@@ -20,6 +20,8 @@ public class GetRefundBean implements Serializable{
//平台子订单号
private String subplatorderno;
private String ordersproductuid;
//订单总金额
private BigDecimal totalamount;
......@@ -86,6 +88,9 @@ public class GetRefundBean implements Serializable{
//商品外部商家编码
private String outerid;
//退款状态
private Integer stateMoney;
public String getRefundno() {
return refundno;
}
......@@ -285,4 +290,20 @@ public class GetRefundBean implements Serializable{
public void setOuterid(String outerid) {
this.outerid = outerid;
}
public Integer getStateMoney() {
return stateMoney;
}
public void setStateMoney(Integer stateMoney) {
this.stateMoney = stateMoney;
}
public String getOrdersproductuid() {
return ordersproductuid;
}
public void setOrdersproductuid(String ordersproductuid) {
this.ordersproductuid = ordersproductuid;
}
}
......
package com.sibu.orderHelper.integral.pineapple.constant;
import com.sibu.orderHelper.enums.PayOrderStatus;
import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum;
import java.util.Arrays;
import java.util.List;
......@@ -19,45 +20,44 @@ public class PineAppleConst {
/**
* 菠萝派对应商城【等待买家付款】状态
*/
public static final List<Integer> MALL_WAIT_BUYER_PAY_ORDER_STATUS = Arrays.asList(PayOrderStatus.WaitPay.getCode());
public static final List<Integer> MALL_WAIT_BUYER_PAY_ORDER_STATUS = Arrays.asList(EJavaShopOrderStateEnum.WaitPay.getCode());
/**
* 菠萝派对应商城【等待卖家发货】状态
*/
public static final List<Integer> MALL_WAIT_SELLER_DELIVER_ORDER_STATUS = Arrays.asList(PayOrderStatus.WaitShip.getCode());
public static final List<Integer> MALL_WAIT_SELLER_DELIVER_ORDER_STATUS = Arrays.asList(EJavaShopOrderStateEnum.WaitConfirmed.getCode(),EJavaShopOrderStateEnum.WaitShip.getCode());
/**
* 菠萝派对应商城【等待买家确认收货】状态
*/
public static final List<Integer> MALL_WAIT_BUYER_RECEIVED_ORDER_STATUS = Arrays.asList(PayOrderStatus.HasReceived.getCode());
public static final List<Integer> MALL_WAIT_BUYER_RECEIVED_ORDER_STATUS = Arrays.asList(EJavaShopOrderStateEnum.HasReceived.getCode());
/**
* 菠萝派对应商城【交易完成】状态
*/
public static final List<Integer> MALL_TRANSACTION_FINISHED_ORDER_STATUS = Arrays.asList(PayOrderStatus.HasDelive.getCode(), PayOrderStatus.Finished.getCode());
public static final List<Integer> MALL_TRANSACTION_FINISHED_ORDER_STATUS = Arrays.asList(EJavaShopOrderStateEnum.Finished.getCode());
/**
* 菠萝派对应商城【交易关闭】状态
*/
public static final List<Integer> MALL_TRANSACTION_CLOSED_ORDER_STATUS = Arrays.asList(PayOrderStatus.RefundFail.getCode());
public static final List<Integer> MALL_TRANSACTION_CLOSED_ORDER_STATUS = Arrays.asList(EJavaShopOrderStateEnum.RefundFail.getCode());
/**
* 菠萝派对应商城【所有订单】
*/
public static final List<Integer> MALL_ALL_ORDER = Arrays.asList(
PayOrderStatus.WaitPay.getCode(),
PayOrderStatus.WaitShip.getCode(),
PayOrderStatus.HasReceived.getCode(),
PayOrderStatus.HasDelive.getCode(),
PayOrderStatus.Finished.getCode(),
PayOrderStatus.RefundFail.getCode()
EJavaShopOrderStateEnum.WaitPay.getCode(),
EJavaShopOrderStateEnum.WaitConfirmed.getCode(),
EJavaShopOrderStateEnum.WaitShip.getCode(),
EJavaShopOrderStateEnum.HasReceived.getCode(),
EJavaShopOrderStateEnum.Finished.getCode(),
EJavaShopOrderStateEnum.RefundFail.getCode()
);
/**
* 菠萝派对应商城【未知】状态订单
*/
public static final List<Integer> MALL_UNKNOWN_ORDER_STATUS = Arrays.asList(
PayOrderStatus.WaitPay.getCode(),
PayOrderStatus.WaitShip.getCode(),
PayOrderStatus.HasReceived.getCode(),
PayOrderStatus.HasDelive.getCode(),
PayOrderStatus.Finished.getCode(),
PayOrderStatus.RefundFail.getCode()
EJavaShopOrderStateEnum.WaitPay.getCode(),
EJavaShopOrderStateEnum.WaitConfirmed.getCode(),
EJavaShopOrderStateEnum.WaitShip.getCode(),
EJavaShopOrderStateEnum.HasReceived.getCode(),
EJavaShopOrderStateEnum.Finished.getCode(),
EJavaShopOrderStateEnum.RefundFail.getCode()
);
}
......
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import com.sibu.orderHelper.enums.PayOrderStatus;
import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst;
import org.apache.commons.lang3.EnumUtils;
import java.util.List;
/**
* @author LauKa
* @contact a062431@vip.qq.com
* @date 2018/05/15
* @description 新系统丁订单状态
*/
public enum EJavaShopOrderStateEnum {
WaitPay(1, "待支付"), WaitConfirmed(2, "待确认"), WaitShip(3, "待发货"),
HasReceived(4, "已发货"), RefundFail(6, "交易关闭"),Finished(5, "交易完成");
private int code; // 错误代码
private String msg; // 错误消息
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
EJavaShopOrderStateEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static EJavaShopOrderStateEnum valueOf(int code) { // 手写的从int到enum的转换函数
List<EJavaShopOrderStateEnum> enums = EnumUtils.getEnumList(EJavaShopOrderStateEnum.class);
EJavaShopOrderStateEnum result = enums.stream()
.filter(p -> p.getCode() == code)
.findFirst()
.orElse(EJavaShopOrderStateEnum.RefundFail);
return result;
}
public static EJavaShopOrderStateEnum resolve(String code) {
List<EJavaShopOrderStateEnum> enums = EnumUtils.getEnumList(EJavaShopOrderStateEnum.class);
EJavaShopOrderStateEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
.findFirst()
.orElse(EJavaShopOrderStateEnum.RefundFail);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import java.util.List;
/**
* @author LauKa
* @contact a062431@vip.qq.com
* @date 2018/05/15
* @description 新系统退款表状态 1、未处理;2、审核通过;3、用户发货,4、店铺收货;5、不予处理'
*/
public enum MemberProductBackEnum {
Pending(1, "未处理"), AuditSucceess(2, "审核通过"), MemberDeliver(3, "用户发货"),
ShopDelivery(4, "店铺收货"), Inattentive(5, "不予处理");
private int code; // 错误代码
private String msg; // 错误消息
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
MemberProductBackEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static MemberProductBackEnum valueOf(int code) { // 手写的从int到enum的转换函数
List<MemberProductBackEnum> enums = EnumUtils.getEnumList(MemberProductBackEnum.class);
MemberProductBackEnum result = enums.stream()
.filter(p -> p.getCode() == code)
.findFirst()
.orElse(null);
return result;
}
public static MemberProductBackEnum resolve(String code) {
List<MemberProductBackEnum> enums = EnumUtils.getEnumList(MemberProductBackEnum.class);
MemberProductBackEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
.findFirst()
.orElse(null);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import java.util.List;
/**
* @author LauKa
* @contact a062431@vip.qq.com
* @date 2018/05/15
* @description 新系统换货表状态 换货状态:1、未处理;2、审核通过;3、用户发回退件;4、商家收到退件;5、商家发出换件;6、原件退还;7、不处理
*/
public enum MemberProductExchangeEnum {
Pending(1, "未处理"), AuditSucceess(2, "审核通过"), MemberDeliver(3, "用户发回退件"),
ShopDelivery(4, "商家收到退件"),ShopExchange(5,"商家发出换件"),ReturnOld(6,"原件退还"), Inattentive(7, "不予处理");
private int code; // 错误代码
private String msg; // 错误消息
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
MemberProductExchangeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static MemberProductExchangeEnum valueOf(int code) { // 手写的从int到enum的转换函数
List<MemberProductExchangeEnum> enums = EnumUtils.getEnumList(MemberProductExchangeEnum.class);
MemberProductExchangeEnum result = enums.stream()
.filter(p -> p.getCode() == code)
.findFirst()
.orElse(null);
return result;
}
public static MemberProductExchangeEnum resolve(String code) {
List<MemberProductExchangeEnum> enums = EnumUtils.getEnumList(MemberProductExchangeEnum.class);
MemberProductExchangeEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
.findFirst()
.orElse(null);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author lauka
* @date 2018/03/30
* @description 菠萝派商城退款验证换货状态举类
*/
public enum PineappleExchangeEnum {
JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(MemberProductExchangeEnum.Pending.getCode())),
JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(MemberProductExchangeEnum.AuditSucceess.getCode())),
JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(MemberProductExchangeEnum.MemberDeliver.getCode())),
JH_04("JH_04", "卖家拒绝退款",Arrays.asList()),
JH_05("JH_05", "退款关闭",new ArrayList<>(MemberProductExchangeEnum.Inattentive.getCode())),
JH_06("JH_06", "退款成功",Arrays.asList()),
JH_07("JH_07", "没有退款",Arrays.asList(MemberProductExchangeEnum.ReturnOld.getCode(),MemberProductExchangeEnum.ShopExchange.getCode())),
JH_99("JH_99", "其他",new ArrayList<>(MemberProductExchangeEnum.ShopDelivery.getCode()));
private String code; // 错误代码
private String msg; // 错误消息
List<Integer> mallOrderStatus;
PineappleExchangeEnum(String code, String msg, List<Integer> mallOrderStatus) {
this.code = code;
this.msg = msg;
this.mallOrderStatus = mallOrderStatus;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static PineappleExchangeEnum resolve(String code) {
List<PineappleExchangeEnum> enums = EnumUtils.getEnumList(PineappleExchangeEnum.class);
PineappleExchangeEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(p.code, code))
.findFirst()
.orElse(PineappleExchangeEnum.JH_99);
return result;
}
public static PineappleExchangeEnum resolveByPlatformRefundStatus(Integer platformOrderStatus) {
List<PineappleExchangeEnum> enums = EnumUtils.getEnumList(PineappleExchangeEnum.class);
PineappleExchangeEnum result = enums.stream()
.filter(p -> p.mallOrderStatus != null && p.mallOrderStatus.contains(platformOrderStatus))
.findFirst()
.orElse(PineappleExchangeEnum.JH_99);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class CourierCompany implements Serializable{
private Integer id;
private java.util.Date createTime;
private Integer state;
private String companyMark;
private String companyName;
private Integer seq;
private String companyType;
private Integer sellerId;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class MemberProductBack implements Serializable{
private java.lang.Integer id;
private java.lang.Integer sellerId;
private java.lang.String sellerName;
private java.lang.Integer orderId;
private java.lang.String orderSn;
private java.lang.Integer orderProductId;
private java.lang.Integer productId;
private java.lang.String productName;
private java.lang.Integer memberId;
private java.lang.String memberName;
private java.lang.Integer provinceId;
private java.lang.Integer cityId;
private java.lang.Integer areaId;
private java.lang.String addressAll;
private java.lang.String addressInfo;
private java.lang.String zipCode;
private java.lang.String contactPhone;
private java.lang.String contactName;
private java.lang.Integer logisticsId;
private java.lang.String logisticsName;
private java.lang.String logisticsMark;
private java.lang.String logisticsNumber;
private java.lang.String question;
private java.lang.String image;
private java.lang.Integer stateReturn;
private java.lang.Integer stateMoney;
private java.lang.Integer number;
private java.math.BigDecimal backMoney;
private java.lang.Integer backIntegral;
private java.math.BigDecimal backIntegralMoney;
private java.lang.Integer backCouponUserId;
private java.util.Date backMoneyTime;
private java.lang.Integer optId;
private java.lang.String optName;
private java.lang.String remark;
private java.util.Date createTime;
private java.util.Date updateTime;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class MemberProductExchange implements Serializable {
private java.lang.Integer id;
private java.lang.Integer sellerId;
private java.lang.String sellerName;
private java.lang.Integer orderId;
private java.lang.String orderSn;
private java.lang.Integer orderProductId;
private java.lang.Integer productId;
private java.lang.String productName;
private java.lang.Integer memberId;
private java.lang.String memberName;
private java.lang.Integer provinceId;
private java.lang.Integer cityId;
private java.lang.Integer areaId;
private java.lang.String addressAll;
private java.lang.String addressInfo;
private java.lang.String zipCode;
private java.lang.String changeName;
private java.lang.String phone;
private java.lang.Integer logisticsId;
private java.lang.String logisticsName;
private java.lang.String logisticsMark;
private java.lang.String logisticsNumber;
private java.lang.Integer provinceId2;
private java.lang.Integer cityId2;
private java.lang.Integer areaId2;
private java.lang.String addressAll2;
private java.lang.String addressInfo2;
private java.lang.String zipCode2;
private java.lang.String changeName2;
private java.lang.String phone2;
private java.lang.Integer logisticsId2;
private java.lang.String logisticsName2;
private java.lang.String logisticsMark2;
private java.lang.String logisticsNumber2;
private java.lang.Integer number;
private java.lang.String question;
private java.lang.String image;
private java.lang.String name;
private java.lang.Integer state;
private java.lang.Integer optId;
private java.lang.String optName;
private java.lang.String remark;
private java.util.Date createTime;
private java.util.Date updateTime;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@ToString
public class Orders implements Serializable{
private Integer id;
private String orderSn;
private String orderPsn;
private Integer isParent;
private Integer isShow;
private String relationOrderSn;
private Integer orderType;
private Integer sellerId;
private String sellerName;
private Integer memberId;
private String memberName;
private Integer orderState;
private Date payTime;
private Integer paymentStatus;
private Integer invoiceStatus;
private String invoiceTitle;
private String invoiceType;
private BigDecimal moneyProduct;
private BigDecimal moneyLogistics;
private BigDecimal moneyOrder;
private BigDecimal moneyPaidBalance;
private BigDecimal moneyPaidReality;
private BigDecimal moneyCoupon;
private BigDecimal moneyActFull;
private BigDecimal moneyDiscount;
private BigDecimal moneyBack;
private BigDecimal moneyIntegral;
private Integer integral;
private Integer couponUserId;
private Integer actFullId;
private Integer activityId;
private String ip;
private String paymentName;
private String paymentCode;
private String name;
private Integer provinceId;
private Integer cityId;
private Integer areaId;
private String addressAll;
private String addressInfo;
private String mobile;
private String email;
private String zipCode;
private String remark;
private String deliverTime;
private String finishTime;
private String tradeSn;
private Integer source;
private Integer logisticsId;
private String logisticsName;
private String logisticsNumber;
private Integer isCodconfim;
private Integer codconfirmId;
private String codconfirmName;
private String codconfirmTime;
private String codconfirmRemark;
private Integer codconfirmState;
private Date createTime;
private String updateTime;
private Integer evaluateState;
private String regionName1;
private String regionName2;
private String regionName3;
private BigDecimal deductionVbMoney;
private BigDecimal couponMoney;
private List<OrdersProduct> goodinfos;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class OrdersProduct {
private Integer id;
private Integer ordersId;
private String ordersSn;
private String ordersPsn;
private Integer sellerId;
private String sellerName;
private Integer productCateId;
private Integer productId;
private Integer productGoodsId;
private String specInfo;
private String productName;
private String productSku;
private Integer packageGroupsId;
private Integer mallGroupsId;
private Integer giftId;
private Integer isGift;
private BigDecimal moneyPrice;
private Integer number;
private BigDecimal moneyAmount;
private BigDecimal moneyActSingle;
private Integer actSingleId;
private Integer actGroupId;
private Integer actFlashSaleId;
private Integer actFlashSaleProductId;
private Integer actBiddingId;
private Integer actIntegralId;
private Integer actIntegralNum;
private BigDecimal actIntegralMoney;
private String systemRemark;
private Integer backNumber;
private Integer exchangeNumber;
private Date createTime;
private Date updateTime;
private Integer isEvaluate;
private BigDecimal moneyFullAoumt;
private BigDecimal moneyCouponAmount;
private BigDecimal deductionProductVbMoney;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class Product {
private Integer id;
private Integer productCateId;
private String productCatePath;
private String name1;
private String name2;
private String keyword;
private Integer productBrandId;
private Integer isSelf;
private BigDecimal costPrice;
private BigDecimal protectedPrice;
private BigDecimal marketPrice;
private BigDecimal mallPcPrice;
private BigDecimal malMobilePrice;
private Integer virtualSales;
private Integer actualSales;
private Integer productStock;
private Integer isNorm;
private String normIds;
private String normName;
private Integer state;
private Integer isTop;
private Date upTime;
private String description;
private String packing;
private Integer sellerId;
private Integer createId;
private Date createTime;
private Date updateTime;
private Integer sellerCateId;
private Integer sellerIsTop;
private Integer sellerState;
private Integer commentsNumber;
private Integer productCateState;
private Integer isInventedProduct;
private Integer transportType;
private Integer transportId;
private String masterImg;
private String productCode;
private BigDecimal saleScale1;
private BigDecimal saleScale2;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ProductGoods {
private Long id;
private Long productId;
private String normAttrId;
private String normName;
private Double mallPcPrice;
private Double mallMobilePrice;
private Long productStock;
private Long productStockWarning;
private Long actualSales;
private String sku;
private String images;
private Long state;
private Double weight;
private Long length;
private Long width;
private Long height;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class Regions implements Serializable{
private Integer id;
private Integer parentId;
private String regionName;
private String parentPath;
private String firstLetter;
private Integer regionType;
private Integer agencyId;
private Integer shippingId;
private Integer visible;
private String rowId;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class Seller implements Serializable{
private Integer id; //id
private Integer memberId; //用户ID
private String name; //用户名
private String sellerName; //店铺名称
private String sellerLogo; //店铺logo
private Integer sellerGrade; //店铺等级
private String scoreService; //店铺评分服务
private String scoreDeliverGoods; //店铺评分发货
private String scoreDescription; //店铺评分描述
private Integer productNumber; //商品数量
private Integer collectionNumber; //店铺收藏
private Date createTime; //创建时间
private BigDecimal saleMoney; //店铺总销售金额
private Integer orderCount; //店铺总订单量
private Integer orderCountOver; //店铺完成订单量
private String sellerKeyword; //SEO关键字
private String sellerDes; //SEO店铺描述
private Integer auditStatus; //审核状态 1、待审核;2、审核通过;3、冻结
private String storeSlide;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class SellerComplaint implements Serializable {
private java.lang.Integer id; //id
private java.lang.Integer userId; //投诉人ID
private java.lang.String userName; //投诉人账户
private java.lang.Integer orderId; //订单ID
private java.lang.Integer orderProductId; //网单ID
private java.lang.Integer productBackId; //退货管理id,如没有置为0
private java.lang.Integer productExchangeId; //换货管理id,如没有置为0
private java.lang.String content; //投诉内容
private java.lang.String image; //投诉图片
private java.util.Date complaintTime; //投诉时间
private java.lang.Integer sellerId; //投诉商家
private java.util.Date sellerComplaintTime; //商家申诉时间
private java.lang.String sellerCompContent; //商家申诉内容
private java.lang.String sellerCompImage; //商家申诉图片
private java.lang.Integer state; //状态:1、买家投诉待审核;2、买家投诉不通过;3、买家投诉通过;4、卖家申诉待审核;5、卖家申诉不通过;6、卖家申诉通过;
private java.lang.Integer optId; //平台处理人ID
private java.lang.String optContent; //平台处理结果
private java.lang.String userContent; //客户反馈意见
private java.util.Date createTime; //创建时间
private java.util.Date optTime; //处理时间
}
......@@ -12,6 +12,7 @@ public class PineappleSyncStockRequest {
@JsonProperty("PlatProductID")
private String platProductID;
@NotBlank(message = "skuid参数不能为空")
@JsonProperty("SkuID")
private String skuID;
......
......@@ -36,11 +36,17 @@
<artifactId>com.sibu.orderHelper.activeMQ</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.csource/fastdfs-client-java -->
<!-- fastDfs jar 导入 -->
<dependency>
<groupId>org.csource</groupId>
<artifactId>fastdfs-client-java</artifactId>
<version>1.25</version>
<version>5.0.4</version>
</dependency>
<dependency>
<groupId>com.sibu.sibu-mall-order</groupId>
<artifactId>sibu-mall-order-service-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
......
......@@ -6,9 +6,11 @@ import com.sibu.orderHelper.integral.dao.IMSupplierAppDao;
import com.sibu.orderHelper.integral.model.IMSupplierApp;
import com.sibu.orderHelper.integral.pineapple.request.BaseRequest;
import com.sibu.orderHelper.integral.service.IMSupplierAppService;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
......@@ -23,6 +25,9 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
@Autowired
private IMSupplierAppDao imSupplierAppDao;
@Resource
private MemberReadDao memberReadDao;
@Override
public IMSupplierApp findByAppIdAndAppType(String appId, SupplierAppTypeEnum appType) {
Map<String, String> params = new HashMap<>();
......@@ -37,6 +42,6 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
params.put("appId", requestParams.getAppkey());
params.put("appToken", requestParams.getToken());
params.put("appType", appType.getCode());
return imSupplierAppDao.findByAppIdAndAppType(params);
return memberReadDao.findByAppIdAndAppType(params);
}
}
......
......@@ -45,7 +45,7 @@ public class PineappleServiceImpl implements PineappleService {
params.put("endTime","");
params.put("pageNow","1");
params.put("PageSize","10");
return pineappleDao.pageGetRefundBean(params);
return null;
}
@Override
......@@ -68,7 +68,7 @@ public class PineappleServiceImpl implements PineappleService {
@Override
public PineappleSyncStockResponse updateSyncStock(PineappleSyncStockRequest pineappleSyncStockRequest) throws Exception {
PineappleSyncStockResponse pineappleSyncStockResponse = new PineappleSyncStockResponse();
Map<String,Object> params = new HashMap<>();
/* Map<String,Object> params = new HashMap<>();
params.put("supplierId","");
params.put("productId",pineappleSyncStockRequest.getPlatProductID());
//先判断SKU在判断产品
......@@ -144,12 +144,13 @@ public class PineappleServiceImpl implements PineappleService {
pineappleSyncStockResponse.setQuantity(String.valueOf(pineappleSyncStockRequest.getQuantity()));
pineappleSyncStockResponse.setMessage(PineappleEnum.ERROR.getMsg());
pineappleSyncStockResponse.setCode(PineappleEnum.ERROR.getCode());
return pineappleSyncStockResponse;
return pineappleSyncStockResponse;*/
return null;
}
@Override
public BaseResponse shipments(PineappleSendRequest pineappleSend) throws Exception {
BaseResponse baseResponse =new BaseResponse();
/*BaseResponse baseResponse =new BaseResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
//订单号不符合
......@@ -200,12 +201,13 @@ public class PineappleServiceImpl implements PineappleService {
pineappleDao.updateBusinessSend(params);
baseResponse.setMessage(PineappleEnum.ERROR.getMsg());
baseResponse.setCode(PineappleEnum.ERROR.getCode());
return baseResponse;
return baseResponse;*/
return null;
}
@Override
public UpdateSellerMemoResponse updateSelle(UpdateSellerMemoRequest updateSellerMemoRequest)throws Exception {
UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
/* UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
//订单号不符合
......@@ -226,6 +228,7 @@ public class PineappleServiceImpl implements PineappleService {
UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode());
UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
return UpdateSellerMemoResponse;
return UpdateSellerMemoResponse;*/
return null;
}
}
......
......@@ -10,6 +10,7 @@ import com.sibu.orderHelper.integral.model.DownloadProductSkuBean;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.reponse.DownloadProductResponse;
import com.sibu.orderHelper.integral.request.DownloadProductRequest;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
......@@ -23,15 +24,15 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
private static Logger log = Logger.getLogger(DownloadProductBizServiceImpl.class);
@Resource
private PineappleDao pineappleDao;
private MemberReadDao memberReadDao;
@Override
public DownloadProductResponse call(CallRequest<DownloadProductRequest> callRequest) throws Exception {
DownloadProductResponse downloadProductResponse = new DownloadProductResponse();
Map<String,Object> params =new HashMap<>();
params.put("supplierId",callRequest.getSupplier().getId());
params.put("sellerId",callRequest.getSupplier().getId());
if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){
params.put("isShow", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue());
params.put("state", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue());
}
params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize());
params.put("PageSize",callRequest.getBizModel().getPageSize());
......@@ -42,35 +43,15 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
params.put("productName",callRequest.getBizModel().getPageSize());
}
//查询产品
List<DownloadProductBean> downloadProductBeanList = pineappleDao.getProductListByMap(params);
List<DownloadProductBean> downloadProductBeanList = memberReadDao.downloadProductListByMap(params);
if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){
for(DownloadProductBean product : downloadProductBeanList){
//产品SKU
List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.getDownloadProductSkuBeanList(product.getPlatProductID());
if(!StringUtil.isNull(downloadProductSkuBeanList) && !downloadProductSkuBeanList.isEmpty()){
for(int i=0;i<downloadProductSkuBeanList.size();i++){
DownloadProductSkuBean sku = downloadProductSkuBeanList.get(i);
//查询SKU规格名称
List<DownloadProductSkuBean> skuList = pineappleDao.getDownloadSkuBean(sku.getSkuID());
if(!StringUtil.isNull(skuList) && !skuList.isEmpty()){
StringBuffer sb = new StringBuffer();
for(int j = 0;j<skuList.size();j++){
if(j ==0){
sb.append(skuList.get(j).getSkuname());
}else{
sb.append(","+skuList.get(j).getSkuname());
}
}
sku.setSkuname(sb.toString());
sku.setSkupictureurl(product.getPictureurl());
}
}
}
List<DownloadProductSkuBean> downloadProductSkuBeanList = memberReadDao.downloadSkuByProductId(product.getPlatProductID());
product.setSkus(downloadProductSkuBeanList);
};
downloadProductResponse.setTotalcount(downloadProductBeanList.size());
int count = memberReadDao.countDownloadProductListByMap(params);
downloadProductResponse.setTotalcount(count);
}else{
downloadProductResponse.setTotalcount(0);
}
......
package com.sibu.orderHelper.integral.service.pineapple.impl;
import com.alibaba.dubbo.config.annotation.Reference;
import com.doubo.common.model.response.CommonResponse;
import com.sibu.mall.common.utils.SeqGenUtil;
import com.sibu.mall.order.request.api.ApiOrdersSnRequest;
import com.sibu.mall.order.request.third.ThirdOrdersProductIdRequest;
import com.sibu.mall.order.response.api.ApiOrdersResponse;
import com.sibu.mall.order.service.ApiOrdersService;
import com.sibu.mall.order.service.ThirdApiOrderService;
import com.sibu.orderHelper.common.constants.AppConstants;
import com.sibu.orderHelper.common.database.DBContextHolder;
import com.sibu.orderHelper.common.strategy.DbUtil;
......@@ -7,6 +15,7 @@ import com.sibu.orderHelper.common.util.StringUtil;
import com.sibu.orderHelper.enums.PineappleEnum;
import com.sibu.orderHelper.enums.PineappleMethodsEnum;
import com.sibu.orderHelper.enums.PineappleRefundEnum;
import com.sibu.orderHelper.enums.PineappleRefundMoneyStateEnum;
import com.sibu.orderHelper.integral.dao.PineappleDao;
import com.sibu.orderHelper.integral.model.GetRefundBean;
import com.sibu.orderHelper.integral.model.PineappleOderDetailBean;
......@@ -15,6 +24,7 @@ import com.sibu.orderHelper.integral.pineapple.exception.BizException;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.reponse.GetRefundResponse;
import com.sibu.orderHelper.integral.request.GetRefundRequest;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
......@@ -31,6 +41,14 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
@Resource
private PineappleDao pineappleDao;
@Resource
private MemberReadDao memberReadDao;
@Reference
private ThirdApiOrderService thirdApiOrderService;
@Reference
private ApiOrdersService apiOrdersService;
@Override
public GetRefundResponse call(CallRequest<GetRefundRequest> callRequest) throws Exception {
......@@ -39,12 +57,53 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
params.put("supplierId",callRequest.getSupplier().getId());
params.put("beginTime",callRequest.getBizModel().getBeginTime());
params.put("endTime",callRequest.getBizModel().getEndTime());
params.put("pageNow",(callRequest.getBizModel().getPageIndex()- 1) * callRequest.getBizModel().getPageSize());
params.put("PageIndex",(callRequest.getBizModel().getPageIndex()- 1) * callRequest.getBizModel().getPageSize());
params.put("PageSize",callRequest.getBizModel().getPageSize());
List<GetRefundBean> refundBeanList = pineappleDao.pageGetRefundBean(params);
List<GetRefundBean> refundBeanList = memberReadDao.getGetRefundBean(params);
if(!StringUtil.isNull(refundBeanList) && !refundBeanList.isEmpty()){
for(GetRefundBean getRefundBean:refundBeanList){
String orderSn = getRefundBean.getPlatorderno();
//旧订单号处理
if(!orderSn.startsWith("B")){
orderSn = memberReadDao.getNewOrderSnByOldOrderSn(orderSn);
}
ApiOrdersSnRequest apiOrdersSnRequest = new ApiOrdersSnRequest(orderSn);
apiOrdersSnRequest.setInitiationID(SeqGenUtil.getLogId());
CommonResponse<ApiOrdersResponse> orderResponse = apiOrdersService.getOrdersByOrderSn(apiOrdersSnRequest);
if(orderResponse.isSuccess()){
getRefundBean.setTotalamount(orderResponse.getResult().getMoneyOrder());
getRefundBean.setPayamount(orderResponse.getResult().getMoneyOrder());
getRefundBean.setOrderstatus(String.valueOf(orderResponse.getResult().getOrderState()));
}else {
throw new BizException(orderResponse.getErrorMsg());
}
ThirdOrdersProductIdRequest thirdOrdersProductIdRequest = new ThirdOrdersProductIdRequest(getRefundBean.getOrdersproductuid(),orderSn);
thirdOrdersProductIdRequest.setInitiationID(SeqGenUtil.getLogId());
CommonResponse<Integer> response = thirdApiOrderService.countOrderProductNum(thirdOrdersProductIdRequest);
getRefundBean.setProductnum(response.getResult());
OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolveByPlatformOrderStatus(Integer.valueOf(getRefundBean.getOrderstatus()));
if(orderStatusEnum.getCode().equals(OrderStatusEnum.UNKNOWN.getCode())){
throw new BizException(String.format("菠萝派退款单下载,枚举查询订单状态报错,订单状态【{0}】转换失败",getRefundBean.getOrderstatus()));
}
getRefundBean.setOrderstatus(orderStatusEnum.getCode());
getRefundBean.setOrderstatusdesc(orderStatusEnum.getMsg());
PineappleRefundEnum pineappleRefundEnum = PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(getRefundBean.getRefundstatus()));
if(pineappleRefundEnum.getCode() == PineappleRefundEnum.JH_06.getCode()){
PineappleRefundMoneyStateEnum pineappleRefundMoneyStateEnum = PineappleRefundMoneyStateEnum.resolveByPlatformRefundStatus(getRefundBean.getStateMoney());
if(pineappleRefundMoneyStateEnum.getCode().equals(PineappleRefundMoneyStateEnum.REFUND_UNKNOWN.getCode())){
throw new BizException(String.format("菠萝派退款单下载,枚举查询退款状态报错,订单状态【{0}】转换失败",getRefundBean.getRefundstatus()));
}
getRefundBean.setRefundstatus(pineappleRefundMoneyStateEnum.getPineappleRefundEnum().getCode());
getRefundBean.setRefundstatusdesc(pineappleRefundMoneyStateEnum.getPineappleRefundEnum().getMsg());
}else{
getRefundBean.setRefundstatus(pineappleRefundEnum.getCode());
getRefundBean.setRefundstatusdesc(pineappleRefundEnum.getMsg());
}
}
/*for(GetRefundBean getRefundBean:refundBeanList){
Map<String,Object> map = new HashMap<>();
String redisMysqlDbConfig = "";
Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(getRefundBean.getPlatorderno());
......@@ -54,7 +113,7 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
map.put("orderId1",getRefundBean.getSubplatorderno());
redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue());
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
PineappleOderDetailBean pineappleOderDetailBean = pineappleDao.getOneIMOrderById(map);
PineappleOderDetailBean pineappleOderDetailBean = null;
if(StringUtil.isNull(pineappleOderDetailBean)){
log.error(String.format("订单号:%查询不到该订单信息,请求method:%s,appket:%s",getRefundBean.getSubplatorderno(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey()));
throw new BizException(String.format("订单号:%查询不到该订单信息,请求method:%s,appket:%s",getRefundBean.getSubplatorderno(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey()));
......@@ -75,8 +134,8 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
getRefundBean.setRefundstatus(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(getRefundBean.getRefundstatus())).getCode());
}
getRefundResponse.setTotalcount(refundBeanList.size());
}*/
getRefundResponse.setTotalcount(memberReadDao.countGetGetRefundBean(params));
}else{
getRefundResponse.setTotalcount(0);
}
......
package com.sibu.orderHelper.integral.service.pineapple.impl;
import com.sibu.orderHelper.common.constants.AppConstants;
import com.sibu.orderHelper.common.database.DBContextHolder;
import com.sibu.orderHelper.common.strategy.DbUtil;
import com.alibaba.dubbo.config.annotation.Reference;
import com.doubo.common.model.response.CommonResponse;
import com.sibu.mall.common.utils.SeqGenUtil;
import com.sibu.mall.order.request.third.ThirdQueryOrderRequest;
import com.sibu.mall.order.request.third.ThirdUpdateOrderRequest;
import com.sibu.mall.order.response.api.ApiOrdersResponse;
import com.sibu.mall.order.service.ThirdApiOrderService;
import com.sibu.orderHelper.common.util.BeanCopyUtils;
import com.sibu.orderHelper.common.util.StringUtil;
import com.sibu.orderHelper.enums.PineappleEnum;
import com.sibu.orderHelper.enums.PineappleMethodsEnum;
import com.sibu.orderHelper.integral.dao.PineappleDao;
import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
import com.sibu.orderHelper.integral.pineapple.exception.BizException;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse;
import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Service
public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateSellerMemoRequest> {
private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class);
@Resource
private PineappleDao pineappleDao;
private MemberReadDao memberReadDao;
@Reference
private ThirdApiOrderService thirdApiOrderService;
@Override
public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception {
UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo());
String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo());
params.put("doingOrderTable","im_doing_order_" + tableIndex);
params.put("orderCode",callRequest.getBizModel().getPlatOrderNo());
params.put("sellerRemark",callRequest.getBizModel().getSellerMemo());
params.put("supplierId",callRequest.getSupplier().getId());
redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue());
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
IMDoingOrderBean iMDoingOrderBean = pineappleDao.getOrderListByMap(params);
if(StringUtil.isNull(iMDoingOrderBean)){
log.error("获取订单数据业务异常");
throw new BizException("获取订单数据业务异常");
ThirdQueryOrderRequest thirdQueryOrderRequest = new ThirdQueryOrderRequest();
//旧订单号处理
if(!callRequest.getBizModel().getPlatOrderNo().startsWith("B")){
callRequest.getBizModel().setPlatOrderNo(memberReadDao.getNewOrderSnByOldOrderSn(callRequest.getBizModel().getPlatOrderNo()));
}
thirdQueryOrderRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
thirdQueryOrderRequest.setSellerId(callRequest.getSupplier().getId());
thirdQueryOrderRequest.setInitiationID(SeqGenUtil.getLogId());
ThirdUpdateOrderRequest thirdUpdateOrderRequest = new ThirdUpdateOrderRequest();
thirdUpdateOrderRequest.setOrderSn(callRequest.getBizModel().getPlatOrderNo());
thirdUpdateOrderRequest.setSellerId(callRequest.getSupplier().getId());
thirdUpdateOrderRequest.setRemark(callRequest.getBizModel().getSellerMemo());
thirdUpdateOrderRequest.setInitiationID(SeqGenUtil.getLogId());
Orders orders = null;
CommonResponse<ApiOrdersResponse> response = thirdApiOrderService.getOrdersByMap(thirdQueryOrderRequest);
if(response.isSuccess()){
orders = BeanCopyUtils.copyProperties(Orders.class,response.getResult());
}else {
throw new BizException(response.getErrorMsg());
}
if(StringUtil.isNull(orders)){
log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
}
CommonResponse<Boolean> updateResponse = thirdApiOrderService.updateOrders(thirdUpdateOrderRequest);
if(!updateResponse.isSuccess()){
log.error(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
throw new BizException(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
}
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
pineappleDao.updateSelle(params);
UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode());
UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
return UpdateSellerMemoResponse;
......
......@@ -25,12 +25,12 @@
</modules>
<properties>
<!-- spring版本 -->
<spring.version>4.0.0.RELEASE</spring.version>
<spring.version>4.3.16.RELEASE</spring.version>
<!-- mybatis版本 -->
<mybatis.version>3.2.4</mybatis.version>
<!-- log4j日志文件管理包版 -->
<slf4j.version>1.6.6</slf4j.version>
<log4j.version>1.2.13</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<!-- mysql驱动的版 -->
<mysql.version>5.1.35</mysql.version>
<!-- <mysql.version>3.1.14</mysql.version> -->
......@@ -47,6 +47,10 @@
<doubo-parent.version>2.0.0</doubo-parent.version>
<dubbo.version>2.6.3</dubbo.version>
<curator.version>2.12.0</curator.version>
</properties>
<dependencies>
<dependency>
......@@ -406,6 +410,32 @@
<artifactId>protobuf-java</artifactId>
<version>2.6.1</version>
</dependency>
<!-- dubbo begin -->
<!-- https://mvnrepository.com/artifact/com.alibaba/dubbo -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>
<!-- dubbo begin -->
<!-- taobao sms start -->
<dependency>
<groupId>com.taobao</groupId>
......@@ -426,12 +456,6 @@
<version>${doubo-parent.version}</version>
</dependency>
<!--阿里mq-->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
......