新系统应用-菠萝派接口,订单下载(未完成)、商品下载(未完成)、修改订单备注(已完成)、修改库存(已经完成)、订单发货(未完成)
正在显示
15 个修改的文件
包含
525 行增加
和
699 行删除
1 | package com.sibu.orderHelper.integral.dao; | 1 | package com.sibu.orderHelper.integral.dao; |
2 | import com.sibu.orderHelper.integral.model.*; | 2 | import com.sibu.orderHelper.integral.model.*; |
3 | import com.sibu.orderHelper.integral.pineapple.model.Orders; | ||
4 | import com.sibu.orderHelper.integral.pineapple.model.OrdersProduct; | ||
5 | import com.sibu.orderHelper.integral.pineapple.model.Product; | ||
3 | import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse; | 6 | import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse; |
4 | import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse; | 7 | import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse; |
5 | import com.sibu.orderHelper.integral.reponse.SkuApiResponse; | 8 | import com.sibu.orderHelper.integral.reponse.SkuApiResponse; |
... | @@ -11,147 +14,76 @@ import java.util.Map; | ... | @@ -11,147 +14,76 @@ import java.util.Map; |
11 | public interface PineappleDao { | 14 | public interface PineappleDao { |
12 | 15 | ||
13 | /** | 16 | /** |
14 | * 退货退款单下载 | 17 | * 根据订单号查询订单信息 只查询不是主订单的订单 |
15 | * @param params | 18 | * @param params |
16 | * @return | 19 | * @return |
17 | */ | 20 | */ |
18 | List<GetRefundBean> pageGetRefundBean(Map<String,Object> params)throws Exception; | 21 | Orders getOrdersByMap(Map<String,Object> params); |
19 | |||
20 | PineappleOderDetailBean getOneIMOrderById(Map<String,Object> map)throws Exception; | ||
21 | |||
22 | |||
23 | |||
24 | |||
25 | |||
26 | //获取api中的商品详情 | ||
27 | IMAPIProductBean getApiProductDetailById(@Param("productId") String productId) throws Exception; | ||
28 | |||
29 | |||
30 | |||
31 | //根据条件查询退款订单 | ||
32 | int countCheckRefundStatusResponse(Map<String,Object> params)throws Exception; | ||
33 | 22 | ||
34 | /** | 23 | /** |
35 | * 根据条件判断该订单是否有成功过的退款记录 | 24 | * 修改订单备注 |
36 | * @param params | 25 | * @param params |
37 | * @return | 26 | * @return |
38 | * @throws Exception | ||
39 | */ | 27 | */ |
40 | IMDoingOrderBean getIMDoingOrderBean(Map<String,Object> params)throws Exception; | 28 | int updateOdersRemark(Map<String,Object> params); |
41 | |||
42 | |||
43 | /** | ||
44 | * 根据orderCode查询成功退款明细记录 | ||
45 | * @param orderCode | ||
46 | * @return | ||
47 | * @throws Exception | ||
48 | */ | ||
49 | List<CheckRefundStatusBean> childrenrefundStatusBySuccess(@Param("orderCode")String orderCode)throws Exception; | ||
50 | |||
51 | 29 | ||
52 | /** | 30 | /** |
53 | * 根据条件判断该订单是否有退款中的退款记录 | 31 | * 查询该订单是否有该快递单号 |
54 | * @param orderCode | ||
55 | * @return | ||
56 | * @throws Exception | ||
57 | */ | ||
58 | List<CheckRefundStatusBean> childrenrefundStatusByCourse(@Param("orderCode")String orderCode)throws Exception; | ||
59 | |||
60 | |||
61 | /** | ||
62 | * 根据条件查询产品 | ||
63 | * @param params | 32 | * @param params |
64 | * @return | 33 | * @return |
65 | * @throws Exception | ||
66 | */ | 34 | */ |
67 | IMProductBean getIMProductBeanByMap(Map<String,Object> params)throws Exception; | 35 | int checkLogisticsNumber(Map<String,Object> params); |
68 | |||
69 | 36 | ||
70 | /** | 37 | /** |
71 | * 修改订单备注 | 38 | * 订单发货更新订单状态与信息 |
72 | * @param params | 39 | * @param params |
73 | * @return | 40 | * @return |
74 | */ | 41 | */ |
75 | int updateSelle(Map<String,Object> params)throws Exception; | 42 | int updateOrdersState(Map<String,Object> params); |
76 | 43 | ||
77 | /** | ||
78 | * 订单发货 | ||
79 | * @param params | ||
80 | * @return | ||
81 | * @throws Exception | ||
82 | */ | ||
83 | int updateBusinessSend(Map<String,Object> params)throws Exception; | ||
84 | 44 | ||
85 | /** | 45 | /** |
86 | * 订单发货时判断订单号是否存在,已存在就不添加该订单号 | 46 | * 商品下载 |
87 | * @param params | 47 | * @param params |
88 | * @return | 48 | * @return |
89 | * @throws Exception | ||
90 | */ | 49 | */ |
91 | int getOrderByMap(Map<String,Object> params)throws Exception; | 50 | List<DownloadProductBean> downloadProductListByMap(Map<String,Object> params); |
92 | 51 | ||
93 | /** | ||
94 | * 根据条件查SKU | ||
95 | * @param params | ||
96 | * @return | ||
97 | * @throws Exception | ||
98 | */ | ||
99 | SkuBean getSkuBeanByMap(Map<String,Object> params)throws Exception; | ||
100 | 52 | ||
101 | /** | 53 | /** |
102 | * 根据产品ID查询所有SKU | 54 | * 根据商品ID获取该商品的所有SKU |
103 | * @param productId | 55 | * @param productId |
104 | * @return | 56 | * @return |
105 | * @throws Exception | ||
106 | */ | 57 | */ |
107 | List<SkuApiResponse> getSkuBeanListByMap(String productId)throws Exception; | 58 | List<DownloadProductSkuBean> downloadSkuByProductId(@Param("productId") String productId); |
108 | 59 | ||
109 | /** | 60 | /** |
110 | * 更新SKU库存 | 61 | * 根据条件更新sku库存 |
111 | * @param skuBean | ||
112 | * @return | ||
113 | * @throws Exception | ||
114 | */ | ||
115 | int updateSku(SkuBean skuBean)throws Exception; | ||
116 | |||
117 | //更新产品库存 | ||
118 | int updateProductInventory(IMProductInventory productInventory) throws Exception; | ||
119 | |||
120 | /** | ||
121 | * 更新产品库存 | ||
122 | * @param params | 62 | * @param params |
123 | * @return | 63 | * @return |
124 | * @throws Exception | ||
125 | */ | 64 | */ |
126 | int updateProduct(Map<String,Object> params)throws Exception; | 65 | int updateSkuStock(Map<String,Object> params); |
127 | |||
128 | 66 | ||
129 | /** | 67 | /** |
130 | * 商品下载 查询产品 | 68 | * 根据商品ID更新商品库存 |
131 | * @param params | 69 | * @param params |
132 | * @return | 70 | * @return |
133 | * @throws Exception | ||
134 | */ | 71 | */ |
135 | List<DownloadProductBean> getProductListByMap(Map<String,Object> params)throws Exception; | 72 | int updateProductStock(Map<String,Object> params); |
136 | 73 | ||
137 | /** | 74 | /** |
138 | * 根据产品ID查询SKU | 75 | * 订单下载 |
139 | * @param productid | 76 | * @param params |
140 | * @return | 77 | * @return |
141 | * @throws Exception | ||
142 | */ | 78 | */ |
143 | List<DownloadProductSkuBean> getDownloadProductSkuBeanList(String productid)throws Exception; | 79 | List<Orders> getOrdersList(Map<String,Object> params); |
144 | 80 | ||
145 | /** | 81 | /** |
146 | * 根据产品ID查询SKU属性 | 82 | * 子订单查询 |
147 | * @param skuId | 83 | * @param orderSn |
148 | * @return | 84 | * @return |
149 | * @throws Exception | ||
150 | */ | 85 | */ |
151 | List<DownloadProductSkuBean> getDownloadSkuBean(@Param("skuId") String skuId)throws Exception; | 86 | List<OrdersProduct> getOrdersProductList(@Param("orderSn")String orderSn); |
152 | |||
153 | 87 | ||
154 | IMDoingOrderBean getOrderListByMap(Map<String,Object> params)throws Exception; | ||
155 | 88 | ||
156 | IMProductBean getIMProductBeanById(@Param("productId") String productId)throws Exception; | ||
157 | } | 89 | } | ... | ... |
... | @@ -3,477 +3,224 @@ | ... | @@ -3,477 +3,224 @@ |
3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
5 | <mapper namespace="com.sibu.orderHelper.integral.dao.PineappleDao"> | 5 | <mapper namespace="com.sibu.orderHelper.integral.dao.PineappleDao"> |
6 | 6 | <!-- 订单实体 --> | |
7 | <!--检测退款订单--> | 7 | <resultMap id="orders" type="com.sibu.orderHelper.integral.pineapple.model.Orders"> |
8 | <select id="countCheckRefundStatusResponse" parameterType="java.util.Map" resultType="java.lang.Integer"> | 8 | <result property="id" column="id" /> |
9 | SELECT COUNT(*) FROM im_order_refund WHERE order_code = #{orderCode} AND refund_status NOT IN ('100','101','-128') | 9 | <result property="sellerId" column="seller_id" /> |
10 | </select> | 10 | <result property="sellerName" column="seller_name" /> |
11 | 11 | <result property="orderId" column="order_id" /> | |
12 | <select id="getIMDoingOrderBean" parameterType="java.util.Map" resultMap="iMDoingOrderBean"> | 12 | <result property="orderSn" column="order_sn" /> |
13 | select order_code,order_status from ${doingOrderTable} WHERE order_code = #{orderCode} and supplier_id =#{supplierId} | 13 | <result property="orderProductId" column="order_product_id" /> |
14 | </select> | 14 | <result property="productId" column="product_id" /> |
15 | 15 | <result property="productName" column="product_name" /> | |
16 | 16 | <result property="memberId" column="member_id" /> | |
17 | <resultMap id="iMDoingOrderBean" type="com.sibu.orderHelper.integral.model.IMDoingOrderBean"> | 17 | <result property="memberName" column="member_name" /> |
18 | <result column="order_code" property="orderCode"/> | 18 | <result property="provinceId" column="province_id" /> |
19 | <result column="order_status" property="orderStatus"/> | 19 | <result property="cityId" column="city_id" /> |
20 | <result property="areaId" column="area_id" /> | ||
21 | <result property="addressAll" column="address_all" /> | ||
22 | <result property="addressInfo" column="address_info" /> | ||
23 | <result property="zipCode" column="zip_code" /> | ||
24 | <result property="changeName" column="change_name" /> | ||
25 | <result property="phone" column="phone" /> | ||
26 | <result property="logisticsId" column="logistics_id" /> | ||
27 | <result property="logisticsName" column="logistics_name" /> | ||
28 | <result property="logisticsMark" column="logistics_mark" /> | ||
29 | <result property="logisticsNumber" column="logistics_number" /> | ||
30 | <result property="number" column="number" /> | ||
31 | <result property="question" column="question" /> | ||
32 | <result property="image" column="image" /> | ||
33 | <result property="name" column="name" /> | ||
34 | <result property="state" column="state" /> | ||
35 | <result property="optId" column="opt_id" /> | ||
36 | <result property="optName" column="opt_name" /> | ||
37 | <result property="remark" column="remark" /> | ||
38 | <result property="createTime" column="create_time" /> | ||
39 | <result property="updateTime" column="update_time" /> | ||
40 | <result property="regionName1" column="regionName1" /> | ||
41 | <result property="regionName2" column="regionName2" /> | ||
42 | <result property="regionName3" column="regionName3" /> | ||
20 | </resultMap> | 43 | </resultMap> |
21 | 44 | ||
22 | <select id="childrenrefundStatusBySuccess" parameterType="java.lang.String" resultMap="checkRefundStatusBean"> | 45 | <!-- 根据订单号查询订单信息 只查询不是主订单的订单 --> |
23 | SELECT r.refund_code,r1.name,r.refund_status FROM im_refund_order_item r1 | 46 | <select id="getOrders" parameterType="java.util.Map" resultMap="orders"> |
24 | LEFT JOIN im_order_refund r ON r1.refund_id = r.refund_id | 47 | select * from orders where order_sn = #{orderSn} AND seller_id = #{sellerId} AND is_parent = 0 |
25 | WHERE r.refund_status = 7 AND r.order_code = #{orderCode} | ||
26 | </select> | 48 | </select> |
27 | 49 | ||
28 | <resultMap id="checkRefundStatusBean" type="com.sibu.orderHelper.integral.model.CheckRefundStatusBean"> | 50 | <!-- 修改订单备注 --> |
29 | <result column="refund_code" property="refundno"/> | 51 | <update id="updateOdersRemark"> |
30 | <result column="name" property="ProductName"/> | 52 | UPDATE orders SET remark = #{remark} WHERE order_sn = #{orderSn} AND seller_id = #{sellerId} |
31 | <result column="refund_status" property="refundStatus"/> | 53 | </update> |
32 | </resultMap> | ||
33 | 54 | ||
34 | <select id="childrenrefundStatusByCourse" parameterType="java.lang.String" resultMap="checkRefundStatusBean"> | 55 | <!-- 订单发货--> |
35 | SELECT r.refund_code,r1.name,r.refund_status FROM im_refund_order_item r1 | 56 | <!-- 验证订单号是否已存在--> |
36 | LEFT JOIN im_order_refund r ON r1.refund_id = r.refund_id | 57 | <select id="checkLogisticsNumber" parameterType="java.util.Map" resultType="java.lang.Integer"> |
37 | WHERE r.refund_status NOT IN ('7','100','101','-128') AND r.order_code = #{orderCode} | 58 | select count(*) from orders where order_sn = #{orderSn} AND seller_id = #{sellerId} and logistics_number like concat(concat('%',#{logisticsNumber},'%')) |
38 | </select> | 59 | </select> |
39 | 60 | ||
40 | 61 | <!--更改订单状态、电话、地址、发货时间、收货人姓名,快递单号 --> | |
41 | 62 | <update id="updateOrdersState"> | |
42 | 63 | UPDATE orders SET | |
43 | <!-- 退货退款单下载 --> | 64 | <set> |
44 | <resultMap id="getRefundBeanResultMap" type="com.sibu.orderHelper.integral.model.GetRefundBean"> | 65 | <if test="name !=null and name !=''"> |
45 | <result column="refund_code" property="refundno"/> | 66 | name = #{name}, |
46 | <result column="order_code" property="platorderno"/> | ||
47 | <result column="order1_id" property="subplatorderno"/> | ||
48 | <result column="refund_money" property="refundamount"/> | ||
49 | <result column="apply_date" property="createtime"/> | ||
50 | <result column="refund_status_last_update_dt" property="updatetime"/> | ||
51 | <result column="refund_reason" property="reason"/> | ||
52 | <result column="name" property="productname"/> | ||
53 | <result column="refund_goods_deliver_name" property="logisticname"/> | ||
54 | <result column="refund_goods_waybill" property="logisticno"/> | ||
55 | <result column="status" property="goodsstatus"/> | ||
56 | <result column="refund_remark" property="refundstatusdesc"/> | ||
57 | <result column="refund_status" property="refundstatus"/> | ||
58 | <result column="spec_detail" property="sku"/> | ||
59 | <result column="im_product_id" property="outerid"/> | ||
60 | </resultMap> | ||
61 | |||
62 | |||
63 | <select id="pageGetRefundBean" parameterType="java.util.Map" resultMap="getRefundBeanResultMap"> | ||
64 | SELECT r.refund_code,r.order_code,r1.order1_id,r.refund_money,r.apply_date,r.refund_status_last_update_dt,r.refund_status,p.im_product_id, | ||
65 | r.refund_remark,'JH_98' status,p.details,r.refund_reason,r.refund_reason,r1.name,r.refund_goods_deliver_name,r.refund_goods_waybill,r1.spec_detail | ||
66 | FROM im_order_refund r | ||
67 | LEFT JOIN im_refund_order_item r1 ON r.refund_id = r1.refund_id | ||
68 | LEFT JOIN im_product p ON p.im_product_id = r1.product_id | ||
69 | WHERE 1 = 1 and r.order_from = 1 and r.refund_status NOT IN ('100','101','-128') | ||
70 | <if test="supplierId!=null and supplierId !=''"> | ||
71 | AND r.supplier_id = #{supplierId} | ||
72 | </if> | 67 | </if> |
73 | <if test="beginTime != null and beginTime !=''"> | 68 | <if test="addressInfo !=null and addressInfo !=''"> |
74 | and r.apply_date >= #{beginTime} | 69 | address_info = #{addressInfo}, |
75 | </if> | 70 | </if> |
76 | <if test="endTime != null and endTime != ''"> | 71 | <if test="deliverTime !=null and deliverTime !=''"> |
77 | <![CDATA[ | 72 | deliver_time = #{deliverTime}, |
78 | and r.apply_date <= #{endTime} | ||
79 | ]]> | ||
80 | </if> | 73 | </if> |
81 | ORDER by r.apply_date DESC | 74 | <if test="logisticsNumber !=null and logisticsNumber !=''"> |
82 | limit ${pageNow}, ${PageSize} | 75 | logistics_number = #{logisticsNumber}, |
83 | </select> | 76 | </if> |
84 | 77 | <if test="mobile !=null and mobile !=''"> | |
85 | 78 | mobile = #{mobile}, | |
86 | <!-- 获取订单详情(不包含产品) --> | 79 | </if> |
87 | <select id="getOneIMOrderById" parameterType="map" resultMap="pineappleOderDetailBean"> | 80 | <if test="addressAll !=null and addressAll !=''"> |
88 | select ifnull(do.total_money,0) money,do.supplier_name,do.buyer_username,do.prerefund_original_order_status,do1.purchase_quantity | 81 | address_all = #{addressAll}, |
89 | from ${doingOrderTable1} do1 LEFT JOIN ${doingOrderTable} do on do1.order_id = do.order_id | 82 | </if> |
90 | where do1.order1_id=#{orderId1} | 83 | <if test="orderState !=null and orderState !=''"> |
91 | </select> | 84 | order_state = #{orderState}, |
92 | <resultMap type="com.sibu.orderHelper.integral.model.PineappleOderDetailBean" id="pineappleOderDetailBean"> | 85 | </if> |
93 | <result column="money" property="totalMoney" /> | 86 | <if test="provinceId !=null and provinceId !=''"> |
94 | <result column="supplier_name" property="supplierName" /> | 87 | province_id = #{provinceId}, |
95 | <result column="buyer_username" property="buyerUsername" /> | 88 | </if> |
96 | <result column="prerefund_original_order_status" property="orderStatus" /> | 89 | <if test="areaId !=null and areaId !=''"> |
97 | <result column="purchase_quantity" property="num" /> | 90 | area_id = #{areaId}, |
98 | </resultMap> | 91 | </if> |
99 | 92 | <if test="cityId !=null and cityId !=''"> | |
100 | 93 | city_id = #{cityId}, | |
101 | 94 | </if> | |
102 | 95 | <if test="deliverTime !=null and deliverTime !=''"> | |
103 | 96 | deliver_time = now(), | |
104 | <resultMap type="com.sibu.orderHelper.integral.model.IMProductBean" id="listAPIIMProduct"> | 97 | </if> |
105 | <result column="im_product_id" property="imProductId" /> | 98 | <if test="logisticsName !=null and logisticsName !=''"> |
106 | <result column="name" property="name" /> | 99 | logistics_name = #{logisticsName}, |
107 | <result column="short_name" property="shortName" /> | 100 | </if> |
108 | <result column="stock_num" property="stockNum" /> | 101 | <if test="logisticsId !=null and logisticsId !=''"> |
109 | <result column="details" property="details" /> | 102 | logistics_id = #{logisticsId}, |
110 | <result column="exchange_integral" property="exchangeIntegral" /> | 103 | </if> |
111 | <result column="xws_exchange_integral" property="xwsExchangeIntegral" /> | 104 | </set> |
112 | <result column="sibukg_exchange_integral" property="sibukgExchangeIntegral" /> | 105 | WHERE order_sn = #{orderSn} AND seller_id = #{sellerId} |
113 | <result column="onther1_exchange_integral" property="onther1ExchangeIntegral" /> | 106 | </update> |
114 | <result column="onther2_exchange_integral" property="onther2ExchangeIntegral" /> | ||
115 | <result column="onther3_exchange_integral" property="onther3ExchangeIntegral" /> | ||
116 | <result column="thumb_img" property="thumbImg" /> | ||
117 | <result column="bannel_img1" property="bannelImg1" /> | ||
118 | <result column="bannel_img2" property="bannelImg2" /> | ||
119 | <result column="bannel_img3" property="bannelImg3" /> | ||
120 | <result column="bannel_img4" property="bannelImg4" /> | ||
121 | <result column="bannel_img5" property="bannelImg5" /> | ||
122 | <result column="limit_exchange_number" property="limitExchangeNumber"/> | ||
123 | <result column="is_new" property="isNew" /> | ||
124 | <result column="is_hot" property="isHot" /> | ||
125 | <result column="is_reco" property="isReco" /> | ||
126 | <result column="cost" property="cost" /> | ||
127 | <result column="attention" property="attention" /> | ||
128 | <result column="total_comment_score" property="totalCommentScore" /> | ||
129 | <result column="total_comment_number" property="totalCommentNumber" /> | ||
130 | <result column="member_price" property="memberPrice" /> | ||
131 | <result column="retail_price" property="retailPrice" /> | ||
132 | <result column="market_price" property="marketPrice" /> | ||
133 | <result column="product_type" property="productType" /> | ||
134 | <result column="is_show" property="isShow"/> | ||
135 | <result column="bar_code" property="barCode"/> | ||
136 | <result column="is_open_spec" property="isOpenSpec"/> | ||
137 | <result column="spec" property="spec"/> | ||
138 | <result column="mini_purchase_number" property="miniPurchaseNumber"/> | ||
139 | <result column="format_str" property="formatStr"/> | ||
140 | <result column="erp_code" property="erpCode"/> | ||
141 | <result column="is_group" property="isGroup"/> | ||
142 | <result column="share_status" property="shareStatus"/> | ||
143 | <result column="share_percentage" property="sharePercentage"/> | ||
144 | <result column="im_category_id" property="imCategoryId"/> | ||
145 | <result column="delete_flag" property="deleteFlag"/> | ||
146 | </resultMap> | ||
147 | |||
148 | |||
149 | |||
150 | 107 | ||
151 | <!-- 产品下载 --> | 108 | <!-- 商品下载实体--> |
152 | <resultMap id="downloadProductBean" type="com.sibu.orderHelper.integral.model.DownloadProductBean"> | 109 | <resultMap id="downloadProductBean" type="com.sibu.orderHelper.integral.model.DownloadProductBean"> |
153 | <result column="im_product_id" property="PlatProductID"/> | 110 | <result column="id" property="PlatProductID"/> |
154 | <result column="name" property="name"/> | 111 | <result column="name" property="name"/> |
155 | <result column="OuterID" property="OuterID"/> | 112 | <result column="outerID" property="OuterID"/> |
156 | <result column="price" property="price"/> | 113 | <result column="price" property="price"/> |
157 | <result column="stock_num" property="num"/> | 114 | <result column="num" property="num"/> |
158 | <result column="bannel_img1" property="pictureurl"/> | 115 | <result column="pictureurl" property="pictureurl"/> |
159 | </resultMap> | 116 | </resultMap> |
160 | 117 | ||
161 | <select id="getProductListByMap" parameterType="java.util.Map" resultMap="downloadProductBean"> | 118 | <!-- 商品下载 --> |
162 | SELECT p.im_product_id,p.name,p.im_product_id AS OuterID,IFNULL(p.retail_price,0) price,p.stock_num,p.bannel_img1 | 119 | <select id="downloadProductListByMap" parameterType="java.util.Map" resultMap="downloadProductBean"> |
163 | FROM im_product p,im_product_supplier i | 120 | SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl, |
164 | WHERE p.im_product_id = i.product_id and i.supplier_id= #{supplierId} | 121 | p.mall_pc_price AS price |
165 | <if test="isShow == 0"> | 122 | FROM product p WHERE p.seller_id = #{sellerId} |
166 | and p.is_show = 0 | ||
167 | </if> | ||
168 | <if test="isShow == 1"> | ||
169 | and p.is_show = 1 | ||
170 | </if> | ||
171 | <if test="productId !=null and productId !=''"> | 123 | <if test="productId !=null and productId !=''"> |
172 | AND (p.im_product_id =#{productId} OR p.bar_code =#{productId}) | 124 | AND (p.id = #{productId} or p.product_code = #{productId} |
125 | </if> | ||
126 | <if test="state !=null and state !=''"> | ||
127 | AND p.state = #{state} | ||
173 | </if> | 128 | </if> |
174 | <if test="productName !=null and productName !=''"> | 129 | <if test="productName !=null and productName !=''"> |
175 | AND p.name =#{productName} | 130 | AND p.state = #{productName} |
176 | </if> | 131 | </if> |
177 | ORDER BY p.im_product_id DESC | 132 | ORDER BY p.im_product_id DESC |
178 | limit ${PageIndex}, ${PageSize} | 133 | limit ${PageIndex}, ${PageSize} |
179 | </select> | 134 | </select> |
180 | 135 | ||
181 | <resultMap id="downloadProductSkuBeanList" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean"> | 136 | <!-- 商品sku实体 --> |
182 | <result column="sku_id" property="SkuID"/> | 137 | <resultMap id="downloadSku" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean"> |
183 | <result column="sku_id" property="skuOuterID"/> | 138 | <result column="skuId" property="SkuID"/> |
184 | <result column="retail_price" property="skuprice"/> | 139 | <result column="skuOuterID" property="skuOuterID"/> |
185 | <result column="stock_num" property="skuQuantity"/> | 140 | <result column="skuprice" property="skuprice"/> |
186 | </resultMap> | 141 | <result column="skuQuantity" property="skuQuantity"/> |
187 | <select id="getDownloadProductSkuBeanList" parameterType="java.lang.String" resultMap="downloadProductSkuBeanList"> | 142 | <result column="skuname" property="skuname"/> |
188 | SELECT sku_id,stock_num,retail_price FROM sku WHERE im_product_id = #{productId} | 143 | <result column="skupictureurl" property="skupictureurl"/> |
189 | </select> | ||
190 | |||
191 | <resultMap id="sku" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean"> | ||
192 | <result column="name" property="skuname"/> | ||
193 | </resultMap> | 144 | </resultMap> |
194 | 145 | ||
195 | <select id="getDownloadSkuBean" parameterType="java.lang.String" resultMap="sku"> | 146 | <!-- 获取商品sku --> |
196 | SELECT concat(concat(n.attr_name,':'),v.attr_value) name FROM attr_ref a | 147 | <select id="downloadSkuByProductId" resultType="java.lang.String" resultMap="downloadSku"> |
197 | LEFT JOIN attr_value v ON a.attr_value_id = v.value_id | 148 | select g.sku AS skuId,g.sku AS skuOuterID,g.mall_pc_price AS skuprice,g.product_stock AS skuQuantity, |
198 | LEFT JOIN attr_name n on v.attr_id = n.attr_id WHERE a.sku_id = #{skuId} AND n.attr_name IS NOT NULL | 149 | g.norm_name AS skuname ,g.images AS skupictureurl FROM product_goods g WHERE g.product_id = #{productId} |
199 | </select> | 150 | </select> |
200 | 151 | ||
201 | 152 | <!-- 更新SKU库存--> | |
202 | 153 | <update id="updateSkuStock" parameterType="java.util.Map"> | |
203 | <!-- 同步库存 --> | 154 | UPDATE product_goods SET product_stock = #{stock} WHERE sku = #{skuId} and product_id = #{productId} |
204 | <resultMap id="rs_SkuBean" type="com.sibu.orderHelper.integral.model.SkuBean"> | ||
205 | <result property="skuId" column="sku_id" /> | ||
206 | <result property="imProductId" column="im_product_id"/> | ||
207 | <result property="erpCode" column="erp_code" /> | ||
208 | <result property="stockNum" column="stock_num" /> | ||
209 | <result property="exchangeIntegral" column="exchange_integral"/> | ||
210 | <result property="retailPrice" column="retail_price" /> | ||
211 | <result property="marketPrice" column="market_price" /> | ||
212 | <result property="createDate" column="create_date" /> | ||
213 | <result property="updateDate" column="update_date" /> | ||
214 | <result property="isShow" column="is_show" /> | ||
215 | </resultMap> | ||
216 | |||
217 | <resultMap id="skuApiResponse" type="com.sibu.orderHelper.integral.reponse.SkuApiResponse"> | ||
218 | <result property="skuId" column="sku_id" javaType="java.lang.String" jdbcType="VARCHAR"/> | ||
219 | <result property="erpCode" column="erp_code" javaType="java.lang.String" jdbcType="VARCHAR"/> | ||
220 | <result property="stockNum" column="stock_num" javaType="java.lang.Integer" jdbcType="INTEGER"/> | ||
221 | <result property="exchangeIntegral" column="exchange_integral" javaType="java.lang.Integer" jdbcType="INTEGER"/> | ||
222 | <result property="memberPrice" column="member_price"/> | ||
223 | <result property="retailPrice" column="retail_price"/> | ||
224 | <result property="marketPrice" column="market_price"/> | ||
225 | <collection property="values" ofType="com.sibu.orderHelper.integral.reponse.SkuValueResponse" column="sku_Id"> | ||
226 | <result property="attrValueId" column="attr_value_id" javaType="java.lang.Long" jdbcType="BIGINT"/> | ||
227 | <result property="attrId" column="attr_id" javaType="java.lang.Long" jdbcType="BIGINT"/> | ||
228 | <result property="attrName" column="attr_name" javaType="java.lang.String" jdbcType="VARCHAR"/> | ||
229 | <result property="valueName" column="attr_value" javaType="java.lang.String" jdbcType="VARCHAR"/> | ||
230 | <result property="sortIndex" column="sort_index" javaType="java.lang.Integer" jdbcType="TINYINT"/> | ||
231 | </collection> | ||
232 | </resultMap> | ||
233 | |||
234 | <!--根据产品ID与SKUID 查询SKU --> | ||
235 | <select id="getSkuBeanByMap" parameterType="java.util.Map" resultMap="rs_SkuBean"> | ||
236 | SELECT * FROM sku where | ||
237 | sku_id = #{skuId} AND im_product_id = #{productId} and is_show =1 | ||
238 | </select> | ||
239 | |||
240 | <!-- 查询product sku返回 --> | ||
241 | <select id="getSkuBeanListByMap" parameterType="java.lang.String" resultMap="skuApiResponse"> | ||
242 | SELECT s.sku_id,s.erp_code,s.stock_num,s.exchange_integral,s.retail_price,s.market_price,s.member_price, | ||
243 | s.is_show,ref.attr_value_id,n.attr_id,n.attr_name,v.attr_value ,n.sort_index FROM sku s | ||
244 | LEFT JOIN attr_ref ref ON s.sku_id =ref.sku_id | ||
245 | LEFT JOIN attr_value v ON v.value_id =ref.attr_value_id | ||
246 | LEFT JOIN attr_name n ON n.attr_id =v.attr_id | ||
247 | WHERE s.im_product_id =#{productId} | ||
248 | </select> | ||
249 | |||
250 | |||
251 | |||
252 | <!-- 更新SKU--> | ||
253 | <update id="updateSku" parameterType="com.sibu.orderHelper.integral.model.SkuBean"> | ||
254 | update sku SET stock_num = #{stockNum} WHERE sku_id = #{skuId} | ||
255 | </update> | ||
256 | |||
257 | |||
258 | <!-- 根据条件查询产品 --> | ||
259 | <sql id="Base_Product_Column"> | ||
260 | imp.im_product_id, | ||
261 | imp.name, | ||
262 | imp.short_name, | ||
263 | imp.stock_num, | ||
264 | imp.exchange_integral, | ||
265 | imp.xws_exchange_integral, | ||
266 | imp.sibukg_exchange_integral, | ||
267 | imp.onther1_exchange_integral, | ||
268 | imp.onther2_exchange_integral, | ||
269 | imp.onther3_exchange_integral, | ||
270 | imp.limit_exchange_number, | ||
271 | imp.thumb_img, | ||
272 | imp.is_new, | ||
273 | imp.is_hot, | ||
274 | imp.is_reco, | ||
275 | imp.cost, | ||
276 | imp.attention, | ||
277 | imp.is_show, | ||
278 | imp.product_type, | ||
279 | imp.member_price, | ||
280 | imp.retail_price, | ||
281 | imp.market_price, | ||
282 | imp.is_open_spec, | ||
283 | imp.spec, | ||
284 | imp.mini_purchase_number, | ||
285 | imp.format_str, | ||
286 | imp.share_status, | ||
287 | imp.share_percentage | ||
288 | </sql> | ||
289 | |||
290 | |||
291 | <select id="getIMProductBeanByMap" parameterType="java.util.Map" resultMap="listAPIIMProduct"> | ||
292 | SELECT | ||
293 | <include refid="Base_Product_Column" /> | ||
294 | FROM | ||
295 | im_product imp,im_product_supplier s | ||
296 | WHERE imp.im_product_id = s.product_id | ||
297 | AND imp.im_product_id = #{productId} | ||
298 | AND s.supplier_id = #{supplierId} | ||
299 | </select> | ||
300 | |||
301 | <select id="getIMProductBeanById" parameterType="java.lang.String" resultMap="listAPIIMProduct"> | ||
302 | SELECT | ||
303 | <include refid="Base_Product_Column" />,imp.bar_code | ||
304 | FROM | ||
305 | im_product imp | ||
306 | WHERE imp.im_product_id = #{productId} | ||
307 | </select> | ||
308 | |||
309 | |||
310 | <update id="updateProductInventory" parameterType="com.sibu.orderHelper.integral.model.IMProductInventory"> | ||
311 | update im_product_inventory set stock_num=#{stockNum} where im_product_id=#{imProductId} | ||
312 | </update> | 155 | </update> |
313 | 156 | ||
314 | <update id="updateProduct" parameterType="java.util.Map"> | 157 | <!-- 更新产品库存--> |
315 | update im_product set stock_num = #{stockNum} WHERE im_product_id = #{productId} | 158 | <update id="updateProductStock" parameterType="java.util.Map"> |
159 | UPDATE product SET product_stock = #{productStock} WHERE id = #{productId} | ||
316 | </update> | 160 | </update> |
317 | 161 | ||
318 | 162 | <!-- 主订单下载--> | |
319 | <select id="getApiProductDetailById" resultMap="listAPIIMProduct" parameterType="String" useCache="true" statementType="PREPARED"> | 163 | <select id="getOrdersList" parameterType="java.util.Map" resultMap="orders"> |
320 | select imp.im_product_id, | 164 | select o.order_sn,o.order_state,o.remark,o.create_time,p.regionName AS regionName1,c.regionName AS regionName2,a.regionName AS regionName3,o.address_info,o.mobile,o.remark,o.zip_code,o.zip_code, |
321 | imp.name, | 165 | o.money_order,o.money_product,o.pay_time,o.member_name FROM orders o |
322 | imp.short_name, | 166 | LEFT JOIN regions p ON p.id = o.province_id |
323 | imp.stock_num, | 167 | LEFT JOIN regions c ON c.id = o.city_id |
324 | imp.details, | 168 | LEFT JOIN regions a ON a.id = o.area_id |
325 | imp.exchange_integral, | 169 | WHERE o.is_parent = 0 |
326 | imp.xws_exchange_integral, | 170 | AND seller_id = #{sellerId} AND order_sn = #{orderSn} |
327 | imp.sibukg_exchange_integral, | 171 | <if test="startTime !=null and startTime ! =''"> |
328 | imp.onther1_exchange_integral, | 172 | AND create_time >= #{startTime} |
329 | imp.onther2_exchange_integral, | 173 | </if> |
330 | imp.onther3_exchange_integral, | 174 | <if test="endTime !=null and endTime ! =''"> |
331 | imp.limit_exchange_number, | 175 | <![CDATA[ |
332 | imp.thumb_img, | 176 | and create_time <= #{endTime} |
333 | imp.bannel_img1, | 177 | ]]> |
334 | imp.bannel_img2, | 178 | </if> |
335 | imp.bannel_img3, | 179 | ORDER BY o.id DESC |
336 | imp.bannel_img4, | 180 | limit ${PageIndex}, ${PageSize} |
337 | imp.bannel_img5, | ||
338 | imp.is_new, | ||
339 | imp.is_hot, | ||
340 | imp.is_reco, | ||
341 | imp.is_show, | ||
342 | imp.product_type, | ||
343 | imp.member_price, | ||
344 | imp.retail_price, | ||
345 | imp.market_price, | ||
346 | imp.is_open_spec, | ||
347 | imp.spec, | ||
348 | imp.mini_purchase_number, | ||
349 | imp.format_str, | ||
350 | imp.erp_code, | ||
351 | imp.is_group, | ||
352 | imp.share_status, | ||
353 | imp.share_percentage, | ||
354 | ipi.attention, | ||
355 | ipi.total_comment_score, | ||
356 | ipi.total_comment_number, | ||
357 | ipi.cost, | ||
358 | imp.delete_flag | ||
359 | FROM im_product imp left join im_product_inventory ipi on imp.im_product_id = ipi.im_product_id | ||
360 | WHERE | ||
361 | imp.im_product_id = #{productId} | ||
362 | </select> | ||
363 | |||
364 | <!-- 订单发货--> | ||
365 | <select id="getOrderByMap" parameterType="java.util.Map" resultType="java.lang.Integer"> | ||
366 | SELECT COUNT(*) FROM ${doingOrderTable} WHERE express_code like concat(concat('%',#{expressCode},'%')) AND order_code = #{orderCode} | ||
367 | AND supplier_id = #{supplierId} | ||
368 | </select> | 181 | </select> |
369 | 182 | ||
370 | <resultMap type="com.sibu.orderHelper.integral.model.IMDoingOrderBean" id="iMDoingOrderBean2"> | 183 | <resultMap id="ordersProduct" type="com.sibu.orderHelper.integral.pineapple.model.OrdersProduct"> |
371 | <id column="order_id" property="orderId"/> | 184 | <result property="id" column="id" /> |
372 | <result column="member_id" property="memberId"/> | 185 | <result property="ordersId" column="orders_id" /> |
373 | <result column="order_code" property="orderCode"/> | 186 | <result property="ordersSn" column="orders_sn" /> |
374 | <result column="main_order_code" property="mainOrderCode"/> | 187 | <result property="ordersPsn" column="orders_psn" /> |
375 | <result column="order_status" property="orderStatus"/> | 188 | <result property="sellerId" column="seller_id" /> |
376 | <result column="order_from" property="orderFrom"/> | 189 | <result property="sellerName" column="seller_name" /> |
377 | <result column="order_platform" property="orderPlatform"/> | 190 | <result property="productCateId" column="product_cate_id" /> |
378 | <result column="contact" property="contact"/> | 191 | <result property="productId" column="product_id" /> |
379 | <result column="phone" property="phone"/> | 192 | <result property="productGoodsId" column="product_goods_id" /> |
380 | <result column="province" property="province"/> | 193 | <result property="specInfo" column="spec_info" /> |
381 | <result column="city" property="city"/> | 194 | <result property="productName" column="product_name" /> |
382 | <result column="area" property="area"/> | 195 | <result property="productSku" column="product_sku" /> |
383 | <result column="address" property="address"/> | 196 | <result property="packageGroupsId" column="package_groups_id" /> |
384 | <result column="zipcode" property="zipcode"/> | 197 | <result property="mallGroupsId" column="mall_groups_id" /> |
385 | <result column="buyer_remark" property="buyerRemark"/> | 198 | <result property="giftId" column="gift_id" /> |
386 | <result column="seller_remark" property="sellerRemark"/> | 199 | <result property="isGift" column="is_gift" /> |
387 | <result column="total_integral" property="totalIntegral"/> | 200 | <result property="moneyPrice" column="money_price" /> |
388 | <result column="total_money" property="totalMoney"/> | 201 | <result property="number" column="number" /> |
389 | <result column="freight" property="freight"/> | 202 | <result property="moneyAmount" column="money_amount" /> |
390 | <result column="express_name" property="expressName"/> | 203 | <result property="moneyActSingle" column="money_act_single" /> |
391 | <result column="express_code" property="expressCode"/> | 204 | <result property="actSingleId" column="act_single_id" /> |
392 | <result column="express_code2" property="expressCode2"/> | 205 | <result property="actGroupId" column="act_group_id" /> |
393 | <result column="create_dt" property="createDt"/> | 206 | <result property="actFlashSaleId" column="act_flash_sale_id" /> |
394 | <result column="pay_dt" property="payDt"/> | 207 | <result property="actFlashSaleProductId" column="act_flash_sale_product_id" /> |
395 | <result column="transaction_id" property="transactionId"/> | 208 | <result property="actBiddingId" column="act_bidding_id" /> |
396 | <result column="pay_type" property="payType"/> | 209 | <result property="actIntegralId" column="act_integral_id" /> |
397 | <result column="open_id" property="openId"/> | 210 | <result property="actIntegralNum" column="act_integral_num" /> |
398 | <result column="buyer_username" property="buyerUsername"></result> | 211 | <result property="actIntegralMoney" column="act_integral_money" /> |
399 | <result column="buyer_phone" property="buyerPhone"></result> | 212 | <result property="systemRemark" column="system_remark" /> |
400 | <result column="erp_import" property="erpImport"></result> | 213 | <result property="backNumber" column="back_number" /> |
401 | <result column="erp_import_dt" property="erpImportDt"></result> | 214 | <result property="exchangeNumber" column="exchange_number" /> |
402 | <result column="ship_dt" property="shipDt"></result> | 215 | <result property="createTime" column="create_time" /> |
403 | <result column="receive_dt" property="receiveDt"/> | 216 | <result property="updateTime" column="update_time" /> |
404 | <result column="user_coupon_money" property="userCouponMoney"/> | 217 | <result property="isEvaluate" column="is_evaluate" /> |
405 | <result column="deduction_vb" property="deductionVb"/> | ||
406 | <result column="deduction_money" property="deductionMoney"/> | ||
407 | <result column="prerefund_original_order_status" property="prerefundOriginalOrderStatus"/> | ||
408 | <result column="share_member_id" property="shareMemberId"/> | ||
409 | <result column="share_order_money" property="shareOrderMoney"/> | ||
410 | <result column="platform_type" property="platformType"/> | ||
411 | <result column="supplier_id" property="supplierId"/> | ||
412 | <result column="supplier_name" property="supplierName"/> | ||
413 | <result column="sign_pay_status" property="signPayStatus"/> | ||
414 | </resultMap> | 218 | </resultMap> |
415 | 219 | ||
416 | 220 | ||
417 | 221 | <!-- 查询子订单--> | |
418 | <select id="getOrderListByMap" parameterType="java.util.Map" resultMap="iMDoingOrderBean2"> | 222 | <select id="getOrdersProductList" resultType="java.util.Map" resultMap="ordersProduct"> |
419 | SELECT order_id,member_id,order_code,order_status,order_from, | 223 | SELECT product_sku,id,product_name,spec_info,number,money_price,money_act_single FROM orders_product |
420 | contact,phone,total_integral,freight,create_dt,pay_dt,total_money,buyer_username,buyer_phone,open_id, | 224 | WHERE orders_sn = #{ordersSn} |
421 | province,city,area,address,zipcode,buyer_remark,pay_type,transaction_id,user_coupon_id,user_coupon_money, | ||
422 | express_name,express_code,express_code2,order_platform, | ||
423 | erp_import,prerefund_original_order_status FROM ${doingOrderTable} WHERE order_code = #{orderCode} | ||
424 | AND supplier_id = #{supplierId} | ||
425 | </select> | 225 | </select> |
426 | |||
427 | <update id="updateBusinessSend" parameterType="java.util.Map"> | ||
428 | UPDATE ${doingOrderTable} | ||
429 | <set> | ||
430 | <if test="buyerUsername !=null and buyerUsername !='' "> | ||
431 | buyer_username =#{buyerUsername}, | ||
432 | </if> | ||
433 | <if test="expressCode !=null and expressCode !='' "> | ||
434 | express_code = #{expressCode}, | ||
435 | </if> | ||
436 | <if test="buyerPhone !=null and buyerPhone !=''"> | ||
437 | buyer_phone = #{buyerPhone}, | ||
438 | </if> | ||
439 | <if test="address!=null and address!='' "> | ||
440 | address =#{address}, | ||
441 | </if> | ||
442 | <if test="expressName !=null and expressName !='' "> | ||
443 | express_name =#{expressName}, | ||
444 | </if> | ||
445 | <if test="province !=null and province !='' "> | ||
446 | province =#{province}, | ||
447 | </if> | ||
448 | <if test="city !=null and city !='' "> | ||
449 | city =#{city}, | ||
450 | </if> | ||
451 | <if test="area !=null and area !='' "> | ||
452 | area =#{area}, | ||
453 | </if> | ||
454 | <if test="buyerUsername !=null and buyerUsername !='' "> | ||
455 | buyer_username =#{buyerUsername}, | ||
456 | </if> | ||
457 | <if test="erpImportDt !=null and erpImportDt !='' "> | ||
458 | erp_import_dt =#{erpImportDt}, | ||
459 | </if> | ||
460 | <if test="shipDt !=null and shipDt !='' "> | ||
461 | ship_dt =#{shipDt}, | ||
462 | </if> | ||
463 | <if test="orderStatus !=null and orderStatus !='' "> | ||
464 | order_status =#{orderStatus}, | ||
465 | </if> | ||
466 | erp_import = 1 | ||
467 | </set> | ||
468 | WHERE order_code = #{orderCode} | ||
469 | AND supplier_id = #{supplierId} | ||
470 | </update> | ||
471 | |||
472 | |||
473 | |||
474 | <!-- 修改订单备注 --> | ||
475 | <update id="updateSelle" parameterType="java.util.Map"> | ||
476 | UPDATE ${doingOrderTable} SET seller_remark = #{sellerRemark} WHERE order_code = #{orderCode} | ||
477 | AND supplier_id = #{supplierId} | ||
478 | </update> | ||
479 | </mapper> | 226 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Orders.java
0 → 100644
1 | package com.sibu.orderHelper.integral.pineapple.model; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.ToString; | ||
5 | |||
6 | import java.math.BigDecimal; | ||
7 | import java.util.Date; | ||
8 | import java.util.List; | ||
9 | |||
10 | @Data | ||
11 | @ToString | ||
12 | public class Orders { | ||
13 | private Integer id; | ||
14 | private String orderSn; | ||
15 | private String orderPsn; | ||
16 | private Integer isParent; | ||
17 | private Integer isShow; | ||
18 | private String relationOrderSn; | ||
19 | private Integer orderType; | ||
20 | private Integer sellerId; | ||
21 | private String sellerName; | ||
22 | private Integer memberId; | ||
23 | private String memberName; | ||
24 | private Integer orderState; | ||
25 | private Date payTime; | ||
26 | private Integer paymentStatus; | ||
27 | private Integer invoiceStatus; | ||
28 | private String invoiceTitle; | ||
29 | private String invoiceType; | ||
30 | private BigDecimal moneyProduct; | ||
31 | private BigDecimal moneyLogistics; | ||
32 | private BigDecimal moneyOrder; | ||
33 | private BigDecimal moneyPaidBalance; | ||
34 | private BigDecimal moneyPaidReality; | ||
35 | private BigDecimal moneyCoupon; | ||
36 | private BigDecimal moneyActFull; | ||
37 | private BigDecimal moneyDiscount; | ||
38 | private BigDecimal moneyBack; | ||
39 | private BigDecimal moneyIntegral; | ||
40 | private Integer integral; | ||
41 | private Integer couponUserId; | ||
42 | private Integer actFullId; | ||
43 | private Integer activityId; | ||
44 | private String ip; | ||
45 | private String paymentName; | ||
46 | private String paymentCode; | ||
47 | private String name; | ||
48 | private Integer provinceId; | ||
49 | private Integer cityId; | ||
50 | private Integer areaId; | ||
51 | private String addressAll; | ||
52 | private String addressInfo; | ||
53 | private String mobile; | ||
54 | private String email; | ||
55 | private String zipCode; | ||
56 | private String remark; | ||
57 | private Date deliverTime; | ||
58 | private Date finishTime; | ||
59 | private String tradeSn; | ||
60 | private Integer source; | ||
61 | private Integer logisticsId; | ||
62 | private String logisticsName; | ||
63 | private String logisticsNumber; | ||
64 | private Integer isCodconfim; | ||
65 | private Integer codconfirmId; | ||
66 | private String codconfirmName; | ||
67 | private Date codconfirmTime; | ||
68 | private String codconfirmRemark; | ||
69 | private Integer codconfirmState; | ||
70 | private Date createTime; | ||
71 | private Date DateupdateTime; | ||
72 | private Integer evaluateState; | ||
73 | private String regionName1; | ||
74 | private String regionName2; | ||
75 | private String regionName3; | ||
76 | |||
77 | private List<OrdersProduct> goodinfos; | ||
78 | |||
79 | |||
80 | } |
1 | package com.sibu.orderHelper.integral.pineapple.model; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.ToString; | ||
5 | |||
6 | import java.math.BigDecimal; | ||
7 | import java.util.Date; | ||
8 | |||
9 | @Data | ||
10 | @ToString | ||
11 | public class OrdersProduct { | ||
12 | private Integer id; | ||
13 | private Integer ordersId; | ||
14 | private String ordersSn; | ||
15 | private String ordersPsn; | ||
16 | private Integer sellerId; | ||
17 | private String sellerName; | ||
18 | private Integer productCateId; | ||
19 | private Integer productId; | ||
20 | private Integer productGoodsId; | ||
21 | private String specInfo; | ||
22 | private String productName; | ||
23 | private String productSku; | ||
24 | private Integer packageGroupsId; | ||
25 | private Integer mallGroupsId; | ||
26 | private Integer giftId; | ||
27 | private Integer isGift; | ||
28 | private BigDecimal moneyPrice; | ||
29 | private Integer number; | ||
30 | private BigDecimal moneyAmount; | ||
31 | private BigDecimal moneyActSingle; | ||
32 | private Integer actSingleId; | ||
33 | private Integer actGroupId; | ||
34 | private Integer actFlashSaleId; | ||
35 | private Integer actFlashSaleProductId; | ||
36 | private Integer actBiddingId; | ||
37 | private Integer actIntegralId; | ||
38 | private Integer actIntegralNum; | ||
39 | private BigDecimal actIntegralMoney; | ||
40 | private String systemRemark; | ||
41 | private Integer backNumber; | ||
42 | private Integer exchangeNumber; | ||
43 | private Date createTime; | ||
44 | private Date updateTime; | ||
45 | private Integer isEvaluate; | ||
46 | |||
47 | |||
48 | } |
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Product.java
0 → 100644
1 | package com.sibu.orderHelper.integral.pineapple.model; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.ToString; | ||
5 | |||
6 | import java.math.BigDecimal; | ||
7 | import java.util.Date; | ||
8 | |||
9 | @Data | ||
10 | @ToString | ||
11 | public class Product { | ||
12 | private Integer id; | ||
13 | private Integer productCateId; | ||
14 | private String productCatePath; | ||
15 | private String name1; | ||
16 | private String name2; | ||
17 | private String keyword; | ||
18 | private Integer productBrandId; | ||
19 | private Integer isSelf; | ||
20 | private BigDecimal costPrice; | ||
21 | private BigDecimal protectedPrice; | ||
22 | private BigDecimal marketPrice; | ||
23 | private BigDecimal mallPcPrice; | ||
24 | private BigDecimal malMobilePrice; | ||
25 | private Integer virtualSales; | ||
26 | private Integer actualSales; | ||
27 | private Integer productStock; | ||
28 | private Integer isNorm; | ||
29 | private String normIds; | ||
30 | private String normName; | ||
31 | private Integer state; | ||
32 | private Integer isTop; | ||
33 | private Date upTime; | ||
34 | private String description; | ||
35 | private String packing; | ||
36 | private Integer sellerId; | ||
37 | private Integer createId; | ||
38 | private Date createTime; | ||
39 | private Date updateTime; | ||
40 | private Integer sellerCateId; | ||
41 | private Integer sellerIsTop; | ||
42 | private Integer sellerState; | ||
43 | private Integer commentsNumber; | ||
44 | private Integer productCateState; | ||
45 | private Integer isInventedProduct; | ||
46 | private Integer transportType; | ||
47 | private Integer transportId; | ||
48 | private String masterImg; | ||
49 | private String productCode; | ||
50 | private BigDecimal saleScale1; | ||
51 | private BigDecimal saleScale2; | ||
52 | |||
53 | |||
54 | } |
1 | package com.sibu.orderHelper.integral.pineapple.model; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import lombok.ToString; | ||
5 | |||
6 | @Data | ||
7 | @ToString | ||
8 | public class ProductGoods { | ||
9 | private Long id; | ||
10 | private Long productId; | ||
11 | private String normAttrId; | ||
12 | private String normName; | ||
13 | private Double mallPcPrice; | ||
14 | private Double mallMobilePrice; | ||
15 | private Long productStock; | ||
16 | private Long productStockWarning; | ||
17 | private Long actualSales; | ||
18 | private String sku; | ||
19 | private String images; | ||
20 | private Long state; | ||
21 | private Double weight; | ||
22 | private Long length; | ||
23 | private Long width; | ||
24 | private Long height; | ||
25 | |||
26 | |||
27 | } |
... | @@ -12,6 +12,7 @@ public class PineappleSyncStockRequest { | ... | @@ -12,6 +12,7 @@ public class PineappleSyncStockRequest { |
12 | @JsonProperty("PlatProductID") | 12 | @JsonProperty("PlatProductID") |
13 | private String platProductID; | 13 | private String platProductID; |
14 | 14 | ||
15 | @NotBlank(message = "skuid参数不能为空") | ||
15 | @JsonProperty("SkuID") | 16 | @JsonProperty("SkuID") |
16 | private String skuID; | 17 | private String skuID; |
17 | 18 | ... | ... |
... | @@ -45,7 +45,7 @@ public class PineappleServiceImpl implements PineappleService { | ... | @@ -45,7 +45,7 @@ public class PineappleServiceImpl implements PineappleService { |
45 | params.put("endTime",""); | 45 | params.put("endTime",""); |
46 | params.put("pageNow","1"); | 46 | params.put("pageNow","1"); |
47 | params.put("PageSize","10"); | 47 | params.put("PageSize","10"); |
48 | return pineappleDao.pageGetRefundBean(params); | 48 | return null; |
49 | } | 49 | } |
50 | 50 | ||
51 | @Override | 51 | @Override |
... | @@ -68,7 +68,7 @@ public class PineappleServiceImpl implements PineappleService { | ... | @@ -68,7 +68,7 @@ public class PineappleServiceImpl implements PineappleService { |
68 | @Override | 68 | @Override |
69 | public PineappleSyncStockResponse updateSyncStock(PineappleSyncStockRequest pineappleSyncStockRequest) throws Exception { | 69 | public PineappleSyncStockResponse updateSyncStock(PineappleSyncStockRequest pineappleSyncStockRequest) throws Exception { |
70 | PineappleSyncStockResponse pineappleSyncStockResponse = new PineappleSyncStockResponse(); | 70 | PineappleSyncStockResponse pineappleSyncStockResponse = new PineappleSyncStockResponse(); |
71 | Map<String,Object> params = new HashMap<>(); | 71 | /* Map<String,Object> params = new HashMap<>(); |
72 | params.put("supplierId",""); | 72 | params.put("supplierId",""); |
73 | params.put("productId",pineappleSyncStockRequest.getPlatProductID()); | 73 | params.put("productId",pineappleSyncStockRequest.getPlatProductID()); |
74 | //先判断SKU在判断产品 | 74 | //先判断SKU在判断产品 |
... | @@ -144,12 +144,13 @@ public class PineappleServiceImpl implements PineappleService { | ... | @@ -144,12 +144,13 @@ public class PineappleServiceImpl implements PineappleService { |
144 | pineappleSyncStockResponse.setQuantity(String.valueOf(pineappleSyncStockRequest.getQuantity())); | 144 | pineappleSyncStockResponse.setQuantity(String.valueOf(pineappleSyncStockRequest.getQuantity())); |
145 | pineappleSyncStockResponse.setMessage(PineappleEnum.ERROR.getMsg()); | 145 | pineappleSyncStockResponse.setMessage(PineappleEnum.ERROR.getMsg()); |
146 | pineappleSyncStockResponse.setCode(PineappleEnum.ERROR.getCode()); | 146 | pineappleSyncStockResponse.setCode(PineappleEnum.ERROR.getCode()); |
147 | return pineappleSyncStockResponse; | 147 | return pineappleSyncStockResponse;*/ |
148 | return null; | ||
148 | } | 149 | } |
149 | 150 | ||
150 | @Override | 151 | @Override |
151 | public BaseResponse shipments(PineappleSendRequest pineappleSend) throws Exception { | 152 | public BaseResponse shipments(PineappleSendRequest pineappleSend) throws Exception { |
152 | BaseResponse baseResponse =new BaseResponse(); | 153 | /*BaseResponse baseResponse =new BaseResponse(); |
153 | Map<String,Object> params = new HashMap<>(); | 154 | Map<String,Object> params = new HashMap<>(); |
154 | String redisMysqlDbConfig = ""; | 155 | String redisMysqlDbConfig = ""; |
155 | //订单号不符合 | 156 | //订单号不符合 |
... | @@ -200,12 +201,13 @@ public class PineappleServiceImpl implements PineappleService { | ... | @@ -200,12 +201,13 @@ public class PineappleServiceImpl implements PineappleService { |
200 | pineappleDao.updateBusinessSend(params); | 201 | pineappleDao.updateBusinessSend(params); |
201 | baseResponse.setMessage(PineappleEnum.ERROR.getMsg()); | 202 | baseResponse.setMessage(PineappleEnum.ERROR.getMsg()); |
202 | baseResponse.setCode(PineappleEnum.ERROR.getCode()); | 203 | baseResponse.setCode(PineappleEnum.ERROR.getCode()); |
203 | return baseResponse; | 204 | return baseResponse;*/ |
205 | return null; | ||
204 | } | 206 | } |
205 | 207 | ||
206 | @Override | 208 | @Override |
207 | public UpdateSellerMemoResponse updateSelle(UpdateSellerMemoRequest updateSellerMemoRequest)throws Exception { | 209 | public UpdateSellerMemoResponse updateSelle(UpdateSellerMemoRequest updateSellerMemoRequest)throws Exception { |
208 | UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse(); | 210 | /* UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse(); |
209 | Map<String,Object> params = new HashMap<>(); | 211 | Map<String,Object> params = new HashMap<>(); |
210 | String redisMysqlDbConfig = ""; | 212 | String redisMysqlDbConfig = ""; |
211 | //订单号不符合 | 213 | //订单号不符合 |
... | @@ -226,6 +228,7 @@ public class PineappleServiceImpl implements PineappleService { | ... | @@ -226,6 +228,7 @@ public class PineappleServiceImpl implements PineappleService { |
226 | UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 228 | UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
227 | UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 229 | UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); |
228 | 230 | ||
229 | return UpdateSellerMemoResponse; | 231 | return UpdateSellerMemoResponse;*/ |
232 | return null; | ||
230 | } | 233 | } |
231 | } | 234 | } | ... | ... |
... | @@ -32,7 +32,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef | ... | @@ -32,7 +32,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef |
32 | params.put("orderCode",callRequest.getBizModel().getOrderID()); | 32 | params.put("orderCode",callRequest.getBizModel().getOrderID()); |
33 | List<CheckRefundStatusBean> checkRefundStatusBeanList = new ArrayList<>(); | 33 | List<CheckRefundStatusBean> checkRefundStatusBeanList = new ArrayList<>(); |
34 | 34 | ||
35 | 35 | /* | |
36 | //先判断是否有退款 | 36 | //先判断是否有退款 |
37 | if(pineappleDao.countCheckRefundStatusResponse(params)>0){ | 37 | if(pineappleDao.countCheckRefundStatusResponse(params)>0){ |
38 | Map<String,Object> map = new HashMap<>(); | 38 | Map<String,Object> map = new HashMap<>(); |
... | @@ -112,7 +112,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef | ... | @@ -112,7 +112,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef |
112 | checkRefundStatusResponse.setRefundStatusdescription(PineappleRefundEnum.JH_07.getMsg()); | 112 | checkRefundStatusResponse.setRefundStatusdescription(PineappleRefundEnum.JH_07.getMsg()); |
113 | checkRefundStatusResponse.setChildrenrefundStatus(new ArrayList()); | 113 | checkRefundStatusResponse.setChildrenrefundStatus(new ArrayList()); |
114 | checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 114 | checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
115 | checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 115 | checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg());*/ |
116 | return checkRefundStatusResponse; | 116 | return checkRefundStatusResponse; |
117 | } | 117 | } |
118 | 118 | ... | ... |
... | @@ -30,9 +30,9 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP | ... | @@ -30,9 +30,9 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP |
30 | DownloadProductResponse downloadProductResponse = new DownloadProductResponse(); | 30 | DownloadProductResponse downloadProductResponse = new DownloadProductResponse(); |
31 | Map<String,Object> params =new HashMap<>(); | 31 | Map<String,Object> params =new HashMap<>(); |
32 | params.put("supplierId",callRequest.getSupplier().getId()); | 32 | params.put("supplierId",callRequest.getSupplier().getId()); |
33 | if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){ | 33 | /*if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){ |
34 | params.put("isShow", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue()); | 34 | params.put("isShow", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue()); |
35 | } | 35 | }*/ |
36 | params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize()); | 36 | params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize()); |
37 | params.put("PageSize",callRequest.getBizModel().getPageSize()); | 37 | params.put("PageSize",callRequest.getBizModel().getPageSize()); |
38 | if(!StringUtil.isNull(callRequest.getBizModel().getProductId())){ | 38 | if(!StringUtil.isNull(callRequest.getBizModel().getProductId())){ |
... | @@ -42,34 +42,13 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP | ... | @@ -42,34 +42,13 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP |
42 | params.put("productName",callRequest.getBizModel().getPageSize()); | 42 | params.put("productName",callRequest.getBizModel().getPageSize()); |
43 | } | 43 | } |
44 | //查询产品 | 44 | //查询产品 |
45 | List<DownloadProductBean> downloadProductBeanList = pineappleDao.getProductListByMap(params); | 45 | List<DownloadProductBean> downloadProductBeanList = pineappleDao.downloadProductListByMap(params); |
46 | if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){ | 46 | if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){ |
47 | for(DownloadProductBean product : downloadProductBeanList){ | 47 | for(DownloadProductBean product : downloadProductBeanList){ |
48 | //产品SKU | 48 | //产品SKU |
49 | List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.getDownloadProductSkuBeanList(product.getPlatProductID()); | 49 | List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.downloadSkuByProductId(product.getPlatProductID()); |
50 | if(!StringUtil.isNull(downloadProductSkuBeanList) && !downloadProductSkuBeanList.isEmpty()){ | ||
51 | for(int i=0;i<downloadProductSkuBeanList.size();i++){ | ||
52 | DownloadProductSkuBean sku = downloadProductSkuBeanList.get(i); | ||
53 | //查询SKU规格名称 | ||
54 | List<DownloadProductSkuBean> skuList = pineappleDao.getDownloadSkuBean(sku.getSkuID()); | ||
55 | if(!StringUtil.isNull(skuList) && !skuList.isEmpty()){ | ||
56 | StringBuffer sb = new StringBuffer(); | ||
57 | for(int j = 0;j<skuList.size();j++){ | ||
58 | if(j ==0){ | ||
59 | sb.append(skuList.get(j).getSkuname()); | ||
60 | }else{ | ||
61 | sb.append(","+skuList.get(j).getSkuname()); | ||
62 | } | ||
63 | } | ||
64 | sku.setSkuname(sb.toString()); | ||
65 | sku.setSkupictureurl(product.getPictureurl()); | ||
66 | } | ||
67 | |||
68 | } | ||
69 | } | ||
70 | product.setSkus(downloadProductSkuBeanList); | 50 | product.setSkus(downloadProductSkuBeanList); |
71 | }; | 51 | }; |
72 | |||
73 | downloadProductResponse.setTotalcount(downloadProductBeanList.size()); | 52 | downloadProductResponse.setTotalcount(downloadProductBeanList.size()); |
74 | }else{ | 53 | }else{ |
75 | downloadProductResponse.setTotalcount(0); | 54 | downloadProductResponse.setTotalcount(0); | ... | ... |
... | @@ -11,6 +11,7 @@ import com.sibu.orderHelper.integral.model.IMProductBean; | ... | @@ -11,6 +11,7 @@ import com.sibu.orderHelper.integral.model.IMProductBean; |
11 | import com.sibu.orderHelper.integral.model.IMSupplier; | 11 | import com.sibu.orderHelper.integral.model.IMSupplier; |
12 | import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst; | 12 | import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst; |
13 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 13 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
14 | import com.sibu.orderHelper.integral.pineapple.model.Orders; | ||
14 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; | 15 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; |
15 | 16 | ||
16 | import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest; | 17 | import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest; |
... | @@ -57,11 +58,27 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -57,11 +58,27 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
57 | 58 | ||
58 | @Override | 59 | @Override |
59 | public BaseResponse call(CallRequest<GetOrderRequest> callRequest) { | 60 | public BaseResponse call(CallRequest<GetOrderRequest> callRequest) { |
60 | if (StringUtils.isNotBlank(callRequest.getBizModel().getPlatOrderNo())) { | 61 | Map<String,Object> params = new HashMap<>(); |
61 | return this.findByOrderCode(callRequest); | 62 | if(!StringUtil.isNull(callRequest.getBizModel().getPlatOrderNo())){ |
62 | } else { | 63 | params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); |
63 | return this.findList(callRequest); | 64 | } |
65 | params.put("sellerId",callRequest.getSupplier().getId()); | ||
66 | if(!StringUtil.isNull(callRequest.getBizModel().getStartTime())){ | ||
67 | params.put("startTime",callRequest.getBizModel().getStartTime()); | ||
68 | } | ||
69 | if(!StringUtil.isNull(callRequest.getBizModel().getEndTime())){ | ||
70 | params.put("endTime",callRequest.getBizModel().getEndTime()); | ||
64 | } | 71 | } |
72 | params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize()); | ||
73 | params.put("PageSize",callRequest.getBizModel().getPageSize()); | ||
74 | List<Orders> ordersList = pineappleDao.getOrdersList(params); | ||
75 | |||
76 | |||
77 | GetOrderResponse response = new GetOrderResponse(); | ||
78 | response.setNumTotalOrder(0); | ||
79 | response.setOrders(null); | ||
80 | response.setCode(PineAppleConst.SUCCESS_CODE); | ||
81 | return response; | ||
65 | } | 82 | } |
66 | 83 | ||
67 | 84 | ||
... | @@ -70,7 +87,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -70,7 +87,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
70 | return "Differ.JH.Business.GetOrder"; | 87 | return "Differ.JH.Business.GetOrder"; |
71 | } | 88 | } |
72 | 89 | ||
73 | 90 | /* | |
74 | private GetOrderResponse findByOrderCode(CallRequest<GetOrderRequest> callRequest) { | 91 | private GetOrderResponse findByOrderCode(CallRequest<GetOrderRequest> callRequest) { |
75 | DoingOrderDetailResponse order = null; | 92 | DoingOrderDetailResponse order = null; |
76 | try { | 93 | try { |
... | @@ -184,5 +201,5 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -184,5 +201,5 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
184 | response.setCode(PineAppleConst.SUCCESS_CODE); | 201 | response.setCode(PineAppleConst.SUCCESS_CODE); |
185 | 202 | ||
186 | return response; | 203 | return response; |
187 | } | 204 | }*/ |
188 | } | 205 | } | ... | ... |
... | @@ -34,7 +34,7 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques | ... | @@ -34,7 +34,7 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques |
34 | 34 | ||
35 | @Override | 35 | @Override |
36 | public GetRefundResponse call(CallRequest<GetRefundRequest> callRequest) throws Exception { | 36 | public GetRefundResponse call(CallRequest<GetRefundRequest> callRequest) throws Exception { |
37 | GetRefundResponse getRefundResponse =new GetRefundResponse(); | 37 | /*GetRefundResponse getRefundResponse =new GetRefundResponse(); |
38 | Map<String,Object> params = new HashMap<>(); | 38 | Map<String,Object> params = new HashMap<>(); |
39 | params.put("supplierId",callRequest.getSupplier().getId()); | 39 | params.put("supplierId",callRequest.getSupplier().getId()); |
40 | params.put("beginTime",callRequest.getBizModel().getBeginTime()); | 40 | params.put("beginTime",callRequest.getBizModel().getBeginTime()); |
... | @@ -83,8 +83,8 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques | ... | @@ -83,8 +83,8 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques |
83 | getRefundResponse.setRefunds(refundBeanList); | 83 | getRefundResponse.setRefunds(refundBeanList); |
84 | getRefundResponse.setSuccess(true); | 84 | getRefundResponse.setSuccess(true); |
85 | getRefundResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 85 | getRefundResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
86 | getRefundResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 86 | getRefundResponse.setMessage(PineappleEnum.SUCCESS.getMsg());*/ |
87 | return getRefundResponse; | 87 | return null; |
88 | } | 88 | } |
89 | 89 | ||
90 | @Override | 90 | @Override | ... | ... |
... | @@ -10,6 +10,7 @@ import com.sibu.orderHelper.enums.PineappleMethodsEnum; | ... | @@ -10,6 +10,7 @@ import com.sibu.orderHelper.enums.PineappleMethodsEnum; |
10 | import com.sibu.orderHelper.integral.dao.PineappleDao; | 10 | import com.sibu.orderHelper.integral.dao.PineappleDao; |
11 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; | 11 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; |
12 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 12 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
13 | import com.sibu.orderHelper.integral.pineapple.model.Orders; | ||
13 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; | 14 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; |
14 | import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; | 15 | import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; |
15 | import com.sibu.orderHelper.integral.request.PineappleSendRequest; | 16 | import com.sibu.orderHelper.integral.request.PineappleSendRequest; |
... | @@ -32,53 +33,42 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen | ... | @@ -32,53 +33,42 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen |
32 | public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception { | 33 | public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception { |
33 | BaseResponse baseResponse =new BaseResponse(); | 34 | BaseResponse baseResponse =new BaseResponse(); |
34 | Map<String,Object> params = new HashMap<>(); | 35 | Map<String,Object> params = new HashMap<>(); |
35 | String redisMysqlDbConfig = ""; | 36 | params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); |
36 | Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo()); | 37 | params.put("sellerId",callRequest.getSupplier().getId()); |
37 | String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo()); | ||
38 | redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue()); | ||
39 | params.put("doingOrderTable","im_doing_order_" + tableIndex); | ||
40 | params.put("orderCode",callRequest.getBizModel().getPlatOrderNo()); | ||
41 | params.put("supplierId",callRequest.getSupplier().getId()); | ||
42 | //只有订单状态为3 4 5 才允许修改地址,快递单号,其中状态为3还可以修改ERP状态与时间,发货时间,订单状态,其他订单状态直接报业务异常 | 38 | //只有订单状态为3 4 5 才允许修改地址,快递单号,其中状态为3还可以修改ERP状态与时间,发货时间,订单状态,其他订单状态直接报业务异常 |
43 | DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源 | 39 | Orders orders = pineappleDao.getOrdersByMap(params); |
44 | IMDoingOrderBean iMDoingOrderBean = pineappleDao.getOrderListByMap(params); | 40 | if(StringUtil.isNull(orders)){ |
45 | if(StringUtil.isNull(iMDoingOrderBean)){ | 41 | log.error("获取订单数据业务异常:"+callRequest.getBizModel().getPlatOrderNo()); |
46 | log.error("获取订单数据业务异常"); | 42 | throw new BizException("获取订单数据业务异常:"+callRequest.getBizModel().getPlatOrderNo()); |
47 | throw new BizException("获取订单数据业务异常"); | ||
48 | } | 43 | } |
49 | 44 | ||
50 | if(iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.HasReceived.getCode() || iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.HasDelive.getCode() | 45 | if(orders.getOrderState().intValue() == PayOrderStatus.HasReceived.getCode() || orders.getOrderState().intValue() == PayOrderStatus.HasDelive.getCode() |
51 | || iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.WaitShip.getCode()){ | 46 | || orders.getOrderState().intValue() == PayOrderStatus.WaitShip.getCode()){ |
52 | if(iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.WaitShip.getCode()){ | 47 | if(orders.getOrderState().intValue() == PayOrderStatus.WaitShip.getCode()){ |
53 | params.put("orderStatus",PayOrderStatus.HasReceived.getCode()); | 48 | params.put("orderState",PayOrderStatus.HasReceived.getCode()); |
54 | params.put("erpImportDt",new Date()); | 49 | params.put("deliverTime",new Date()); |
55 | params.put("shipDt",new Date()); | ||
56 | } | 50 | } |
57 | if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){ | ||
58 | params.put("expressCode",callRequest.getBizModel().getLogisticNo()); | ||
59 | } | ||
60 | DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源 | ||
61 | //判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去 | 51 | //判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去 |
62 | int num = pineappleDao.getOrderByMap(params); | 52 | int num = pineappleDao.checkLogisticsNumber(params); |
63 | 53 | if(num == 0){ | |
64 | if(num > 0){ | ||
65 | params.put("expressCode",""); | ||
66 | }else{ | ||
67 | if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){ | 54 | if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){ |
68 | if(StringUtil.isNull(iMDoingOrderBean.getExpressCode())){ | 55 | if(StringUtil.isNull(orders.getLogisticsNumber())){ |
69 | params.put("expressCode",callRequest.getBizModel().getLogisticNo()); | 56 | params.put("logisticsNumber",callRequest.getBizModel().getLogisticNo()); |
70 | }else{ | 57 | }else{ |
71 | params.put("expressCode",iMDoingOrderBean.getExpressCode()+";"+callRequest.getBizModel().getLogisticNo()); | 58 | params.put("logisticsNumber",orders.getLogisticsNumber()+";"+callRequest.getBizModel().getLogisticNo()); |
72 | } | 59 | } |
73 | } | 60 | } |
74 | } | 61 | } |
75 | if(StringUtil.isNull(callRequest.getBizModel().getSenderName())){ | 62 | //收货人名字 |
76 | params.put("buyerUsername",""); | 63 | if(!StringUtil.isNull(callRequest.getBizModel().getSenderName())){ |
64 | params.put("name",callRequest.getBizModel().getSenderName()); | ||
77 | } | 65 | } |
66 | //电话 | ||
78 | if(!StringUtil.isNull(callRequest.getBizModel().getSenderTel())){ | 67 | if(!StringUtil.isNull(callRequest.getBizModel().getSenderTel())){ |
79 | params.put("buyerPhone",callRequest.getBizModel().getSenderTel()); | 68 | params.put("mobile",callRequest.getBizModel().getSenderTel()); |
80 | } | 69 | } |
81 | if(!StringUtil.isNull(callRequest.getBizModel().getSenderAddress())){ | 70 | //地址 良品不需要更改地址 |
71 | /* if(!StringUtil.isNull(callRequest.getBizModel().getSenderAddress())){ | ||
82 | String [] str = callRequest.getBizModel().getSenderAddress().split(" "); | 72 | String [] str = callRequest.getBizModel().getSenderAddress().split(" "); |
83 | if(!StringUtil.isNull(str) && str.length >3){ | 73 | if(!StringUtil.isNull(str) && str.length >3){ |
84 | params.put("province",str[0]); | 74 | params.put("province",str[0]); |
... | @@ -88,20 +78,24 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen | ... | @@ -88,20 +78,24 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen |
88 | for(int i = 3;i<str.length;i++){ | 78 | for(int i = 3;i<str.length;i++){ |
89 | address.append(str[i]); | 79 | address.append(str[i]); |
90 | } | 80 | } |
91 | params.put("address",str[0]+"-"+str[1]+"-"+str[2]+"-"+address); | 81 | params.put("addressAll",str[0]+"-"+str[1]+"-"+str[2]); |
82 | params.put("addressInfo",str[0]+"-"+str[1]+"-"+str[2]+"-"+address); | ||
92 | }else{ | 83 | }else{ |
93 | log.error(String.format("订单号:%s,地址不符合要求:%s,请求method:%s,appket:%s",callRequest.getBizModel().getPlatOrderNo(),callRequest.getBizModel().getSenderAddress(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey())); | 84 | log.error(String.format("订单号:%s,地址不符合要求:%s,请求method:%s,appket:%s",callRequest.getBizModel().getPlatOrderNo(),callRequest.getBizModel().getSenderAddress(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey())); |
94 | throw new BizException(String.format("订单号:%s,地址不符合要求:%s,请求method:%s,appket:%s",callRequest.getBizModel().getPlatOrderNo(),callRequest.getBizModel().getSenderAddress(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey())); | 85 | throw new BizException(String.format("订单号:%s,地址不符合要求:%s,请求method:%s,appket:%s",callRequest.getBizModel().getPlatOrderNo(),callRequest.getBizModel().getSenderAddress(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey())); |
95 | } | 86 | } |
96 | } | 87 | }*/ |
88 | //物流公司名字 | ||
89 | if(StringUtil.isNull(orders.getLogisticsName())){ | ||
97 | params.put("expressName",callRequest.getBizModel().getLogisticName()); | 90 | params.put("expressName",callRequest.getBizModel().getLogisticName()); |
98 | 91 | ||
92 | } | ||
99 | }else{ | 93 | }else{ |
100 | log.error("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo()); | 94 | log.error("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo()); |
101 | throw new BizException("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo()); | 95 | throw new BizException("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo()); |
102 | } | 96 | } |
103 | DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源 | 97 | //修改订单信息 |
104 | pineappleDao.updateBusinessSend(params); | 98 | pineappleDao.updateOrdersState(params); |
105 | baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 99 | baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); |
106 | baseResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 100 | baseResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
107 | return baseResponse; | 101 | return baseResponse; | ... | ... |
... | @@ -4,9 +4,7 @@ import com.sibu.orderHelper.common.util.StringUtil; | ... | @@ -4,9 +4,7 @@ import com.sibu.orderHelper.common.util.StringUtil; |
4 | import com.sibu.orderHelper.enums.PineappleEnum; | 4 | import com.sibu.orderHelper.enums.PineappleEnum; |
5 | import com.sibu.orderHelper.enums.PineappleMethodsEnum; | 5 | import com.sibu.orderHelper.enums.PineappleMethodsEnum; |
6 | import com.sibu.orderHelper.integral.dao.PineappleDao; | 6 | import com.sibu.orderHelper.integral.dao.PineappleDao; |
7 | import com.sibu.orderHelper.integral.model.IMProductBean; | 7 | import com.sibu.orderHelper.integral.model.*; |
8 | import com.sibu.orderHelper.integral.model.IMProductInventory; | ||
9 | import com.sibu.orderHelper.integral.model.SkuBean; | ||
10 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 8 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
11 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; | 9 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; |
12 | import com.sibu.orderHelper.integral.reponse.PineappleSyncStockResponse; | 10 | import com.sibu.orderHelper.integral.reponse.PineappleSyncStockResponse; |
... | @@ -33,94 +31,43 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto | ... | @@ -33,94 +31,43 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto |
33 | @Override | 31 | @Override |
34 | public PineappleSyncStockResponse call(CallRequest<PineappleSyncStockRequest> callRequest) throws Exception { | 32 | public PineappleSyncStockResponse call(CallRequest<PineappleSyncStockRequest> callRequest) throws Exception { |
35 | PineappleSyncStockResponse pineappleSyncStockResponse = new PineappleSyncStockResponse(); | 33 | PineappleSyncStockResponse pineappleSyncStockResponse = new PineappleSyncStockResponse(); |
34 | if(callRequest.getBizModel().getQuantity() < 0){ | ||
35 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,商品ID是:%s",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); | ||
36 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,商品ID是:%s",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); | ||
37 | } | ||
36 | Map<String,Object> params = new HashMap<>(); | 38 | Map<String,Object> params = new HashMap<>(); |
37 | params.put("supplierId",callRequest.getSupplier().getId()); | 39 | params.put("supplierId",callRequest.getSupplier().getId()); |
38 | params.put("productId",callRequest.getBizModel().getPlatProductID()); | 40 | params.put("productId",callRequest.getBizModel().getPlatProductID()); |
39 | //先判断SKU在判断产品 | 41 | params.put("skuId",callRequest.getBizModel().getSkuID()); |
40 | IMProductBean iMProductBean = pineappleDao.getIMProductBeanByMap(params); | 42 | params.put("stock",callRequest.getBizModel().getQuantity()); |
41 | if(StringUtil.isNull(iMProductBean)){ | 43 | |
42 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,没有该商品",callRequest.getRequest().getAppkey())); | 44 | List<DownloadProductBean> downloadProductBeans = pineappleDao.downloadProductListByMap(params); |
43 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,没有该商品",callRequest.getRequest().getAppkey())); | 45 | if(StringUtil.isNull(downloadProductBeans)){ |
46 | log.error(String.format("菠萝派商城appkey[%s],没有该商品[%s]",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); | ||
47 | throw new BizException(String.format("菠萝派商城appkey[%s,没有该商品[%s]",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); | ||
44 | } | 48 | } |
45 | if(callRequest.getBizModel().getQuantity() < 0){ | 49 | if(pineappleDao.updateSkuStock(params) != 1){ |
46 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0",callRequest.getRequest().getAppkey())); | 50 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,没有该商品[%s]",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); |
47 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0",callRequest.getRequest().getAppkey())); | 51 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,没有该商品[%s]",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); |
48 | } | 52 | } |
49 | if(!StringUtil.isNull(callRequest.getBizModel().getSkuID()) && !"0".equals(callRequest.getBizModel().getSkuID())) { | 53 | List<DownloadProductSkuBean> skuBean = pineappleDao.downloadSkuByProductId(callRequest.getBizModel().getPlatProductID()); |
50 | params.put("skuId",callRequest.getBizModel().getSkuID()); | ||
51 | //查询该条SKUi | ||
52 | SkuBean skuBean = pineappleDao.getSkuBeanByMap(params); | ||
53 | if(StringUtil.isNull(skuBean)){ | 54 | if(StringUtil.isNull(skuBean)){ |
54 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU",callRequest.getRequest().getAppkey())); | 55 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU[%s]",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); |
55 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU",callRequest.getRequest().getAppkey())); | 56 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU[%s]",callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); |
56 | } | ||
57 | //更新该条SKU | ||
58 | skuBean.setStockNum(callRequest.getBizModel().getQuantity()); | ||
59 | if(pineappleDao.updateSku(skuBean) > 0){ | ||
60 | //根据产品ID获取所有SKU总数 | ||
61 | List<SkuApiResponse> skuBeanList = pineappleDao.getSkuBeanListByMap(callRequest.getBizModel().getPlatProductID()); | ||
62 | if(StringUtil.isNull(skuBeanList)){ | ||
63 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU集合",callRequest.getRequest().getAppkey())); | ||
64 | throw new BizException((String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU集合",callRequest.getRequest().getAppkey()))); | ||
65 | } | 57 | } |
66 | //更新SKU缓存 | 58 | //获取sku总库存 |
67 | RedisProductSkuService.setProductSkuFromRedis(skuBeanList,callRequest.getBizModel().getSkuID()); | 59 | Integer sumStock = skuBean.stream().map(s -> s.getSkuQuantity()).reduce(0,(a,b) ->{ |
68 | Integer sumStock = skuBeanList.stream().map(s -> s.getStockNum()).reduce(0,(a,b) ->{ | ||
69 | return a+b; | 60 | return a+b; |
70 | }); | 61 | }); |
71 | //更新产品 | 62 | params.put("productStock",sumStock); |
72 | params.put("stockNum",sumStock); | 63 | if(pineappleDao.updateProductStock(params) != 1){ |
73 | if(pineappleDao.updateProduct(params) > 0){ | 64 | log.error(String.format("菠萝派商城appkey[%s]更新产品库存失败[%s]", callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID())); |
74 | //更新产品缓存 | 65 | throw new BizException((String.format("菠萝派商城appkey[%s]更新产品库存失败[%s]", callRequest.getRequest().getAppkey(),callRequest.getBizModel().getPlatProductID()))); |
75 | RedisProductStockService.setProductStock(iMProductBean.getImProductId(), sumStock); | ||
76 | //1、更新商品库存 | ||
77 | IMProductInventory productInventory = new IMProductInventory(); | ||
78 | productInventory.setImProductId(iMProductBean.getImProductId()); | ||
79 | productInventory.setStockNum(sumStock); | ||
80 | if(pineappleDao.updateProductInventory(productInventory) > 0){ | ||
81 | //更新缓存 | ||
82 | pineappleSyncStockResponse.setQuantity(String.valueOf(callRequest.getBizModel().getQuantity())); | ||
83 | pineappleSyncStockResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | ||
84 | pineappleSyncStockResponse.setCode(PineappleEnum.SUCCESS.getCode()); | ||
85 | return pineappleSyncStockResponse; | ||
86 | } | ||
87 | }else { | ||
88 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败", callRequest.getRequest().getAppkey())); | ||
89 | throw new BizException((String.format("菠萝派商城appkey[%s]更新库存失败", callRequest.getRequest().getAppkey()))); | ||
90 | } | ||
91 | }else{ | ||
92 | log.error(String.format("菠萝派商城appkey[%s]更新sku库存失败", callRequest.getRequest().getAppkey())); | ||
93 | throw new BizException((String.format("菠萝派商城appkey[%s]更新sku库存失败", callRequest.getRequest().getAppkey()))); | ||
94 | } | ||
95 | } | 66 | } |
96 | if(!StringUtil.isNull(callRequest.getBizModel().getPlatProductID())){ | ||
97 | List<SkuApiResponse> skuBeanList = pineappleDao.getSkuBeanListByMap(callRequest.getBizModel().getPlatProductID()); | ||
98 | if(!StringUtil.isNull(skuBeanList) && !skuBeanList.isEmpty()){ | ||
99 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败,该产品有SKU,请指定SKUID,method:%s,PlatProductID:%s,SkuID:%s",callRequest.getRequest().getAppkey(),callRequest.getRequest().getMethod(),callRequest.getBizModel().getPlatProductID(),callRequest.getBizModel().getSkuID())); | ||
100 | throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,该产品有SKU,请指定SKUID,method:%s,PlatProductID:%s,SkuID:%s",callRequest.getRequest().getAppkey(),callRequest.getRequest().getMethod(),callRequest.getBizModel().getPlatProductID(),callRequest.getBizModel().getSkuID())); | ||
101 | } | ||
102 | params.put("stockNum",callRequest.getBizModel().getQuantity()); | ||
103 | if(pineappleDao.updateProduct(params) > 0){ | ||
104 | //更新产品 | ||
105 | RedisProductStockService.setProductStock(iMProductBean.getImProductId(), callRequest.getBizModel().getQuantity()); | ||
106 | //1、更新商品库存 | ||
107 | IMProductInventory productInventory = new IMProductInventory(); | ||
108 | productInventory.setImProductId(iMProductBean.getImProductId()); | ||
109 | productInventory.setStockNum(callRequest.getBizModel().getQuantity()); | ||
110 | if(pineappleDao.updateProductInventory(productInventory) > 0){ | ||
111 | //更新缓存 | ||
112 | pineappleSyncStockResponse.setQuantity(String.valueOf(callRequest.getBizModel().getQuantity())); | 67 | pineappleSyncStockResponse.setQuantity(String.valueOf(callRequest.getBizModel().getQuantity())); |
113 | pineappleSyncStockResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 68 | pineappleSyncStockResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); |
114 | pineappleSyncStockResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 69 | pineappleSyncStockResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
115 | return pineappleSyncStockResponse; | 70 | return pineappleSyncStockResponse; |
116 | }else{ | ||
117 | log.error(String.format("菠萝派商城appkey[%s]更新库存失败", callRequest.getRequest().getAppkey())); | ||
118 | throw new BizException((String.format("菠萝派商城更新sku库存失败", callRequest.getRequest().getAppkey()))); | ||
119 | } | ||
120 | } | ||
121 | } | ||
122 | log.error(String.format("菠萝派商城appkey[%s]没有更改到库存", callRequest.getRequest().getAppkey())); | ||
123 | throw new BizException((String.format("菠萝派商城appkey[%s]没有更改到库存", callRequest.getRequest().getAppkey()))); | ||
124 | } | 71 | } |
125 | 72 | ||
126 | @Override | 73 | @Override | ... | ... |
... | @@ -9,6 +9,7 @@ import com.sibu.orderHelper.enums.PineappleMethodsEnum; | ... | @@ -9,6 +9,7 @@ import com.sibu.orderHelper.enums.PineappleMethodsEnum; |
9 | import com.sibu.orderHelper.integral.dao.PineappleDao; | 9 | import com.sibu.orderHelper.integral.dao.PineappleDao; |
10 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; | 10 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; |
11 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 11 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
12 | import com.sibu.orderHelper.integral.pineapple.model.Orders; | ||
12 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; | 13 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; |
13 | import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse; | 14 | import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse; |
14 | import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest; | 15 | import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest; |
... | @@ -30,22 +31,18 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS | ... | @@ -30,22 +31,18 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS |
30 | public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception { | 31 | public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception { |
31 | UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse(); | 32 | UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse(); |
32 | Map<String,Object> params = new HashMap<>(); | 33 | Map<String,Object> params = new HashMap<>(); |
33 | String redisMysqlDbConfig = ""; | 34 | params.put("orderSn ",callRequest.getBizModel().getPlatOrderNo()); |
34 | Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo()); | 35 | params.put("remark ",callRequest.getBizModel().getSellerMemo()); |
35 | String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo()); | 36 | params.put("sellerId",callRequest.getSupplier().getId()); |
36 | params.put("doingOrderTable","im_doing_order_" + tableIndex); | 37 | Orders orders = pineappleDao.getOrdersByMap(params); |
37 | params.put("orderCode",callRequest.getBizModel().getPlatOrderNo()); | 38 | if(StringUtil.isNull(orders)){ |
38 | params.put("sellerRemark",callRequest.getBizModel().getSellerMemo()); | 39 | log.error("获取订单数据业务异常"); |
39 | params.put("supplierId",callRequest.getSupplier().getId()); | 40 | throw new BizException("获取订单数据业务异常"); |
40 | redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue()); | 41 | } |
41 | DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源 | 42 | if(pineappleDao.updateOdersRemark(params) != 1){ |
42 | IMDoingOrderBean iMDoingOrderBean = pineappleDao.getOrderListByMap(params); | ||
43 | if(StringUtil.isNull(iMDoingOrderBean)){ | ||
44 | log.error("获取订单数据业务异常"); | 43 | log.error("获取订单数据业务异常"); |
45 | throw new BizException("获取订单数据业务异常"); | 44 | throw new BizException("获取订单数据业务异常"); |
46 | } | 45 | } |
47 | DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源 | ||
48 | pineappleDao.updateSelle(params); | ||
49 | UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 46 | UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
50 | UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 47 | UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); |
51 | return UpdateSellerMemoResponse; | 48 | return UpdateSellerMemoResponse; | ... | ... |
-
请 注册 或 登录 后发表评论