提交 cbdb2c4a authored 作者: luojie's avatar luojie

修改提供给第三方的接口中的Sql语句,修改代购信息

上级 b6f640cd
package com.diaoyun.zion.chinafrica.api;
import com.alibaba.druid.support.json.JSONUtils;
import com.diaoyun.zion.chinafrica.service.TbCfOrderService;
import com.diaoyun.zion.master.base.Result;
import com.diaoyun.zion.master.enums.ResultCodeEnum;
import com.diaoyun.zion.master.util.JodaDateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -13,11 +10,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 提供给第三方api
* @author G
......@@ -51,7 +43,7 @@ public class ThirdPartyController {
return tbCfOrderService.getOrderListByTime(beginTime,endTime,pageNum,pageSize);
}
/**
/**
*获取某段时间已发货订单数据
*/
@ApiOperation(value = "获取某段时间已发货订单数据")
......
package com.diaoyun.zion.chinafrica.dao;
import com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity;
import com.diaoyun.zion.chinafrica.vo.PlatformOrderVo;
import com.diaoyun.zion.master.dao.BaseDao;
/**
* 第三方平台对应订单信息Dao
......@@ -8,6 +8,6 @@ import com.diaoyun.zion.master.dao.BaseDao;
* @author G
* @date 2019-08-14 09:11:48
*/
public interface TbCfPlatformOrderDao extends BaseDao<TbCfPlatformOrderEntity> {
public interface TbCfPlatformOrderDao extends BaseDao<PlatformOrderVo> {
}
......@@ -9,17 +9,14 @@ import com.diaoyun.zion.master.enums.EnumItemable;
* @author G
*/
public enum DeliveryStatusEnum implements EnumItemable<DeliveryStatusEnum> {
/**
* 发货状态枚举
*/
PROCESSING("等待处理", 0),
PURCHASE("已经代购", 10),
ON_LOAD("正在配送", 20),
WAREHOUSE("已到达中国仓", 30),
ON_AFRICA("正运往非洲", 40),
ARRIVALS("到达", 50);
/**
* 代购及物流状态
*/
PROCESSING("等待处理", 0),
PURCHASE("已采购并发货", 10),
ON_LOAD("已到达中国仓", 20),
ON_AFRICA("已到达非洲仓", 40),
ARRIVALS("买家已签收", 50);
private String label;
private Integer value;
......
......@@ -3,7 +3,6 @@ package com.diaoyun.zion.chinafrica.service;
import com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity;
import com.diaoyun.zion.chinafrica.vo.TbCfOrderVo;
import com.diaoyun.zion.master.base.Result;
import com.stripe.exception.StripeException;
import java.io.IOException;
import java.net.URISyntaxException;
......@@ -169,4 +168,5 @@ public interface TbCfOrderService {
* @return
*/
Result getOrderDetail(String orderId);
}
package com.diaoyun.zion.chinafrica.service;
import com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity;
import com.diaoyun.zion.chinafrica.vo.PlatformOrderVo;
import java.util.List;
import java.util.Map;
......@@ -19,7 +19,7 @@ public interface TbCfPlatformOrderService {
* @param relativeId 主键
* @return 实体
*/
TbCfPlatformOrderEntity queryObject(String relativeId);
PlatformOrderVo queryObject(String relativeId);
/**
* 分页查询
......@@ -27,7 +27,7 @@ public interface TbCfPlatformOrderService {
* @param map 参数
* @return list
*/
List<TbCfPlatformOrderEntity> queryList(Map<String, Object> map);
List<PlatformOrderVo> queryList(Map<String, Object> map);
/**
* 分页统计总数
......@@ -43,7 +43,7 @@ public interface TbCfPlatformOrderService {
* @param tbCfPlatformOrder 实体
* @return 保存条数
*/
int save(TbCfPlatformOrderEntity tbCfPlatformOrder);
int save(PlatformOrderVo tbCfPlatformOrder);
/**
* 根据主键更新实体
......@@ -51,7 +51,7 @@ public interface TbCfPlatformOrderService {
* @param tbCfPlatformOrder 实体
* @return 更新条数
*/
int update(TbCfPlatformOrderEntity tbCfPlatformOrder);
int update(PlatformOrderVo tbCfPlatformOrder);
/**
* 根据主键删除
......
package com.diaoyun.zion.chinafrica.service.impl;
import com.diaoyun.zion.chinafrica.dao.TbCfPlatformOrderDao;
import com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity;
import com.diaoyun.zion.chinafrica.service.TbCfPlatformOrderService;
import com.diaoyun.zion.chinafrica.vo.PlatformOrderVo;
import com.diaoyun.zion.master.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -22,12 +22,12 @@ public class TbCfPlatformOrderServiceImpl implements TbCfPlatformOrderService {
private TbCfPlatformOrderDao tbCfPlatformOrderDao;
@Override
public TbCfPlatformOrderEntity queryObject(String relativeId) {
public PlatformOrderVo queryObject(String relativeId) {
return tbCfPlatformOrderDao.queryObject(relativeId);
}
@Override
public List<TbCfPlatformOrderEntity> queryList(Map<String, Object> map) {
public List<PlatformOrderVo> queryList(Map<String, Object> map) {
return tbCfPlatformOrderDao.queryList(map);
}
......@@ -37,13 +37,13 @@ public class TbCfPlatformOrderServiceImpl implements TbCfPlatformOrderService {
}
@Override
public int save(TbCfPlatformOrderEntity tbCfPlatformOrder) {
public int save(PlatformOrderVo tbCfPlatformOrder) {
tbCfPlatformOrder.setPOrderId(IdUtil.createIdbyUUID());
return tbCfPlatformOrderDao.save(tbCfPlatformOrder);
}
@Override
public int update(TbCfPlatformOrderEntity tbCfPlatformOrder) {
public int update(PlatformOrderVo tbCfPlatformOrder) {
return tbCfPlatformOrderDao.update(tbCfPlatformOrder);
}
......
package com.diaoyun.zion.chinafrica.vo;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 代购与订单关联实体类
*/
public class PlatformOrderVo implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 对应id
*/
private String relativeId;
/**
* 订单id
*/
private String orderId;
/**
* 第三方订单id
*/
private String pOrderId;
/**
* 第三方平台名
*/
private String platformName;
/**
* 第三方平台编号
*/
private String platformCode;
/**
* 第三方发货地址
*/
private String pDeliveryAddress;
/**
* 代购人
*/
private String userName;
/**
* 代购人id
*/
private String userId;
/**
* 商品品名
*/
private String descripitionName;
/**
* 创建时间
*/
private Date createTime;
/**
* 实际付款
*/
private BigDecimal realityPay;
/**
* 第三方快递单号
*/
private String pExpressNumber;
/**
* 设置:商品品名
*/
public String setDescripitionName() {
return descripitionName;
}
/**
* 获取:商品品名
*/
public String getDescripitionName() {
this.descripitionName = descripitionName;
return descripitionName;
}
/**
* 设置:对应id
*/
public void setRelativeId(String relativeId) {
this.relativeId = relativeId;
}
/**
* 获取:对应id
*/
public String getRelativeId() {
return relativeId;
}
/**
* 设置:订单id
*/
public void setOrderId(String orderId) {
this.orderId = orderId;
}
/**
* 获取:订单id
*/
public String getOrderId() {
return orderId;
}
/**
* 设置:第三方订单id
*/
public void setPOrderId(String pOrderId) {
this.pOrderId = pOrderId;
}
/**
* 获取:第三方订单id
*/
public String getPOrderId() {
return pOrderId;
}
/**
* 设置:第三方平台名
*/
public void setPlatformName(String platformName) {
this.platformName = platformName;
}
/**
* 获取:第三方平台名
*/
public String getPlatformName() {
return platformName;
}
/**
* 设置:第三方平台编号
*/
public void setPlatformCode(String platformCode) {
this.platformCode = platformCode;
}
/**
* 获取:第三方平台编号
*/
public String getPlatformCode() {
return platformCode;
}
/**
* 设置:第三方发货地址
*/
public void setPDeliveryAddress(String pDeliveryAddress) {
this.pDeliveryAddress = pDeliveryAddress;
}
/**
* 获取:第三方发货地址
*/
public String getPDeliveryAddress() {
return pDeliveryAddress;
}
/**
* 获取:代购人
* @return
*/
public String getUserName() {
return userName;
}
/**
* 设置:代购人
* @return
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* 设置:代购人id
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* 获取:代购人id
*/
public String getUserId() {
return userId;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:实际付款
*/
public void setRealityPay(BigDecimal realityPay) {
this.realityPay = realityPay;
}
/**
* 获取:实际付款
*/
public BigDecimal getRealityPay() {
return realityPay;
}
/**
* 设置:第三方快递单号
*/
public void setPExpressNumber(String pExpressNumber) {
this.pExpressNumber = pExpressNumber;
}
/**
* 获取:第三方快递单号
*/
public String getPExpressNumber() {
return pExpressNumber;
}
}
......@@ -122,7 +122,7 @@ public class TranslateHelper {
//翻译属性名
if(ValidateUtils.isContainChinese(key)) {
tranlateFlag=true;
TranslateHelper.translateText(futureList,keyTranslateMap,key);
TranslateHelper.translateText(futuureList,keyTranslateMap,key);
}
}
if(!tranlateFlag) {
......
......@@ -40,7 +40,7 @@ spring:
# url: jdbc:mysql://localhost:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
# username: root
# password: root
#测试环境
# 测试环境
url: jdbc:mysql://47.106.242.175:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
username: root
password: diaoyun666
......
......@@ -257,13 +257,15 @@
<!--根据订单id,获取订单内商品详情-->
<select id="getOrderItemList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfItemDetailEntity">
SELECT
SELECT
t1.*,
t3.descripition_name descripitionName
t5.template_title descripitionName
FROM
tb_cf_item_detail t1
LEFT JOIN tb_cf_item_order_r t2 ON t1.item_id = t2.item_id
LEFT JOIN tb_cf_order t3 ON t2.order_id = t3.order_id
LEFT JOIN tb_cf_platform_order t4 on t3.order_id=t4.order_id
LEFT JOIN tb_cf_express_template t5 on t5.template_id=t4.descripition_id
WHERE
t2.enable_flag = 1 and t3.order_id=#{order_id}
</select>
......@@ -275,11 +277,13 @@
t1.item_num,
t1.item_price,
t1.item_category,
t3.descripition_name descripitionName
t5.template_title descripitionName
FROM
tb_cf_item_detail t1
LEFT JOIN tb_cf_item_order_r t2 ON t1.item_id = t2.item_id
LEFT JOIN tb_cf_order t3 ON t2.order_id = t3.order_id
LEFT JOIN tb_cf_platform_order t4 on t3.order_id=t4.order_id
LEFT JOIN tb_cf_express_template t5 on t5.template_id=t4.descripition_id
WHERE
t2.enable_flag = 1 and t3.order_id=#{order_id}
</select>
......@@ -291,8 +295,19 @@
<!--获取某段时间已发货订单数据-->
<select id="getDeliveryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfItemShippedEntity">
select o.user_id,o.order_id,p.create_time deliveryTime,o.delivery_address,
p.p_express_number expressId,i.item_id itemId,d.descripition_name descripitionName from tb_cf_order o left join tb_cf_platform_order p on o.order_id=p.order_id left join tb_cf_station_item i on p.item_id=i.item_id left join tb_cf_descripiton d on d.descripition_id=i.item_descrition_id where o.delivery_flag=20 and o.enable_flag=1
select
o.user_id,
o.order_id,
p.create_time deliveryTime,
o.delivery_address,
p.p_express_number expressId,
i.item_id itemId,
e.template_title descripitionName
from tb_cf_order o
LEFT JOIN tb_cf_platform_order p on o.order_id=p.order_id
LEFT JOIN tb_cf_station_item i on p.item_id=i.item_id
LEFT JOIN tb_cf_express_template e on e.template_id=p.descripition_id
where o.delivery_flag=10 and o.enable_flag=1
and p.create_time <![CDATA[ >= ]]> #{beginDate} and p.create_time <![CDATA[ < ]]> #{endDate}
</select>
......
......@@ -2,40 +2,44 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.diaoyun.zion.chinafrica.dao.TbCfPlatformOrderDao">
<resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity" id="tbCfPlatformOrderMap">
<result property="relativeId" column="relative_id"/>
<result property="orderId" column="order_id"/>
<result property="pOrderId" column="p_order_id"/>
<result property="platformName" column="platform_name"/>
<result property="platformCode" column="platform_code"/>
<result property="pDeliveryAddress" column="p_delivery_address"/>
<result property="agentName" column="agent_name"/>
<result property="agentId" column="agent_id"/>
<result property="createTime" column="create_time"/>
<result property="realPay" column="real_pay"/>
</resultMap>
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity">
<resultMap type="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo" id="tbCfPlatformOrderMap">
<result property="relativeId" column="relative_id"/>
<result property="orderId" column="order_id"/>
<result property="pOrderId" column="p_order_id"/>
<result property="platformName" column="platform_name"/>
<result property="platformCode" column="platform_code"/>
<result property="pDeliveryAddress" column="p_delivery_address"/>
<result property="userName" column="user_name"/>
<result property="userId" column="user_id"/>
<result property="createTime" column="create_time"/>
<result property="realityPay" column="reality_pay"/>
<result property="pExpressNumber" column="p_express_number"/>
</resultMap>
<!--查询代购信息-->
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo">
select
`relative_id`,
`order_id`,
`p_order_id`,
`platform_name`,
`platform_code`,
`p_delivery_address`,
`agent_name`,
`agent_id`,
`create_time`,
`real_pay`
from tb_cf_platform_order
where relative_id = #{id}
p.relative_id,
p.order_id,
p.p_order_id,
p.platform_name,
p.platform_code,
p.p_delivery_address,
u.user_name,
u.user_id,
p.create_time,
o.reality_pay,
p.p_express_number
from tb_cf_platform_order p
left join tb_cf_order o on p.order_id=o.order_id
left join sys_user u on p.user_id=u.user_id
where p.relative_id =#{relativeId}
</select>
<select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity">
<!--<select id="queryList" resultType="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo">
select
`relative_id`,
`order_id`,
p.order_id,
`p_order_id`,
`platform_name`,
`platform_code`,
......@@ -43,8 +47,9 @@
`agent_name`,
`agent_id`,
`create_time`,
`real_pay`
from tb_cf_platform_order
`real_pay`,
`p_express_number`
from tb_cf_platform_order p left join tb_cf_order o on p.order_id=o.order_id
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
......@@ -60,17 +65,19 @@
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_platform_order
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity">
</select>-->
<!--
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_platform_order
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
-->
<!--保存代购信息-->
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo">
insert into tb_cf_platform_order(
`relative_id`,
`order_id`,
......@@ -78,10 +85,11 @@
`platform_name`,
`platform_code`,
`p_delivery_address`,
`agent_name`,
`agent_id`,
`user_name`,
`user_id`,
`create_time`,
`real_pay`)
`reality_pay`,
`p_express_number`)
values(
#{relativeId},
#{orderId},
......@@ -89,37 +97,77 @@
#{platformName},
#{platformCode},
#{pDeliveryAddress},
#{agentName},
#{agentId},
#{userName},
#{userId},
#{createTime},
#{realPay})
#{realityPay},
#{pExpressNumber})
</insert>
<update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfPlatformOrderEntity">
update tb_cf_platform_order
<!--<update id="update" parameterType="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo">
update tb_cf_platform_order
<set>
<if test="orderId != null">`order_id` = #{orderId}, </if>
<if test="pOrderId != null">`p_order_id` = #{pOrderId}, </if>
<if test="platformName != null">`platform_name` = #{platformName}, </if>
<if test="platformCode != null">`platform_code` = #{platformCode}, </if>
<if test="pDeliveryAddress != null">`p_delivery_address` = #{pDeliveryAddress}, </if>
<if test="userName != null">`user_name` = #{userName}, </if>
<if test="userId != null">`user_id` = #{userId}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="realityPay != null">`reality_pay` = #{realityPay}, </if>
<if test="pExpressNumber != null">`p_express_number` = #{pExpressNumber}</if>
</set>
where relative_id = #{relativeId}
</update>-->
<!--更新代购信息-->
<update id="updates" parameterType="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo">
update tb_cf_platform_order
<set>
<if test="orderId != null">`order_id` = #{orderId}, </if>
<if test="pOrderId != null">`p_order_id` = #{pOrderId}, </if>
<if test="platformName != null">`platform_name` = #{platformName}, </if>
<if test="platformCode != null">`platform_code` = #{platformCode}, </if>
<if test="pDeliveryAddress != null">`p_delivery_address` = #{pDeliveryAddress}, </if>
<if test="agentName != null">`agent_name` = #{agentName}, </if>
<if test="agentId != null">`agent_id` = #{agentId}, </if>
<if test="userName != null">`user_name` = #{userName}, </if>
<if test="userId != null">`user_id` = #{userId}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="realPay != null">`real_pay` = #{realPay}</if>
<if test="realityPay != null">`reality_pay` = #{realityPay}, </if>
<if test="pExpressNumber != null">`p_express_number` = #{pExpressNumber}</if>
</set>
where relative_id = #{relativeId}
</update>
<delete id="delete">
delete from tb_cf_platform_order where relative_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_platform_order where relative_id in
<foreach item="relativeId" collection="array" open="(" separator="," close=")">
#{relativeId}
</foreach>
</delete>
<!-- <delete id="delete">
delete from tb_cf_platform_order where relative_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_platform_order where relative_id in
<foreach item="relativeId" collection="array" open="(" separator="," close=")">
#{relativeId}
</foreach>
</delete>-->
<!--获取订单的代购信息-->
<select id="getAgentInfo" resultType="com.diaoyun.zion.chinafrica.vo.PlatformOrderVo">
select
p.relative_id,
p.order_id,
p.p_order_id,
p.platform_name,
p.platform_code,
p.p_delivery_address,
u.user_name,
u.user_id,
p.create_time,
o.reality_pay,
p.p_express_number
from tb_cf_platform_order p
left join tb_cf_order o on p.order_id=o.order_id
left join sys_user u on p.user_id=u.user_id
where p.order_id=#{order_id};
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论