Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
1add0534
提交
1add0534
authored
12月 02, 2019
作者:
luojie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改订单列表商品总价
上级
a4e21e14
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
112 行增加
和
46 行删除
+112
-46
TbCfOrderController.java
...ain/java/com/platform/controller/TbCfOrderController.java
+13
-1
TbCfItemOrderRDao.java
...min/src/main/java/com/platform/dao/TbCfItemOrderRDao.java
+5
-0
TbCfOrderDao.java
...rm-admin/src/main/java/com/platform/dao/TbCfOrderDao.java
+2
-0
TbCfOrderEntity.java
...in/src/main/java/com/platform/entity/TbCfOrderEntity.java
+12
-0
TbCfItemOrderRService.java
...main/java/com/platform/service/TbCfItemOrderRService.java
+3
-0
TbCfItemOrderRServiceImpl.java
.../com/platform/service/impl/TbCfItemOrderRServiceImpl.java
+6
-0
TbCfOrderServiceImpl.java
.../java/com/platform/service/impl/TbCfOrderServiceImpl.java
+19
-7
TbCfItemOrderRDao.xml
...src/main/resources/com/platform/dao/TbCfItemOrderRDao.xml
+9
-0
TbCfOrderDao.xml
...dmin/src/main/resources/com/platform/dao/TbCfOrderDao.xml
+38
-34
tbcforder.js
platform-admin/src/main/webapp/js/sys/tbcforder.js
+4
-3
tbcforderList.js
platform-admin/src/main/webapp/js/sys/tbcforderList.js
+1
-1
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfOrderController.java
浏览文件 @
1add0534
...
...
@@ -3,6 +3,7 @@ package com.platform.controller;
import
com.platform.entity.TbCfItemDetailEntity
;
import
com.platform.entity.TbCfOrderEntity
;
import
com.platform.entity.TbCfOrderListEntity
;
import
com.platform.service.TbCfItemOrderRService
;
import
com.platform.service.TbCfOrderListService
;
import
com.platform.service.TbCfOrderService
;
import
com.platform.utils.PageUtils
;
...
...
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -31,6 +33,9 @@ public class TbCfOrderController {
private
TbCfOrderService
tbCfOrderService
;
@Autowired
private
TbCfOrderListService
tbCfOrderListService
;
@Autowired
private
TbCfItemOrderRService
tbCfItemOrderRService
;
/**
* 查看列表
*/
...
...
@@ -42,8 +47,11 @@ public class TbCfOrderController {
Query
query
=
new
Query
(
params
);
List
<
TbCfOrderEntity
>
tbCfOrderList
=
tbCfOrderService
.
queryList
(
query
);
for
(
TbCfOrderEntity
tbCfOrder:
tbCfOrderList
){
BigDecimal
itemNum
=
BigDecimal
.
valueOf
(
tbCfItemOrderRService
.
getItemNum
(
tbCfOrder
.
getOrdersId
()));
tbCfOrder
.
setItemsPrice
(
tbCfOrder
.
getItemPrice
().
multiply
(
itemNum
));
}
int
total
=
tbCfOrderService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
tbCfOrderList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
...
...
@@ -159,6 +167,10 @@ 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
);
...
...
platform-admin/src/main/java/com/platform/dao/TbCfItemOrderRDao.java
浏览文件 @
1add0534
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCfItemDetailEntity
;
import
com.platform.entity.TbCfItemOrderREntity
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -21,4 +22,8 @@ public interface TbCfItemOrderRDao extends BaseDao<TbCfItemOrderREntity> {
int
updateExpressStatuss
(
String
[]
sids
);
int
updateExpressStatus
(
String
[]
sids
);
TbCfItemOrderREntity
getOrderItemId
(
String
orderId
,
String
itemId
);
Integer
getItemNum
(
String
ordersId
);
}
platform-admin/src/main/java/com/platform/dao/TbCfOrderDao.java
浏览文件 @
1add0534
...
...
@@ -54,4 +54,6 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
int
updateExpressStatusDelivery
(
String
[]
sid
);
BigDecimal
getPrice
(
String
ordersId
);
void
updateOrderStatus
(
TbCfOrderEntity
tbCfOrderEntity
);
}
platform-admin/src/main/java/com/platform/entity/TbCfOrderEntity.java
浏览文件 @
1add0534
...
...
@@ -77,6 +77,10 @@ public class TbCfOrderEntity implements Serializable {
* 商品总价
*/
private
BigDecimal
itemsPrice
;
/**
* 商品总价
*/
private
BigDecimal
itemPrice
;
/**
* 总价
*/
...
...
@@ -519,4 +523,12 @@ public class TbCfOrderEntity implements Serializable {
public
void
setOrdersId
(
String
ordersId
)
{
this
.
ordersId
=
ordersId
;
}
public
BigDecimal
getItemPrice
()
{
return
itemPrice
;
}
public
void
setItemPrice
(
BigDecimal
itemPrice
)
{
this
.
itemPrice
=
itemPrice
;
}
}
platform-admin/src/main/java/com/platform/service/TbCfItemOrderRService.java
浏览文件 @
1add0534
package
com
.
platform
.
service
;
import
com.platform.entity.TbCfItemDetailEntity
;
import
com.platform.entity.TbCfItemOrderREntity
;
import
java.util.List
;
...
...
@@ -89,4 +90,6 @@ public interface TbCfItemOrderRService {
* @return
*/
int
updateExpressStatusDelivery
(
String
[]
sids
);
Integer
getItemNum
(
String
ordersId
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfItemOrderRServiceImpl.java
浏览文件 @
1add0534
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
;
...
...
@@ -79,4 +80,9 @@ public class TbCfItemOrderRServiceImpl implements TbCfItemOrderRService {
return
tbCfItemOrderRDao
.
updateExpressStatusDelivery
(
sids
);
}
@Override
public
Integer
getItemNum
(
String
ordersId
)
{
return
tbCfItemOrderRDao
.
getItemNum
(
ordersId
);
}
}
platform-admin/src/main/java/com/platform/service/impl/TbCfOrderServiceImpl.java
浏览文件 @
1add0534
...
...
@@ -12,12 +12,11 @@ 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
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* Service实现类
...
...
@@ -111,10 +110,23 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
tbCfItemOrderREntity
.
setOrderItemId
(
tbCfPlatformOrder
.
getOrdersId
());
tbCfItemOrderREntity
.
setOrderStatus
(
OrderStatusEnum
.
SHIPPED
.
getValue
());
tbCfItemOrderRDao
.
update
(
tbCfItemOrderREntity
);
TbCfOrderEntity
tbCfOrderEntity
=
new
TbCfOrderEntity
();
tbCfOrderEntity
.
setOrderId
(
tbCfOrderEntity
.
getOrderId
());
tbCfOrderEntity
.
setOrderStatus
(
OrderStatusEnum
.
SHIPPED
.
getValue
());
tbCfOrderDao
.
update
(
tbCfOrderEntity
);
List
<
TbCfItemDetailEntity
>
orderItemList
=
tbCfOrderDao
.
getOrderItemList
(
tbCfPlatformOrder
.
getOrderId
());
Set
<
Integer
>
status
=
new
HashSet
<>();
for
(
TbCfItemDetailEntity
itemList:
orderItemList
){
TbCfItemOrderREntity
tbCfItemOrder
=
tbCfItemOrderRDao
.
getOrderItemId
(
tbCfPlatformOrder
.
getOrderId
(),
itemList
.
getItemId
());
Integer
orderStatus
=
tbCfItemOrder
.
getOrderStatus
();
status
.
add
(
orderStatus
);
}
Iterator
it
=
status
.
iterator
();
while
(
it
.
hasNext
()){
if
(
status
.
size
()==
1
&&
"40"
.
equals
(
it
.
next
())){
TbCfOrderEntity
tbCfOrderEntity
=
new
TbCfOrderEntity
();
tbCfOrderEntity
.
setOrderId
(
tbCfPlatformOrder
.
getOrderId
());
tbCfOrderEntity
.
setOrderStatus
(
OrderStatusEnum
.
SHIPPED
.
getValue
());
tbCfOrderDao
.
updateOrderStatus
(
tbCfOrderEntity
);
}
}
//更新发货时间,如果原值为空就更新,否则保留原值
TbCfItemOrderREntity
tbCfItemOrderREntity2
=
new
TbCfItemOrderREntity
();
tbCfItemOrderREntity2
.
setOrderItemId
(
tbCfPlatformOrder
.
getOrdersId
());
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfItemOrderRDao.xml
浏览文件 @
1add0534
...
...
@@ -105,6 +105,11 @@
where order_item_id = #{orderItemId}
</update>
<select
id=
"getItemNum"
resultType=
"int"
>
select t2.item_num from tb_cf_item_order_r t1 left join tb_cf_item_detail t2 on t1.item_id=t2.item_id where t1.order_item_id=#{ordersId}
</select>
<delete
id=
"delete"
>
delete from tb_cf_item_order_r where order_item_id = #{value}
</delete>
...
...
@@ -130,6 +135,10 @@
where r.order_item_id = #{orderItemId} and r.delivery_time is null
</update>
<select
id=
"getOrderItemId"
resultType=
"com.platform.entity.TbCfItemOrderREntity"
>
select * from tb_cf_item_order_r where order_id=#{orderId} and item_id=#{itemId}
</select>
<!--根据快递单号id,修改物流状态为已入中国仓库 -->
<update
id=
"updateExpressStatus"
>
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfOrderDao.xml
浏览文件 @
1add0534
...
...
@@ -88,39 +88,40 @@
where i.order_item_id = #{ordersId}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfOrderEntity"
>
select
i.order_item_id ordersId,
o.order_id,
o.order_no,
o.order_name,
o.order_time,
i.update_time updateTime,
o.deal_time,
i.close_time closeTime,
i.order_status orderStatus,
o.user_id,
o.user_name,
o.delivery_address_id,
o.delivery_address,
o.delivery_name,
o.delivery_phone,
o.items_price,
o.total_price,
o.reality_pay,
i.delivery_flag deliveryFlag,
i.delivery_time deliveryTime,
o.express_cost,
o.coupon_id,
c.coupon_title,
c.deduct_amount,
o.tax,
o.fee,
o.pay_id,
o.pay_status,
o.enable_flag
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
select
i.order_item_id ordersId,
o.order_id,
o.order_no,
o.order_name,
o.order_time,
i.update_time updateTime,
o.deal_time,
i.close_time closeTime,
i.order_status orderStatus,
o.user_id,
o.user_name,
o.delivery_address_id,
o.delivery_address,
o.delivery_name,
o.delivery_phone,
d.item_price itemPrice,
o.total_price,
o.reality_pay,
i.delivery_flag deliveryFlag,
i.delivery_time deliveryTime,
o.express_cost,
o.coupon_id,
c.coupon_title,
c.deduct_amount,
o.tax,
o.fee,
o.pay_id,
o.pay_status,
o.enable_flag
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
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>
...
...
@@ -156,7 +157,7 @@
<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
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>
...
...
@@ -307,4 +308,7 @@
<select
id=
"getPrice"
resultType=
"BigDecimal"
>
select i.item_price from tb_cf_item_detail i left join tb_cf_item_order_r r on r.item_id=i.item_id where r.order_item_id=#{ordersId}
</select>
<update
id=
"updateOrderStatus"
parameterType=
"com.platform.entity.TbCfOrderEntity"
>
update tb_cf_order set order_status=#{orderStatus} where order_id=#{orderId}
</update>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/js/sys/tbcforder.js
浏览文件 @
1add0534
...
...
@@ -16,12 +16,13 @@ $(function () {
{
label
:
'代购状态'
,
name
:
'deliveryFlag'
,
index
:
'deliveryFlag'
,
width
:
70
,
formatter
:
deliveryFlagFormat
},
{
label
:
'代购时间'
,
name
:
'deliveryTime'
,
index
:
'deliveryTime'
,
width
:
100
},
{
label
:
'用户id'
,
name
:
'userId'
,
index
:
'user_id'
,
width
:
110
,
hidden
:
true
},
{
label
:
'用户名'
,
name
:
'userName'
,
index
:
'user_name'
,
width
:
5
5
},
{
label
:
'用户名'
,
name
:
'userName'
,
index
:
'user_name'
,
width
:
6
5
},
{
label
:
'商品品名Id'
,
name
:
'descripitionId'
,
index
:
'descripition_id'
,
width
:
50
,
hidden
:
true
},
/* {label: '商品品名id', name: 'templateId', index: 'templateId', width: 50,hidden:true},
{label: '商品品名', name: 'templateTitle', index: 'templateTitle', width: 50,hidden:true},*/
{
label
:
'商品总价'
,
name
:
'itemsPrice'
,
index
:
'items_price'
,
width
:
80
},
{
label
:
'总价'
,
name
:
'totalPrice'
,
index
:
'total_price'
,
width
:
80
,
hidden
:
true
},
{
label
:
'商品总价'
,
name
:
'itemPrice'
,
index
:
'itemPrice'
,
width
:
60
,
hidden
:
true
},
{
label
:
'商品总价'
,
name
:
'itemsPrice'
,
index
:
'itemsPrice'
,
width
:
60
,
formatter
:
"currency"
,
formatoptions
:
{
prefix
:
"$"
}},
{
label
:
'商品总价'
,
name
:
'totalPrice'
,
index
:
'total_price'
,
width
:
60
,
hidden
:
true
},
{
label
:
'实际付款'
,
name
:
'realityPay'
,
index
:
'reality_pay'
,
width
:
50
,
hidden
:
true
},
{
label
:
'收货地址Id'
,
name
:
'deliveryAddressId'
,
index
:
'delivery_address_id'
,
width
:
110
,
hidden
:
true
},
{
label
:
'收货地址'
,
name
:
'deliveryAddress'
,
index
:
'delivery_address'
,
width
:
120
},
...
...
platform-admin/src/main/webapp/js/sys/tbcforderList.js
浏览文件 @
1add0534
...
...
@@ -13,7 +13,7 @@ $(function () {
{
label
:
'用户id'
,
name
:
'userId'
,
index
:
'user_id'
,
width
:
120
},
{
label
:
'订单号'
,
name
:
'orderNo'
,
index
:
'order_no'
,
width
:
80
},
{
label
:
'下单时间'
,
name
:
'orderTime'
,
index
:
'order_time'
,
width
:
70
},
{
label
:
'
金额'
,
name
:
'itemPrice'
,
index
:
'item_p
rice'
,
width
:
55
,
formatter
:
"currency"
,
formatoptions
:
{
prefix
:
"$"
}},
{
label
:
'
商品总价'
,
name
:
'itemPrice'
,
index
:
'itemP
rice'
,
width
:
55
,
formatter
:
"currency"
,
formatoptions
:
{
prefix
:
"$"
}},
// formatter: "currency",formatoptions: {thousandsSeparator:",",decimalSeparator:".",decimalPlaces:"2", prefix:"$"}}, //在金额前加上$,加上后,页合计无法正常显示。
{
label
:
'商品'
,
name
:
'itemTitle'
,
index
:
'item_title'
,
width
:
90
},
{
label
:
'商品数量'
,
name
:
'itemNum'
,
index
:
'item_num'
,
width
:
30
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论