提交 00b4a2c8 authored 作者: luojie's avatar luojie

修改订单

上级 8d8eca94
......@@ -167,10 +167,6 @@ public class TbCfOrderController {
//查询列表数据
Query query = new Query(params);
List<TbCfOrderListEntity> tbCfOrderList = tbCfOrderListService.queryOrderList(query);
for(TbCfOrderListEntity tbCfOrder:tbCfOrderList){
BigDecimal itemNum = BigDecimal.valueOf(tbCfOrder.getItemNum());
tbCfOrder.setItemPrice(tbCfOrder.getItemPrice().multiply(itemNum));
}
int total = tbCfOrderListService.queryOrderTotal(query);
PageUtils pageUtil = new PageUtils(tbCfOrderList,total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
......
......@@ -26,11 +26,16 @@ public interface TbCfItemOrderRDao extends BaseDao<TbCfItemOrderREntity> {
int updateExpressStatus(String[] sids);
TbCfItemOrderREntity getOrderItemId(String orderId, String itemId);
TbCfItemOrderREntity getOrderItemId(@Param("orderId") String orderId, @Param("itemId")String itemId);
Integer getItemNum(String ordersId);
int getOrderStatus(String ordersId);
Set<Integer> findOrderStatus(String orderId);
TbCfItemOrderREntity findDeliveryStatus(String[] sids);
int updateIsSend(String ordersId);
}
......@@ -58,4 +58,9 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
int updateOrderStatus(TbCfOrderEntity tbCfOrderEntity);
int updateStatus(TbCfOrderEntity tbCfOrderEntity);
String getPhone(String orderId);
int updateDeliveryStatus(String ordersId);
}
package com.platform.dao;
import com.platform.entity.SysLogEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.entity.TbCfPlatformOrderEntity;
import com.platform.entity.TbCfOrderEntity;
import com.platform.vo.PlatformOrderVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 第三方平台对应订单信息Dao
*
......@@ -27,5 +28,5 @@ public interface TbCfPlatformOrderDao extends BaseDao<PlatformOrderVo> {
TbCfItemOrderREntity getOrdersId(String sid);
int findUserByExpressNumber(String[] sids);
List<TbCfOrderEntity> findOrderByExpressNumber(String[] sids);
}
......@@ -22,6 +22,8 @@ public class TbCfFinanceEntity implements Serializable {
* 订单id
*/
private String orderId;
private String orderNo;
/**
* 用户id
*/
......@@ -151,4 +153,12 @@ public class TbCfFinanceEntity implements Serializable {
public String getReceiptUrl() {
return receiptUrl;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
}
......@@ -28,7 +28,7 @@ public class TbCfOrderListEntity implements Serializable {
/**
* 用户id
*/
private String userId;
private String userInfo;
/**
* 订单号
*/
......@@ -102,18 +102,15 @@ public class TbCfOrderListEntity implements Serializable {
public void setItemId(String itemId) {
this.itemId = itemId;
}
/**
* 获取:用户id
*/
public String getUserId() {
return userId;
public String getUserInfo() {
return userInfo;
}
/**
* 设置:用户id
*/
public void setUserId(String userId) {
this.userId = userId;
public void setUserInfo(String userInfo) {
this.userInfo = userInfo;
}
/**
* 获取:订单号
*/
......
package com.platform.service;
import com.platform.entity.TbCfItemDetailEntity;
import com.platform.entity.TbCfItemOrderREntity;
import java.util.List;
......@@ -18,7 +17,6 @@ public interface TbCfItemOrderRService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfItemOrderREntity queryObject(String orderItemId);
......@@ -97,4 +95,6 @@ public interface TbCfItemOrderRService {
int getOrderStatus(String ordersId);
Set<Integer> findOrderStatus(String orderId);
int updateIsSend(String ordersId);
}
......@@ -100,4 +100,7 @@ public interface TbCfOrderService {
int updateStatus(TbCfOrderEntity tbCfOrderEntity);
String getPhone(String orderId);
}
package com.platform.service;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.entity.TbCfOrderEntity;
import com.platform.vo.PlatformOrderVo;
import java.util.List;
......@@ -73,5 +74,6 @@ public interface TbCfPlatformOrderService {
TbCfItemOrderREntity getOrdersId(String sid);
int findUserByExpressNumber(String[] sids);
List<TbCfOrderEntity> findOrderByExpressNumber(String[] sids);
}
package com.platform.service.impl;
import com.platform.dao.TbCfItemOrderRDao;
import com.platform.entity.TbCfItemDetailEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.service.TbCfItemOrderRService;
import com.platform.utils.IdUtil;
......@@ -96,5 +95,9 @@ public class TbCfItemOrderRServiceImpl implements TbCfItemOrderRService {
return tbCfItemOrderRDao.findOrderStatus(orderId);
}
@Override
public int updateIsSend(String ordersId) {
return tbCfItemOrderRDao.updateIsSend(ordersId);
}
}
......@@ -4,7 +4,6 @@ import com.platform.dao.*;
import com.platform.entity.TbCfItemDetailEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.entity.TbCfOrderEntity;
import com.platform.entity.TbCfPlatformEntity;
import com.platform.enums.DeliveryStatusEnum;
import com.platform.enums.OrderStatusEnum;
import com.platform.service.TbCfOrderService;
......@@ -12,7 +11,6 @@ import com.platform.utils.IdUtil;
import com.platform.utils.ShiroUtils;
import com.platform.utils.StringUtils;
import com.platform.vo.PlatformOrderVo;
import org.jgroups.protocols.FORK;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -103,13 +101,13 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
tbCfPlatformOrder.setUserName(sysUserDao.queryById(userId));
res = tbCfPlatformOrderDao.save(tbCfPlatformOrder);
}
//如果填写了原网站订单号,那么意味着已发货,需要更改发货状态
if(StringUtils.isNotEmpty(tbCfPlatformOrder.getpOrderId())) {
TbCfItemOrderREntity tbCfItemOrderREntity = new TbCfItemOrderREntity();
tbCfItemOrderREntity.setOrderItemId(tbCfPlatformOrder.getOrdersId());
tbCfItemOrderREntity.setOrderStatus(OrderStatusEnum.SHIPPED.getValue());
tbCfItemOrderRDao.update(tbCfItemOrderREntity);
//如果填写了快递单号,那么意味着已代购,需要更改发货状态
if(StringUtils.isNotEmpty(tbCfPlatformOrder.getpExpressNumber())) {
TbCfItemOrderREntity tbCfItemOrderREntity2 = new TbCfItemOrderREntity();
tbCfItemOrderREntity2.setOrderItemId(tbCfPlatformOrder.getOrdersId());
tbCfItemOrderREntity2.setDeliveryFlag(DeliveryStatusEnum.PURCHASE.getValue());
tbCfItemOrderREntity2.setOrderStatus(OrderStatusEnum.SHIPPED.getValue());
tbCfItemOrderRDao.update(tbCfItemOrderREntity2);
List<TbCfItemDetailEntity> orderItemList = tbCfOrderDao.getOrderItemList(tbCfPlatformOrder.getOrderId());
Set<Integer> status=new HashSet<>();
for(TbCfItemDetailEntity itemList:orderItemList){
......@@ -126,19 +124,11 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
tbCfOrderDao.update(tbCfOrderEntity);
}
}
//更新发货时间,如果原值为空就更新,否则保留原值
TbCfItemOrderREntity tbCfItemOrderREntity2 = new TbCfItemOrderREntity();
tbCfItemOrderREntity2.setOrderItemId(tbCfPlatformOrder.getOrdersId());
tbCfItemOrderREntity2.setDeliveryTime(new Date());
tbCfItemOrderRDao.updateDeliveryTime(tbCfItemOrderREntity2);
}
//如果填写了快递单号,那么意味着已代购,需要更改发货状态
if(StringUtils.isNotEmpty(tbCfPlatformOrder.getpExpressNumber())) {
TbCfItemOrderREntity tbCfItemOrderREntity2 = new TbCfItemOrderREntity();
tbCfItemOrderREntity2.setOrderItemId(tbCfPlatformOrder.getOrdersId());
tbCfItemOrderREntity2.setDeliveryFlag(DeliveryStatusEnum.PURCHASE.getValue());
tbCfItemOrderRDao.update(tbCfItemOrderREntity2);
TbCfItemOrderREntity tbCfItemOrderREntity3= new TbCfItemOrderREntity();
tbCfItemOrderREntity3.setOrderItemId(tbCfPlatformOrder.getOrdersId());
tbCfItemOrderREntity3.setDeliveryTime(new Date());
tbCfItemOrderRDao.updateDeliveryTime(tbCfItemOrderREntity3);
}
return res;
}
......@@ -152,5 +142,9 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
return tbCfOrderDao.updateStatus(tbCfOrderEntity);
}
@Override
public String getPhone(String orderId) {
return tbCfOrderDao.getPhone(orderId);
}
}
......@@ -2,9 +2,8 @@ package com.platform.service.impl;
import com.platform.dao.SysUserDao;
import com.platform.dao.TbCfPlatformOrderDao;
import com.platform.entity.SysLogEntity;
import com.platform.entity.SysUserEntity;
import com.platform.entity.TbCfItemOrderREntity;
import com.platform.entity.TbCfOrderEntity;
import com.platform.service.TbCfPlatformOrderService;
import com.platform.utils.IdUtil;
import com.platform.utils.ShiroUtils;
......@@ -80,7 +79,8 @@ public class TbCfPlatformOrderServiceImpl implements TbCfPlatformOrderService {
}
@Override
public int findUserByExpressNumber(String[] sids) {
return tbCfPlatformOrderDao.findUserByExpressNumber(sids);
public List<TbCfOrderEntity> findOrderByExpressNumber(String[] sids) {
return tbCfPlatformOrderDao.findOrderByExpressNumber(sids);
}
}
......@@ -22,7 +22,7 @@ public class FeeTask {
@Autowired
private TbCfFeeService tbCfFeeService;
@Scheduled(cron = "0 0/20 * * * ? ")
@Scheduled(cron = "0 0/30 * * * ? ")
public void FeeTask() {
String url="http://op.juhe.cn/onebox/exchange/currency";
Map<String,String> parameters=new HashMap<>();
......
......@@ -74,16 +74,22 @@
<select id="queryList" resultType="com.platform.entity.TbCfFinanceEntity">
select
`finace_id`,
`order_id`,
`user_id`,
`pay_account`,
`pay_id`,
`pay_way_code`,
`pay_Time`,
`receipt_url`
from tb_cf_finance
WHERE 1=1
DISTINCT
r.order_id,
f.finace_id,
r.order_no orderNo,
CONCAT_WS("_",u.nick,u.user_no) userInfo,
f.pay_account,
f.pay_id,
f.pay_way_code,
f.pay_Time,
f.receipt_url
from tb_cf_finance f
left join tb_cf_order r on r.order_id=f.order_id
left join tb_cf_user_info u on f.user_id=u.user_id
left join tb_cf_item_order_r i on i.order_id = r.order_id
WHERE 1=1 and i.enable_flag=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
......
......@@ -153,6 +153,12 @@
select order_status from tb_cf_item_order_r where order_id=#{orderId}
</select>
<update id="updateIsSend" parameterType="com.platform.entity.TbCfItemOrderREntity">
update tb_cf_item_order_r r
set r.is_send = 1
where r.order_item_id = #{ordersId}
</update>
<!--根据快递单号id,修改物流状态为已入中国仓库 -->
<update id="updateExpressStatus">
UPDATE tb_cf_order o,tb_cf_platform_order p,tb_cf_item_order_r i
......
......@@ -157,7 +157,8 @@
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_order o left join tb_cf_coupon c on c.coupon_id=o.coupon_id
left join tb_cf_item_order_r i on i.order_id=o.order_id
WHERE 1=1 and i.enable_flag=1 and o.enable_flag=1
left join tb_cf_item_detail d on d.item_id=i.item_id
WHERE 1=1 and i.enable_flag=1 and o.enable_flag=1
<if test="name != null and name.trim() != ''">
AND o.order_no LIKE concat('%',#{name},'%')
</if>
......@@ -300,9 +301,13 @@
where order_id = #{orderId}
</update>
<select id="getPhone" resultType="String">
select delivery_phone from tb_cf_order where order_id=#{orderId}
</select>
<!--根据订单id,获取订单内商品详情-->
<select id="getOrderItemList" resultType="com.platform.entity.TbCfItemDetailEntity">
select t2.* from tb_cf_item_order_r t1,tb_cf_item_detail t2 where t1.order_item_id =#{ordersId}
select t2.* from tb_cf_item_order_r t1,tb_cf_item_detail t2 where t1.order_id =#{orderId}
and t1.enable_flag=1 and t2.item_id=t1.item_id
</select>
......
......@@ -21,26 +21,20 @@
<!--查询订单列表-->
<select id="queryOrderList" resultType="com.platform.entity.TbCfOrderListEntity">
select
i.order_item_id ordersId,
DISTINCT
o.order_id,
i.item_id,
o.user_id,
o.order_no,
CONCAT_WS("_",u.nick,u.user_no) userInfo,
o.order_time,
d.item_price,
d.item_title,
d.item_num,
o.reality_pay,
o.delivery_name,
o.delivery_phone,
o.delivery_address,
f.pay_way_code,
p.p_express_number,
i.delivery_flag,
s.user_name
f.pay_way_code
from tb_cf_order o
left join tb_cf_item_order_r i on o.order_id=i.order_id
left join tb_cf_item_detail d on d.item_id=i.item_id
left join tb_cf_platform_order p on p.order_id=o.order_id
left join tb_cf_finance f on f.order_id=o.order_id
left join sys_user s on s.user_id=p.user_id
INNER JOIN tb_cf_item_order_r i on o.order_id=i.order_id
INNER JOIN tb_cf_finance f on f.order_id=o.order_id
INNER JOIN tb_cf_user_info u on u.user_id=o.user_id
WHERE 1=1 and i.enable_flag=1 and f.pay_way_code!='null'
<if test="name != null and name.trim() != ''">
AND o.order_no LIKE concat('%',#{name},'%')
......@@ -75,11 +69,9 @@
select
count(*)
from tb_cf_order o
left join tb_cf_item_order_r i on o.order_id=i.order_id
left join tb_cf_item_detail d on d.item_id=i.item_id
left join tb_cf_platform_order p on p.order_id=o.order_id
left join tb_cf_finance f on f.order_id=o.order_id
left join sys_user s on s.user_id=p.user_id
INNER JOIN tb_cf_item_order_r i on o.order_id=i.order_id
INNER JOIN tb_cf_finance f on f.order_id=o.order_id
INNER JOIN tb_cf_user_info u on u.user_id=o.user_id
WHERE 1=1 and i.enable_flag=1 and f.pay_way_code!='null'
<if test="name != null and name.trim() != ''">
AND o.order_no LIKE concat('%',#{name},'%')
......
......@@ -187,5 +187,14 @@
select order_id from tb_cf_platform_order where p_express_number=#{sid}
</select>
<select id="findOrderByExpressNumber" resultType="com.platform.entity.TbCfOrderEntity">
select o.delivery_phone,i.order_item_id ordersId,i.order_id
from tb_cf_platform_order p
left join tb_cf_item_order_r i on p.order_id=i.order_id
left join tb_cf_order o on o.order_id=i.order_id
where i.is_send=0 and i.delivery_flag=10 and p.p_express_number in
<foreach collection="array" item="sids" open="(" separator="," close=")">
#{sids}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -3,8 +3,9 @@ $(function () {
url: '../tbcffinance/list',
colModel: [
{label: 'finaceId', name: 'finaceId', index: 'finace_id', key: true, hidden: true},
{label: '订单id', name: 'orderId', index: 'order_id', width: 80},
{label: '用户id', name: 'userId', index: 'user_id', width: 80},
{label: '订单id', name: 'orderId', index: 'order_id', width: 80, hidden: true},
{label: '订单号', name: 'orderNo', index: 'orderNo', width: 80},
{label: '用户', name: 'userInfo', index: 'userInfo', width: 80},
{label: '支付款项', name: 'payAccount', index: 'pay_account', width: 80},
{label: '支付流水号', name: 'payId', index: 'pay_id', width: 80},
{label: '支付方式', name: 'payWayCode', index: 'pay_way_code', width: 80},
......
......@@ -102,13 +102,19 @@ let vm = new Vue({
}],
deliveryFlagOptions: [{
value: '0',
label: '未代购'
label: '待采购'
},{
value: '10',
label: '已代购'
},{
value: '20',
label: '已到达中国仓'
},{
value: '40',
value: '40',
label: '已到达非洲仓'
},{
value: '50',
label: '买家已签收'
}],
pickerOptions: {
shortcuts: [{
......
......@@ -7,19 +7,17 @@ $(function () {
cellurl:'../tbcforder/changeDeliveryFlag/',*/
colModel: [
//显示字段
{label: 'ordersId', name: 'ordersId', index: 'ordersId', key: true, hidden: true},
{label: 'orderId', name: 'orderId', index: 'order_id', hidden: true},
{label: 'itemId', name: 'itemId', index: 'item_id',hidden: true},
{label: '用户id', name: 'userId', index: 'user_id', width: 120},
{label: 'orderId', name: 'orderId', index: 'order_id', key: true, hidden: true},
{label: '订单号', name: 'orderNo', index: 'order_no', width: 80},
{label: '用户', name: 'userInfo', index: 'userInfo', width: 120},
{label: '下单时间', name: 'orderTime', index: 'order_time', width: 70},
{label: '商品总价',name: 'itemPrice', index: 'itemPrice', width: 55,formatter: "currency",formatoptions: { prefix:"$"}},
{label: '下单金额',name: 'realityPay', index: 'reality_pay', width: 45},
// formatter: "currency",formatoptions: {thousandsSeparator:",",decimalSeparator:".",decimalPlaces:"2", prefix:"$"}}, //在金额前加上$,加上后,页合计无法正常显示。
{label: '商品', name: 'itemTitle', index: 'item_title', width: 90},
{label: '商品数量', name: 'itemNum', index: 'item_num', width: 30},
{label: '收货人', name: 'deliveryName', index: 'delivery_name', width: 100},
{label: '收货地址', name: 'deliveryPhone', index: 'delivery_phone', width: 100},
{label: '收货地址', name: 'deliveryAddress', index: 'delivery_address', width: 100},
{label: '快递单号', name: 'pExpressNumber', index: 'p_express_number', width: 80,sortable:false},
{label: '支付方式', name: 'payWayCode', index: 'pay_way_code', width: 35},
{label: '支付方式', name: 'payWayCode', index: 'pay_way_code', width: 45},
{label: '物流状态', name: 'deliveryFlag', index: 'delivery_flag', width: 40,formatter:deliveryFlagFormat},
{label: '代购人', name: 'userName', index: 'user_name', width: 40},
{label: '总金额', name: 'totalPay', index: 'totalPay', width: 40,hidden:true}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论