d0afcb9f 刘嘉

菠萝派接口- 修改订单备注、发货、商品下载调用新数据源

1 个父辈 f06dcfdb
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.IMSupplierApp;
import com.sibu.orderHelper.integral.pineapple.model.*;
import com.sibu.orderHelper.integral.reponse.MemberAddressResponse;
import com.sibu.orderHelper.integral.request.MemberAddressAddRequest;
import org.apache.ibatis.annotations.Param;
......@@ -9,4 +13,111 @@ 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 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);
/**
* 根据条件查询物流公司
* @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> getSellerComplaintByOrderId(@Param("orderId") Integer id);
List<Seller> getSeller(@Param("id") String id);
}
......
package com.sibu.orderHelper.mall.member.write;
import java.util.Map;
public interface MemberWriteDao {
Integer count();
/**
* 修改订单备注
* @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);
}
......
......@@ -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) {
......
......@@ -7,4 +7,410 @@
<select id="count" resultType="java.lang.Integer">
select count(*) from member
</select>
<!-- 订单实体 -->
<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="province" column="regionName1" />
<result property="city" column="regionName2" />
<result property="area" column="regionName3" />
<result property="orderState" column="order_state" />
</resultMap>
<!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
<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>
<!-- 订单发货-->
<!-- 验证订单号是否已存在-->
<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>
<!-- 商品下载实体-->
<resultMap id="downloadProductBean" type="com.sibu.orderHelper.integral.model.DownloadProductBean">
<result column="id" property="PlatProductID"/>
<result column="productName" property="name"/>
<result column="outerID" property="OuterID"/>
<result column="price" property="price"/>
<result column="num" property="num"/>
<result column="pictureurl" property="pictureurl"/>
</resultMap>
<!-- 商品下载 -->
<select id="downloadProductListByMap" parameterType="java.util.Map" resultMap="downloadProductBean">
SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl,
p.mal_mobile_price AS price
FROM product p WHERE p.seller_id = #{sellerId}
<if test="productId !=null and productId !=''">
AND (p.id = #{productId} or p.product_code = #{productId})
</if>
<if test="state !=null and state !='' and state != -1">
AND p.state = #{state}
</if>
<if test="state !=null and state !='' and state == -1">
AND p.state IN ('6','7')
</if>
<if test="productName !=null and productName !=''">
AND p.name1 = #{productName}
</if>
ORDER BY p.update_time DESC
limit ${PageIndex}, ${PageSize}
</select>
<!-- 根据条件查询商品 -->
<select id="getDownloadProductBeanByMap" parameterType="java.util.Map" resultMap="downloadProductBean">
SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl,
p.mal_mobile_price AS price
FROM product p WHERE p.seller_id = #{sellerId}
<if test="productId !=null and productId !=''">
AND p.id = #{productId}
</if>
</select>
<!-- 商品下载总数量 -->
<select id="countDownloadProductListByMap" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*)
FROM product p WHERE p.seller_id = #{sellerId}
<if test="productId !=null and productId !=''">
AND (p.id = #{productId} or p.product_code = #{productId})
</if>
<if test="state !=null and state !='' and state != -1">
AND p.state = #{state}
</if>
<if test="state !=null and state !='' and state == -1">
AND p.state IN ('6','7')
</if>
<if test="productName !=null and productName !=''">
AND p.name1 = #{productName}
</if>
</select>
<!-- 商品sku实体 -->
<resultMap id="downloadSku" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean">
<result column="skuId" property="SkuID"/>
<result column="skuId" property="skuOuterID"/>
<result column="skuprice" property="skuprice"/>
<result column="skuQuantity" property="skuQuantity"/>
<result column="skuname" property="skuname"/>
<result column="skupictureurl" property="skupictureurl"/>
</resultMap>
<!-- 获取商品sku -->
<select id="downloadSkuByProductId" resultType="java.lang.String" resultMap="downloadSku">
select g.sku AS skuId,g.mall_mobile_price AS skuprice,g.product_stock AS skuQuantity,
g.norm_name AS skuname ,g.images AS skupictureurl FROM product_goods g
WHERE g.product_id = #{productId}
</select>
<!-- 主订单下载-->
<select id="getOrdersList" parameterType="java.util.Map" resultMap="orders">
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.zip_code,o.zip_code,o.money_logistics,o.money_product-o.money_order-o.money_logistics AS couponMoney
o.money_order,o.money_product,o.pay_time,o.member_name FROM orders o
LEFT JOIN regions p ON p.id = o.province_id
LEFT JOIN regions c ON c.id = o.city_id
LEFT JOIN regions a ON a.id = o.area_id
WHERE o.is_parent = 0
AND seller_id = #{sellerId} AND order_sn = #{orderSn}
<if test="startTime !=null and startTime ! =''">
AND create_time >= #{startTime}
</if>
<if test="endTime !=null and endTime ! =''">
<![CDATA[
and create_time <= #{endTime}
]]>
</if>
ORDER BY o.id DESC
limit ${PageIndex}, ${PageSize}
</select>
<!-- 子订单实体-->
<resultMap id="ordersProduct" type="com.sibu.orderHelper.integral.pineapple.model.OrdersProduct">
<result property="id" column="id" />
<result property="ordersId" column="orders_id" />
<result property="ordersSn" column="orders_sn" />
<result property="ordersPsn" column="orders_psn" />
<result property="sellerId" column="seller_id" />
<result property="sellerName" column="seller_name" />
<result property="productCateId" column="product_cate_id" />
<result property="productId" column="product_id" />
<result property="productGoodsId" column="product_goods_id" />
<result property="specInfo" column="spec_info" />
<result property="productName" column="product_name" />
<result property="productSku" column="product_sku" />
<result property="packageGroupsId" column="package_groups_id" />
<result property="mallGroupsId" column="mall_groups_id" />
<result property="giftId" column="gift_id" />
<result property="isGift" column="is_gift" />
<result property="moneyPrice" column="money_price" />
<result property="number" column="number" />
<result property="moneyAmount" column="money_amount" />
<result property="moneyActSingle" column="money_act_single" />
<result property="actSingleId" column="act_single_id" />
<result property="actGroupId" column="act_group_id" />
<result property="actFlashSaleId" column="act_flash_sale_id" />
<result property="actFlashSaleProductId" column="act_flash_sale_product_id" />
<result property="actBiddingId" column="act_bidding_id" />
<result property="actIntegralId" column="act_integral_id" />
<result property="actIntegralNum" column="act_integral_num" />
<result property="actIntegralMoney" column="act_integral_money" />
<result property="systemRemark" column="system_remark" />
<result property="backNumber" column="back_number" />
<result property="exchangeNumber" column="exchange_number" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="isEvaluate" column="is_evaluate" />
</resultMap>
<!-- 查询子订单-->
<select id="getOrdersProductList" resultType="java.util.Map" resultMap="ordersProduct">
SELECT product_sku,id,product_name,spec_info,number,money_price,money_act_single FROM orders_product
WHERE orders_sn = #{ordersSn}
</select>
<!-- 地址实体类-->
<resultMap id="regionsResult" type="com.sibu.orderHelper.integral.pineapple.model.Regions">
<result property="id" column="id" />
<result property="parentId" column="parentId" />
<result property="regionName" column="regionName" />
<result property="parentPath" column="parentPath" />
<result property="firstLetter" column="firstLetter" />
<result property="regionType" column="regionType" />
<result property="agencyId" column="agencyId" />
<result property="shippingId" column="shippingId" />
<result property="visible" column="visible" />
<result property="rowId" column="rowId" />
</resultMap>
<!-- 根据条件查询省市级信息-->
<select id="getRegionsByMap" parameterType="java.util.Map" resultMap="regionsResult">
SELECT * FROM regions WHERE regionName LIKE concat('%',#{name},'%') AND regionType = #{regionType}
</select>
<!-- 根据id查询省市级信息-->
<select id="getRegionsById" parameterType="java.lang.Integer" resultMap="regionsResult">
select
*
from `regions`
where `id` = #{id}
</select>
<!-- 物流公司实体-->
<resultMap id="courierCompanyResult" type="com.sibu.orderHelper.integral.pineapple.model.CourierCompany">
<result property="id" column="id" />
<result property="createTime" column="create_time" />
<result property="state" column="state" />
<result property="companyMark" column="company_mark" />
<result property="companyName" column="company_name" />
<result property="seq" column="seq" />
<result property="sellerId" column="seller_id" />
<result property="companyType" column="company_type" />
<result property="imagePath" column="image_path" />
<result property="content" column="content" />
</resultMap>
<!-- 根据条件查询物流公司-->
<select id="getCourierCompanyByName" parameterType="java.util.Map" resultMap="courierCompanyResult">
select
*
from `courier_company`
where company_name LIKE concat('%',#{name},'%') AND seller_id =#{sellerId}
</select>
<!--退货表实体-->
<resultMap id="memberProductBackResult" type="com.sibu.orderHelper.integral.pineapple.model.MemberProductBack">
<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="contactPhone" column="contact_phone" />
<result property="contactName" column="contact_name" />
<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="question" column="question" />
<result property="image" column="image" />
<result property="stateReturn" column="state_return" />
<result property="stateMoney" column="state_money" />
<result property="number" column="number" />
<result property="backMoney" column="back_money" />
<result property="backIntegral" column="back_integral" />
<result property="backIntegralMoney" column="back_integral_money" />
<result property="backCouponUserId" column="back_coupon_user_id" />
<result property="backMoneyTime" column="back_money_time" />
<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" />
</resultMap>
<!--根据订单号查询换货信息-->
<select id="getMemberProductBackByOrderSn" parameterType="java.lang.String" resultMap="memberProductBackResult">
SELECT * FROM member_product_back WHERE order_sn = #{orderSn} AND state_return IN ('1','2','3','4') ORDER BY create_time
</select>
<!--换货实体类-->
<resultMap id="memberProductExchangeResult" type="com.sibu.orderHelper.integral.pineapple.model.MemberProductExchange">
<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="provinceId2" column="province_id2" />
<result property="cityId2" column="city_id2" />
<result property="areaId2" column="area_id2" />
<result property="addressAll2" column="address_all2" />
<result property="addressInfo2" column="address_info2" />
<result property="zipCode2" column="zip_code2" />
<result property="changeName2" column="change_name2" />
<result property="phone2" column="phone2" />
<result property="logisticsId2" column="logistics_id2" />
<result property="logisticsName2" column="logistics_name2" />
<result property="logisticsMark2" column="logistics_mark2" />
<result property="logisticsNumber2" column="logistics_number2" />
<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" />
</resultMap>
<!--根据订单号查询换货信息-->
<select id="getMemberProductExchangeByOrderSn" parameterType="java.lang.String" resultMap="memberProductExchangeResult">
SELECT * FROM member_product_exchange WHERE order_sn = #{orderSn} AND state IN ('1','2','3','4') ORDER BY create_time
</select>
<!-- 投诉表实体-->
<resultMap id="sellerComplaintResult" type="com.sibu.orderHelper.integral.pineapple.model.SellerComplaint">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="orderId" column="order_id" />
<result property="orderProductId" column="order_product_id" />
<result property="productBackId" column="product_back_id" />
<result property="productExchangeId" column="product_exchange_id" />
<result property="content" column="content" />
<result property="image" column="image" />
<result property="complaintTime" column="complaint_time" />
<result property="sellerId" column="seller_id" />
<result property="sellerComplaintTime" column="seller_complaint_time" />
<result property="sellerCompContent" column="seller_comp_content" />
<result property="sellerCompImage" column="seller_comp_image" />
<result property="state" column="state" />
<result property="optId" column="opt_id" />
<result property="optContent" column="opt_content" />
<result property="userContent" column="user_content" />
<result property="createTime" column="create_time" />
<result property="optTime" column="opt_time" />
</resultMap>
<!-- 根据条件查询投诉表-->
<select id="getSellerComplaintById" parameterType="java.lang.Integer" resultMap="sellerComplaintResult">
SELECT * FROM seller_complaint WHERE order_id = #{orderId} AND state IN (1,3,4) ORDER BY create_time
</select>
<select id="findByAppIdAndAppType" resultMap="BaseResultMap">
select * from im_supplier_app where app_id=#{appId} and app_type = #{appType} and app_token = #{appToken}
</select>
<resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMSupplierApp">
<result column="id" property="id"/>
<result column="supplier_id" property="supplierId"/>
<result column="app_id" property="appId"/>
<result column="app_type" property="appType"/>
<result column="app_token" property="appToken"/>
<result column="app_secret" property="appSecret"/>
</resultMap>
<select id="findByIdIn" resultMap="BaseResultMap" parameterType="java.util.Map">
SELECT
*
FROM im_supplier
where id in
<foreach collection="supplierIds" item="supplierId" open="(" close=")" separator=",">
#{supplierId}
</foreach>
</select>
<select id="getSeller" parameterType="java.lang.String" resultType="com.sibu.orderHelper.integral.pineapple.model.Seller">
select * from seller
where `id` = #{id}
</select>
</mapper>
\ No newline at end of file
......
......@@ -7,4 +7,68 @@
<select id="count" resultType="java.lang.Integer">
select count(*) from member
</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>
<!--更改订单状态、电话、地址、发货时间、收货人姓名,快递单号 -->
<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
......
......@@ -3,13 +3,14 @@ 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 {
public class Orders implements Serializable{
private Integer id;
private String orderSn;
private String orderPsn;
......@@ -68,7 +69,7 @@ public class Orders {
private String codconfirmRemark;
private Integer codconfirmState;
private String createTime;
private String DateupdateTime;
private String updateTime;
private Integer evaluateState;
private String regionName1;
private String regionName2;
......
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;
}
......@@ -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);
}
}
......
......@@ -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,13 +24,13 @@ 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("state", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue());
}
......@@ -42,14 +43,15 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
params.put("productName",callRequest.getBizModel().getPageSize());
}
//查询产品
List<DownloadProductBean> downloadProductBeanList = pineappleDao.downloadProductListByMap(params);
List<DownloadProductBean> downloadProductBeanList = memberReadDao.downloadProductListByMap(params);
if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){
for(DownloadProductBean product : downloadProductBeanList){
//产品SKU
List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.downloadSkuByProductId(product.getPlatProductID());
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);
}
......
......@@ -17,6 +17,8 @@ import com.sibu.orderHelper.integral.pineapple.model.Regions;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
import com.sibu.orderHelper.integral.request.PineappleSendRequest;
import com.sibu.orderHelper.mall.member.read.MemberReadDao;
import com.sibu.orderHelper.mall.member.write.MemberWriteDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
......@@ -28,7 +30,9 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
private static Logger log = Logger.getLogger(PineappleSendBizServiceImpl.class);
@Resource
private PineappleDao pineappleDao;
private MemberReadDao memberReadDao;
@Resource
private MemberWriteDao memberWriteDao;
@Override
public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception {
......@@ -37,7 +41,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
params.put("sellerId",callRequest.getSupplier().getId());
Orders orders = pineappleDao.getOrdersByMap(params);
Orders orders = memberReadDao.getOrdersByMap(params);
if(StringUtil.isNull(orders)){
log.error(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo()));
throw new BizException(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo()));
......@@ -65,7 +69,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){
//判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去
int num = pineappleDao.checkLogisticsNumber(params);
int num = memberReadDao.checkLogisticsNumber(params);
if(num == 0){
if(StringUtil.isNull(orders.getLogisticsNumber())){
params.put("logisticsNumber",callRequest.getBizModel().getLogisticNo());
......@@ -80,7 +84,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
throw new BizException(String.format("订单发货接口,该订单状态不允许进行发货操作,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
}
//修改订单信息
pineappleDao.updateOrdersState(params);
memberWriteDao.updateOrdersState(params);
baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
baseResponse.setCode(PineappleEnum.SUCCESS.getCode());
return baseResponse;
......@@ -102,17 +106,17 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
Map<String,Object> map = new HashMap<>();
map.put("regionType",3);
map.put("name",str[2]);
Regions regions = pineappleDao.getRegionsByMap(map);
if(StringUtil.isNull(regions)){
List<Regions> regions = memberReadDao.getRegionsByMap(map);
if(StringUtil.isNull(regions) || regions.size() > 1){
params.put("provinceId","99999990");
params.put("cityId", "99999989");
params.put("areaId","99999988");
}else{
params.put("area",regions.getId());
Regions city = pineappleDao.getRegionsById(regions.getId());
params.put("area",regions.get(0).getId());
Regions city = memberReadDao.getRegionsById(regions.get(0).getId());
Regions province = null;
if(!StringUtil.isNull(city)){
province = pineappleDao.getRegionsById(city.getId());
province = memberReadDao.getRegionsById(city.getId());
}
if(!StringUtil.isNull(city) && !StringUtil.isNull(province)){
params.put("provinceId", province.getId());
......@@ -133,8 +137,8 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
Map<String,Object> m = new HashMap<>();
m.put("name","orders.getLogisticsName()");
m.put("sellerId",callRequest.getSupplier().getId());
List<CourierCompany> courierCompanyByName = pineappleDao.getCourierCompanyByName(m);
if(!StringUtil.isNull(courierCompanyByName) && !courierCompanyByName.isEmpty()){
List<CourierCompany> courierCompanyByName = memberReadDao.getCourierCompanyByName(m);
if(!StringUtil.isNull(courierCompanyByName) && !courierCompanyByName.isEmpty() && courierCompanyByName.size() == 1){
Optional<CourierCompany> first = courierCompanyByName.stream().findFirst();
params.put("logisticsName",callRequest.getBizModel().getLogisticName());
params.put("logisticsId", first.get().getId());
......
......@@ -13,8 +13,11 @@ 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 com.sibu.orderHelper.mall.member.write.MemberWriteDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
......@@ -24,22 +27,25 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class);
@Resource
private MemberReadDao memberReadDao;
@Resource
private PineappleDao pineappleDao;
private MemberWriteDao memberWriteDao;
@Override
public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception {
UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
Map<String,Object> params = new HashMap<>();
params.put("orderSn ",callRequest.getBizModel().getPlatOrderNo());
params.put("remark ",callRequest.getBizModel().getSellerMemo());
params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
params.put("remark",callRequest.getBizModel().getSellerMemo());
params.put("sellerId",callRequest.getSupplier().getId());
Orders orders = pineappleDao.getOrdersByMap(params);
Orders orders = memberReadDao.getOrdersByMap(params);
if(StringUtil.isNull(orders)){
log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
}
if(pineappleDao.updateOdersRemark(params) != 1){
if(memberWriteDao.updateOdersRemark(params) != 1){
log.error(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
throw new BizException(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
}
......