1ba87f72 刘嘉

菠萝派接口-发货接口

1 个父辈 2f6a3a63
package com.sibu.orderHelper.integral.dao;
import com.sibu.orderHelper.integral.model.*;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import com.sibu.orderHelper.integral.pineapple.model.OrdersProduct;
import com.sibu.orderHelper.integral.pineapple.model.Product;
import com.sibu.orderHelper.integral.pineapple.model.*;
import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse;
import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse;
import com.sibu.orderHelper.integral.reponse.SkuApiResponse;
......@@ -86,4 +84,28 @@ public interface PineappleDao {
List<OrdersProduct> getOrdersProductList(@Param("orderSn")String orderSn);
/**
* 根据条件查询省市级信息
* @param params
* @return
*/
Regions getRegionsByMap(Map<String,Object> params);
/**
* 根据id查询省市级信息
* @param id
* @return
*/
Regions getRegionsById(@Param("id") Integer id);
/**
* 根据条件查询物流公司
* @return
*/
List<CourierCompany> getCourierCompanyByName(Map<String,Object> params);
}
......
......@@ -68,9 +68,6 @@
<if test="addressInfo !=null and addressInfo !=''">
address_info = #{addressInfo},
</if>
<if test="deliverTime !=null and deliverTime !=''">
deliver_time = #{deliverTime},
</if>
<if test="logisticsNumber !=null and logisticsNumber !=''">
logistics_number = #{logisticsNumber},
</if>
......@@ -123,9 +120,12 @@
<if test="productId !=null and productId !=''">
AND (p.id = #{productId} or p.product_code = #{productId}
</if>
<if test="state !=null and state !=''">
<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.state = #{productName}
</if>
......@@ -180,42 +180,42 @@
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>
<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>
<!-- 查询子订单-->
......@@ -223,4 +223,53 @@
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>
</mapper>
\ No newline at end of file
......
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import com.sibu.orderHelper.enums.PayOrderStatus;
import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst;
import org.apache.commons.lang3.EnumUtils;
import java.util.List;
/**
* @author LauKa
* @contact a062431@vip.qq.com
* @date 2018/05/15
* @description 新系统丁订单状态
*/
public enum EJavaShopOrderStateEnum {
WaitPay(1, "待支付"), WaitConfirmed(2, "待确认"), WaitShip(3, "待发货"),
HasReceived(4, "已发货"), RefundFail(6, "交易关闭"),Finished(5, "交易完成");
private int code; // 错误代码
private String msg; // 错误消息
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
EJavaShopOrderStateEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static EJavaShopOrderStateEnum valueOf(int code) { // 手写的从int到enum的转换函数
List<EJavaShopOrderStateEnum> enums = EnumUtils.getEnumList(EJavaShopOrderStateEnum.class);
EJavaShopOrderStateEnum result = enums.stream()
.filter(p -> p.getCode() == code)
.findFirst()
.orElse(EJavaShopOrderStateEnum.RefundFail);
return result;
}
public static EJavaShopOrderStateEnum resolve(String code) {
List<EJavaShopOrderStateEnum> enums = EnumUtils.getEnumList(EJavaShopOrderStateEnum.class);
EJavaShopOrderStateEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
.findFirst()
.orElse(EJavaShopOrderStateEnum.RefundFail);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class CourierCompany implements Serializable{
private Integer id;
private java.util.Date createTime;
private Integer state;
private String companyMark;
private String companyName;
private Integer seq;
private String companyType;
private Integer sellerId;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class Regions implements Serializable{
private Integer id;
private Integer parentId;
private String regionName;
private String parentPath;
private String firstLetter;
private Integer regionType;
private Integer agencyId;
private Integer shippingId;
private Integer visible;
private String rowId;
}